]> git.saurik.com Git - apple/ld64.git/blame - unit-tests/bin/fail-if-exit-zero.pl
ld64-85.tar.gz
[apple/ld64.git] / unit-tests / bin / fail-if-exit-zero.pl
CommitLineData
d696c285
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
a61fdf0a
A
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)
d696c285
A
17{
18 printf("FAIL $test_name\n");
19 exit 1;
20}
a61fdf0a
A
21
22exit 0;