Moving simple tests into own directory.
[packages/hpc.git] / tests / hpcrun.pl
1 #
2 # This command wraps round a command execution, adding some hpc tests.
3 #
4
5 while($ARGV[0] =~ /^--/) {
6 $arg = shift @ARGV;
7 if ($arg =~ /--hpc=(.*)/) {
8 $HPC = $1;
9 }
10 elsif ($arg =~ /--clear/) {
11 $CLEAR = 1;
12 }
13 elsif ($arg =~ /--exeext=(.*)/) {
14 $exeext = $1;
15 }
16 else {
17 die "Bad arg: $arg"
18 }
19 }
20
21 die "no option --hpc=* provided\n" if (!defined($HPC));
22
23 $binary = $ARGV[0] . $exeext;
24
25 system("rm -f $binary.tix") if (defined($CLEAR));
26
27 system(@ARGV);
28 print "\n\n";
29 system("$HPC report $binary.tix");
30 print "\n\n";
31 system("$HPC report $binary.tix --per-module");
32 print "\n\n";
33 open(MARKUP,"$HPC markup $binary.tix| ");
34 while(<MARKUP>) {
35 my $line = $_;
36 print $line;
37 if (/Writing: (\S+.html)/) {
38 system("cat $1");
39 }
40 }
41 print "\n\n";