195-6
[darwin-xtools.git] / dyld / unit-tests / bin / exit-zero-pass.pl
blobbc0a99d857c26df85cd86c6639d9f93f11d870c1
1 #!/usr/bin/perl -w
3 use strict;
5 sub PASS
7 my ($format, $args) = @_;
8 if(!defined $args)
9 { $args = []; }
10 printf("PASS \"$format\"\n", @$args);
13 sub FAIL
15 my ($format, $args) = @_;
16 if(!defined $args)
17 { $args = []; }
18 printf("FAIL \"$format\"\n", @$args);
21 my $pass_string = shift @ARGV;
22 my $fail_string = shift @ARGV;
24 # redirect stderr to stdout
25 open(STDERR, ">/tmp/exit-zero-pass.tmp") || die("$!");
26 if(0 == system(@ARGV))
28 PASS($pass_string);
30 else
32 FAIL($fail_string);
34 close(STDERR) || die("$!");
35 open(OUT, "</tmp/exit-zero-pass.tmp") || die("$!");
36 while(<OUT>)
38 print $_;
40 close(OUT) || die("$!");
41 unlink "/tmp/exit-zero-pass.tmp";
42 exit 0;