dkanavis

Test wrapper

Sep 20th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.50 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3.  
  4. use strict;
  5. use warnings;
  6.  
  7.  
  8. die "Usage: ok/err/notok" if ($#ARGV == -1);
  9.  
  10.  
  11. if ($ARGV[0] eq "ok") {
  12.     exit 0;
  13. } elsif ($ARGV[0] eq "notok") {
  14.     print "This should be in SMS (stdout)\n";
  15.     print STDERR "This shouldn't be in SMS (stderr)\n";
  16.     exit 66;
  17. } elsif ($ARGV[0] eq "err") {
  18.     print "This is a part of error message (stdout)\n";
  19.     print STDERR "This is another part of error message (stderr)\n";
  20.     exit 1;
  21. } else {
  22.     die "Usage: ok/err/notok";
  23. }
Advertisement
Add Comment
Please, Sign In to add comment