]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/bin/exit-non-zero-pass.pl
ld64-409.12.tar.gz
[apple/ld64.git] / unit-tests / bin / exit-non-zero-pass.pl
1 #!/usr/bin/perl -w
2
3 #
4 # Usage:
5 #
6 # ${PASS_UNLESS} "test name" command
7 #
8
9 use strict;
10
11 my $string = shift @ARGV;
12 my $ret = system(@ARGV);
13 my $exit_value = $ret >> 8;
14 my $signal_num = $ret & 127;
15 my $dumped_core = $ret & 128;
16 my $crashed = $signal_num + $dumped_core;
17
18 if(0 == $exit_value || 0 != $crashed)
19 {
20 printf("FAIL $string\n");
21 }
22 else
23 {
24 printf("PASS $string\n");
25 }
26
27 exit 0;