6 use Test::Harness qw/&runtests $verbose/;
15 conformant to a recent post on p6i, if I'm called with a single
16 argument of "-files", I just return a list of files to process.
17 This list is one per line, and is relative to the languages dir.
19 If I'm called with no args, I run the suite.
25 # Setting these options helps flush out issues that might otherwise
28 my @required_options = qw/--gc-debug -D40/;
31 $ENV{TEST_PROG_ARGS} = "" unless defined($ENV{TEST_PROG_ARGS});
33 foreach my $option (@required_options) {
34 if ( $ENV{TEST_PROG_ARGS} !~ /\b$option\b/) {
35 $ENV{TEST_PROG_ARGS} .= " $option";
40 while ($ENV{TEST_PROG_ARGS} =~ s/-D(\d*)//) {
45 $ENV{TEST_PROG_ARGS} .= "-D$DTotal";
48 if ( grep { /^--files$/ } @ARGV ) {
49 # I must be running out of languages/
50 my $dir = File::Spec->catfile( $language, "t" );
51 my @files = glob( File::Spec->catfile( $dir, "*.t" ) );
52 print join("\n",@files);
56 # Someone specified tests for me to run.
57 @files = grep {-f $_} @ARGV
59 # I must be running out of languages/$language
60 # You may want a deeper search than this.
61 @files = glob( File::Spec->catfile( "t", "*.t" ) );
65 print STDERR $ENV{TEST_PROG_ARGS};
70 # cperl-indent-level: 4
73 # vim: expandtab shiftwidth=4: