Commit | Line | Data |
d3c7b079 |
1 | #!/usr/bin/perl |
2 | |
3 | die "must be run from DBIx::Class root dir" unless -d 't/run'; |
4 | |
5 | gen_tests($_) for qw/BasicRels HelperRels/; |
6 | |
7 | sub gen_tests { |
8 | my $variant = shift; |
9 | my $dir = lc $variant; |
10 | system("rm -f t/$dir/*.t"); |
11 | |
12 | foreach my $test (map { m[^t/run/(.+)\.tl$]; $1 } split(/\n/, `ls t/run/*.tl`)) { |
ba521d40 |
13 | open(my $fh, '>', "t/$dir/${test}.t") or die $!; |
d3c7b079 |
14 | print $fh <<"EOF"; |
15 | use Test::More; |
16 | use lib qw(t/lib); |
17 | use DBICTest; |
18 | use DBICTest::$variant; |
19 | |
20 | require "t/run/${test}.tl"; |
21 | run_tests(DBICTest->schema); |
22 | EOF |
23 | close $fh; |
24 | } |
8417f5ee |
25 | } |