code_junkie

How do I check the exit code in Test::More

Nov 13th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. perl your_file.t
  2. if [[ $? -gt 10 ]]; then
  3. echo "Wow, that's a lot of failures"
  4. elif [[ $? -gt 0 ]]; then
  5. echo "Tests failed"
  6. else
  7. echo "Success!"
  8. fi
  9.  
  10. perl your_file.t || echo "Something bad happened."
  11.  
  12. use IPC::System::Simple qw(systemx EXIT_ANY);
  13.  
  14. my $exit_value = systemx( EXIT_ANY, 'mytest.t' );
  15.  
  16. use IPC::System::Simple qw(systemx);
  17.  
  18. systemx( 'mytest.t' ); # Run this command successfully or die.
Add Comment
Please, Sign In to add comment