forked from movabletype/movabletype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-common.pl
43 lines (35 loc) · 1.17 KB
/
test-common.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl
# Movable Type (r) Open Source (C) 2001-2011 Six Apart, Ltd.
# This program is distributed under the terms of the
# GNU General Public License, version 2.
#
# $Id: test-common.pl 3531 2009-03-12 09:11:52Z fumiakiy $
use strict;
use warnings;
use Cwd;
use File::Spec;
use vars qw(
$BASE $DB_DIR $T_CFG
$T_SCHEMA $T_SCHEMA_PG $T_SCHEMA_ORACLE
$T_SCHEMA_SQLITE $T_SCHEMA_MSSQLSERVER $SQLITE_DB
);
my $pwd = cwd();
my @pieces = split /\//, $pwd;
if (-f 'test-common.pl') {
pop @pieces;
}
elsif (-f 't/test-common.pl') {
# XXX ?
}
$BASE = File::Spec->catdir(@pieces);
$DB_DIR = File::Spec->catdir($BASE, 't', 'db');
mkdir $DB_DIR unless -d $DB_DIR;
$T_CFG = File::Spec->catdir($BASE, 't', 'mt.cfg');
$T_SCHEMA = File::Spec->catfile($BASE, 't', 't-schema.dump');
$T_SCHEMA_PG = File::Spec->catfile($BASE, 't', 't-schema-postgres.dump');
$T_SCHEMA_ORACLE = File::Spec->catfile($BASE, 't', 't-schema-oracle.dump');
$T_SCHEMA_SQLITE = File::Spec->catfile($BASE, 't', 't-schema-sqlite.dump');
$T_SCHEMA_MSSQLSERVER = File::Spec->catfile($BASE, 't', 't-schema-mssqlserver.dump');
$SQLITE_DB = File::Spec->catfile($BASE, 't', 'mtdb');
$ENV{MT_CONFIG} = $T_CFG;
1;