Fix tests/hpcrun.pl to handle paths containing spaces
authorIan Lynagh <igloo@earth.li>
Sat, 2 Jan 2010 17:33:44 +0000 (17:33 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 2 Jan 2010 17:33:44 +0000 (17:33 +0000)
tests/hpcrun.pl
tests/simple/test.T

index b1e367d..51f2b38 100644 (file)
@@ -22,15 +22,15 @@ die "no option --hpc=* provided\n" if (!defined($HPC));
         
 $binary = $ARGV[0] . $exeext;
 
-system("rm -f $binary.tix") if (defined($CLEAR));
+unlink "$binary.tix" if (defined($CLEAR));
 
-system(@ARGV);
+system @ARGV;
 print "\n\n";
-system("$HPC report $binary.tix");
+system ($HPC, "report", "$binary.tix");
 print "\n\n";
-system("$HPC report $binary.tix --per-module");
+system ($HPC, "report", "$binary.tix", "--per-module");
 print "\n\n";
-open(MARKUP,"$HPC markup $binary.tix| ");
+open(MARKUP, "-|", $HPC, "markup", "$binary.tix");
 while(<MARKUP>) {
   my $line = $_;
   print $line;
index e15eb72..b9f5bef 100644 (file)
@@ -2,7 +2,7 @@ setTestOpts(compose(only_compiler_types(['ghc']),
                    compose(omit_ways(['ghci']),
                            skip_if_fast)))
 
-hpc_prefix = 'perl ../hpcrun.pl --clear --exeext=' + config.exeext + ' --hpc=' + config.hpc;
+hpc_prefix = "perl ../hpcrun.pl --clear --exeext=" + config.exeext + " --hpc='" + config.hpc + "'";
 
 test('hpc001', cmd_prefix(hpc_prefix), compile_and_run, ['-fhpc'])