]> git.saurik.com Git - apple/ld64.git/blame - ld64-134.9/unit-tests/bin/fail-if-exit-zero.pl
ld64-134.9.tar.gz
[apple/ld64.git] / ld64-134.9 / unit-tests / bin / fail-if-exit-zero.pl
CommitLineData
b1f7435d
A
1#!/usr/bin/perl -w
2
3use strict;
4
5my $test_name = "";
6if ( exists $ENV{UNIT_TEST_NAME} ) {
7 $test_name = $ENV{UNIT_TEST_NAME};
8}
9
10my $ret = system(@ARGV);
11my $exit_value = $ret >> 8;
12my $signal_num = $ret & 127;
13my $dumped_core = $ret & 128;
14my $crashed = $signal_num + $dumped_core;
15
16if(0 == $exit_value || 0 != $crashed)
17{
18 printf("FAIL $test_name\n");
19 exit 1;
20}
21
22exit 0;