]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/bin/fail-if-stdin.pl
ld64-409.12.tar.gz
[apple/ld64.git] / unit-tests / bin / fail-if-stdin.pl
1 #!/usr/bin/perl -w
2
3 #
4 # Usage:
5 #
6 # command | ${FAIL_IF_STDIN}
7 #
8
9 use strict;
10
11 my $test_name = "";
12 if ( exists $ENV{UNIT_TEST_NAME} ) {
13 $test_name = $ENV{UNIT_TEST_NAME};
14 }
15
16 if( eof STDIN )
17 {
18 exit 0;
19 }
20
21 printf("FAIL $test_name\n");
22 exit 1;