]>
Commit | Line | Data |
---|---|---|
0959b6d4 A |
1 | #!/usr/bin/perl -w |
2 | ||
3 | use strict; | |
4 | ||
5 | sub PASS | |
6 | { | |
7 | my ($format, $args) = @_; | |
8 | if(!defined $args) | |
9 | { $args = []; } | |
10 | printf("PASS \"$format\"\n", @$args); | |
11 | } | |
12 | ||
13 | sub FAIL | |
14 | { | |
15 | my ($format, $args) = @_; | |
16 | if(!defined $args) | |
17 | { $args = []; } | |
18 | printf("FAIL \"$format\"\n", @$args); | |
19 | } | |
20 | ||
21 | my $pass_string = shift @ARGV; | |
22 | my $fail_string = shift @ARGV; | |
23 | ||
bac542e6 A |
24 | # redirect stderr to stdout |
25 | open(STDERR, ">/tmp/exit-zero-pass.tmp") || die("$!"); | |
0959b6d4 A |
26 | if(0 == system(@ARGV)) |
27 | { | |
28 | PASS($pass_string); | |
29 | } | |
30 | else | |
31 | { | |
32 | FAIL($fail_string); | |
33 | } | |
bac542e6 A |
34 | close(STDERR) || die("$!"); |
35 | open(OUT, "</tmp/exit-zero-pass.tmp") || die("$!"); | |
36 | while(<OUT>) | |
37 | { | |
38 | print $_; | |
39 | } | |
40 | close(OUT) || die("$!"); | |
412ebb8e | 41 | unlink "/tmp/exit-zero-pass.tmp"; |
0959b6d4 A |
42 | exit 0; |
43 |