-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.pl
29 lines (26 loc) · 839 Bytes
/
tests.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! C:\strawberry\perl\bin\perl.exe -w
use File::Basename;
use lib (dirname(__FILE__)); #Êîðåíü ñàéòà.
use folder_config;
use lib (FRAMEWORK_CLASSES_PATH, APP_CONFIG_PATH,
APP_MODELS_PATH, APP_CLASSES_PATH, APP_JSON_PATH,
APP_TESTS_PATH, APP_I10N_PATH);
use DBI;
use CGI qw(header);
use config_test;
use strict;
opendir (DIR, APP_TESTS_PATH) or die $!;
my $dbh = DBI->connect('DBI:' . DB_TYPE. ':' . DB_NAME,
DB_USER,
DB_PASSWORD
)
|| die "Could not connect to database: $DBI::errstr";
$dbh->do("SET NAMES 'utf8'");
$dbh->{'mysql_enable_utf8'} = 1;
print header(-type => "text/plain", -charset => "utf-8");
while (my $test = readdir(DIR)) {
next if ($test =~ m/^\./);
require $test;
$test =~ s/\.pm//;
$test->new($dbh)->run();
}