1 # This code is used by lib/charnames.t, lib/croak.t, lib/feature.t,
2 # lib/subs.t, lib/strict.t and lib/warnings.t
4 # On input, $::local_tests is the number of tests in the caller; or
5 # 'no_plan' if unknown, in which case it is the caller's responsibility
6 # to call cur_test() to find out how many this executed
9 require './test.pl'; require './charset_tools.pl';
14 use File::Spec::Functions qw(catfile curdir rel2abs);
18 my (undef, $file) = caller;
19 my ($pragma_name) = $file =~ /([A-Za-z_0-9]+)\.t$/
20 or die "Can't identify pragama to test from file name '$file'";
27 print "ARGV = [@ARGV]\n";
28 @w_files = map { "./lib/$pragma_name/$_" } @ARGV;
30 @w_files = sort glob catfile(curdir(), "lib", $pragma_name, "*");
33 my ($tests, @prgs) = setup_multiple_progs(@w_files);
36 @INC = map { rel2abs($_) } @INC;
37 my $tempdir = tempfile;
39 mkdir $tempdir, 0700 or die "Can't mkdir '$tempdir': $!";
40 chdir $tempdir or die die "Can't chdir '$tempdir': $!";
45 chdir '..' or die "Couldn't chdir .. for cleanup: $!";
50 if ($::local_tests && $::local_tests =~ /\D/) {
51 # If input is 'no_plan', pass it on unchanged
54 plan $tests + ($::local_tests || 0);
57 run_multiple_progs('../..', @prgs);