switched to just registering extra source rather than removing and reregistering
[dbsrgits/DBIx-Class.git] / maint / gen-tests.pl
CommitLineData
d3c7b079 1#!/usr/bin/perl
2
3die "must be run from DBIx::Class root dir" unless -d 't/run';
4
5gen_tests($_) for qw/BasicRels HelperRels/;
6
7sub 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";
15use Test::More;
16use lib qw(t/lib);
17use DBICTest;
18use DBICTest::$variant;
19
20require "t/run/${test}.tl";
21run_tests(DBICTest->schema);
22EOF
23 close $fh;
24 }
8417f5ee 25}