my $switch = "";
if ($first_line =~ /#!.*\bperl.*\s-\w*([tT])/) {
- $switch = qq{"-$1"};
+ $switch = "-$1";
} else {
if ($::taintwarn) {
# not all tests are expected to pass with this option
- $switch = '"-t"';
+ $switch = '-t';
} else {
$switch = '';
}
}
}
- my $utf8 = $::with_utf8 ? '-I$lib -Mutf8' : '';
+ my $utf8 = $::with_utf8 ? "-I$lib -Mutf8" : '';
- return {
+ my %options = (
perl => $perl,
lib => $lib,
test => $test,
utf8 => $utf8,
file => $file_opts,
switch => $switch,
- };
+ );
+
+ return \%options;
}
sub _cmd {
}
sub _run_test {
- my($harness, $test, $type) = @_;
- if (!defined $type) {
- # To conform to the interface expected by exec in TAP::Harness
- $type = 'perl';
- }
+ my ($test, $type) = @_;
my $options = _scan_test($test, $type);
-
- $test = $options->{test}; # Might have changed if we're in ext/Foo
+ # $test might have changed if we're in ext/Foo, so don't use it anymore
+ # from now on. Use $options->{test} instead.
_before_fork($options);
$te = '';
}
- my $results = _run_test(undef, $test, $type);
+ my $results = _run_test($test, $type);
my $failure;
my $next = 0;