mirror of
https://github.com/darlinghq/darling-dyld.git
synced 2024-11-23 12:29:44 +00:00
01ca8e46cb
dyld-733.6
45 lines
695 B
Perl
Executable File
45 lines
695 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
|
|
sub PASS
|
|
{
|
|
my ($format, $args) = @_;
|
|
if(!defined $args)
|
|
{ $args = []; }
|
|
printf("PASS \"$format\"\n", @$args);
|
|
}
|
|
|
|
sub FAIL
|
|
{
|
|
my ($format, $args) = @_;
|
|
if(!defined $args)
|
|
{ $args = []; }
|
|
printf("FAIL \"$format\"\n", @$args);
|
|
}
|
|
|
|
my $pass_string = shift @ARGV;
|
|
my $fail_string = shift @ARGV;
|
|
|
|
|
|
# redirect stderr to stdout
|
|
open(STDERR, ">/tmp/exit-non-zero.tmp") || die("$!");
|
|
if(0 != system(@ARGV))
|
|
{
|
|
PASS($pass_string);
|
|
}
|
|
else
|
|
{
|
|
FAIL($fail_string);
|
|
}
|
|
close(STDERR) || die("$!");
|
|
open(OUT, "</tmp/exit-non-zero.tmp") || die("$!");
|
|
while(<OUT>)
|
|
{
|
|
print $_;
|
|
}
|
|
close(OUT) || die("$!");
|
|
unlink "/tmp/exit-non-zero.tmp";
|
|
exit 0;
|
|
|