6 use File::Spec::Functions qw/catdir catfile curdir abs2rel rel2abs/;
8 use Test::Harness qw/runtests $switches/;
10 my $srctop = $ENV{SRCTOP} || $ENV{TOP};
11 my $bldtop = $ENV{BLDTOP} || $ENV{TOP};
12 my $recipesdir = catdir($srctop, "test", "recipes");
13 my $testlib = catdir($srctop, "test", "testlib");
14 my $utillib = catdir($srctop, "util");
16 # It seems that $switches is getting interpreted with 'eval' or something
17 # like that, and that we need to take care of backslashes or they will
18 # disappear along the way.
19 $testlib =~ s|\\|\\\\|g if $^O eq "MSWin32";
20 $utillib =~ s|\\|\\\\|g if $^O eq "MSWin32";
22 # Test::Harness provides the variable $switches to give it
23 # switches to be used when it calls our recipes.
24 $switches = "-w \"-I$testlib\" \"-I$utillib\"";
26 my @tests = ( "alltests" );
30 my $list_mode = scalar(grep /^list$/, @tests) != 0;
31 if (grep /^alltests|list$/, @tests) {
33 basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
34 } glob(catfile($recipesdir,"*.t"));
39 basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
40 } glob(catfile($recipesdir,"*-$_.t"));
46 @tests = map { $_ = basename($_); $_ =~ s/^[0-9][0-9]-//; $_ =~ s/\.t$//;
48 print join("\n", @tests), "\n";
50 @tests = map { abs2rel($_, rel2abs(curdir())); } @tests;
52 runtests(sort @tests);