- add gen-tests.pl script
David Kamholz [Sat, 11 Feb 2006 21:14:57 +0000 (21:14 +0000)]
- add test missed last time

maint/gen-tests.pl [new file with mode: 0644]
t/helperrels/145db2.t [new file with mode: 0644]

diff --git a/maint/gen-tests.pl b/maint/gen-tests.pl
new file mode 100644 (file)
index 0000000..f83fd55
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+die "must be run from DBIx::Class root dir" unless -d 't/run';
+
+gen_tests($_) for qw/BasicRels HelperRels/;
+
+sub gen_tests {
+    my $variant = shift;
+    my $dir = lc $variant;
+    system("rm -f t/$dir/*.t");
+    
+    foreach my $test (map { m[^t/run/(.+)\.tl$]; $1 } split(/\n/, `ls t/run/*.tl`)) {
+        open(my $fh, '>', "t/$dir/${test}.t") or die $1;
+        print $fh <<"EOF";
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
+use DBICTest::$variant;
+
+require "t/run/${test}.tl";
+run_tests(DBICTest->schema);
+EOF
+    close $fh;
+    }
+}
\ No newline at end of file
diff --git a/t/helperrels/145db2.t b/t/helperrels/145db2.t
new file mode 100644 (file)
index 0000000..c6925ef
--- /dev/null
@@ -0,0 +1,7 @@
+use Test::More;
+use lib qw(t/lib);
+use DBICTest;
+use DBICTest::HelperRels;
+
+require "t/run/145db2.tl";
+run_tests(DBICTest->schema);