X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftest.pl;h=0c315561405a56c95032e436c5dc84c56f2ccc65;hb=b60cf05ab72950309ce22f1294b53484e06a00ac;hp=81605f59585573d84edadf996746126d1cb85ac4;hpb=c3029c660c41826954b460e82523f3ba1f91d479;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/test.pl b/t/test.pl index 81605f5..0c31556 100644 --- a/t/test.pl +++ b/t/test.pl @@ -2,6 +2,7 @@ # t/test.pl - most of Test::More functionality without the fuss # +$Level = 1; my $test = 1; my $planned; @@ -76,7 +77,7 @@ sub _ok { } sub _where { - my @caller = caller(1); + my @caller = caller($Level); return "at $caller[1] line $caller[2]"; } @@ -378,12 +379,19 @@ sub _create_runperl { # Create the string to qx in runperl(). } } if ($args{switches}) { + local $Level = 2; + die "test.pl:runperl(): 'switches' must be an ARRAYREF " . _where() + unless ref $args{switches} eq "ARRAY"; _quote_args(\$runperl, $args{switches}); } if (defined $args{prog}) { + die "test.pl:runperl(): both 'prog' and 'progs' cannot be used " . _where() + if defined $args{progs}; $args{progs} = [$args{prog}] } if (defined $args{progs}) { + die "test.pl:runperl(): 'progs' must be an ARRAYREF " . _where() + unless ref $args{progs} eq "ARRAY"; foreach my $prog (@{$args{progs}}) { if ($is_mswin || $is_netware || $is_vms) { $runperl .= qq ( -e "$prog" ); @@ -585,6 +593,7 @@ sub _fresh_perl { sub fresh_perl_is { my($prog, $expected, $runperl_args, $name) = @_; + local $Level = 2; _fresh_perl($prog, sub { @_ ? $_[0] eq $expected : $expected }, $runperl_args, $name); @@ -598,6 +607,7 @@ sub fresh_perl_is { sub fresh_perl_like { my($prog, $expected, $runperl_args, $name) = @_; + local $Level = 2; _fresh_perl($prog, sub { @_ ? $_[0] =~ (ref $expected ? $expected : /$expected/) :