Subject: | [PATCH] Wrong path to perl executable in t/try_examples.t |
Hi,
I tried to install Test-Unit and it had test failures. I looked in the sources and discovered that t/try_examples.t hardcodes name of perl executable. On my system I have several perl installations which use different names for perl executable so t/try_examples.t was peeking wrong perl and was failing apart. I've attached a patch to fix it.
P.S. After fixing Test-Unit I was still getting test failure but it was already reported as bug #2244 (see http://xrl.us/vf9).
diff -ru Test-Unit-0.24-orig/t/try_examples.t Test-Unit-0.24/t/try_examples.t
--- Test-Unit-0.24-orig/t/try_examples.t Thu Oct 2 17:23:40 2003
+++ Test-Unit-0.24/t/try_examples.t Thu Oct 2 17:30:04 2003
@@ -78,11 +78,13 @@
warn "There might be problems with error redirection undef $^O"
if grep { $^O =~ $_ } ( qr/win/i );
+my $perl = $^X || 'perl';
+
foreach my $e (@examples) {
if (defined $guru_checked{$e}) {
# get program output
my $runner = $e =~ /\.pm$/ ? './TestRunner.pl ' : '';
- my $cmd = "perl -I lib -I examples $runner$e 2>&1";
+ my $cmd = "$perl -I lib -I examples $runner$e 2>&1";
# warn "cmd $cmd\n";
my $out = `$cmd`;
foreach ($out, $guru_checked{$e}) {