dup.runner 678 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/cmd/rc
  2. runner=$0
  3. test = `{echo $runner|sed 's/.runner//'}
  4. test_output = /tmp/output-`{basename $test}
  5. if ( test -e $test_output) rm $test_output
  6. $test > $test_output
  7. testpid=$apid
  8. wait $testpid
  9. if ( ! cat $test_output | grep 'Got 0ctl: 0 r ' > /dev/null ) {
  10. cat $test_output
  11. echo FAIL
  12. exit FAIL
  13. }
  14. if ( ! cat $test_output | grep 'Got 1ctl: 1 w ' > /dev/null ) {
  15. cat $test_output
  16. echo FAIL
  17. exit FAIL
  18. }
  19. if ( ! cat $test_output | grep 'Got 2ctl: 2 w ' > /dev/null ) {
  20. cat $test_output
  21. echo FAIL
  22. exit FAIL
  23. }
  24. if ( ! cat $test_output | grep 'Got: 3 rE ' > /dev/null ) {
  25. cat $test_output
  26. echo FAIL
  27. exit FAIL
  28. }
  29. rm $test_output
  30. echo PASS
  31. exit PASS