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