mansz81

pass-iff-stdin.pl

Mar 16th, 2022 (edited)
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.29 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2.  
  3. #
  4. # Usage:
  5. #
  6. #       command | ${PASS_IFF_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.     printf("FAIL $test_name\n");
  19.     exit 1
  20. }
  21.  
  22. printf("PASS $test_name\n");
  23. exit 0;
Add Comment
Please, Sign In to add comment