# t/test.pl - most of Test::More functionality without the fuss
#
+$Level = 1;
my $test = 1;
my $planned;
}
sub _where {
- my @caller = caller(1);
+ my @caller = caller($Level);
return "at $caller[1] line $caller[2]";
}
}
}
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" );
sub fresh_perl_is {
my($prog, $expected, $runperl_args, $name) = @_;
+ local $Level = 2;
_fresh_perl($prog,
sub { @_ ? $_[0] eq $expected : $expected },
$runperl_args, $name);
sub fresh_perl_like {
my($prog, $expected, $runperl_args, $name) = @_;
+ local $Level = 2;
_fresh_perl($prog,
sub { @_ ?
$_[0] =~ (ref $expected ? $expected : /$expected/) :