test.t 824 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. echo '1..2'
  3. make 2>&1 > /dev/null || exit 1
  4. # Comment this out if you care about exact formatting
  5. rationalize()
  6. {
  7. tr -s ' ' | sed -e 's/ tests / test /' -e "s/ test '[^']*'/ test ()/" -e "s/ test (.*)/ test ()/" -e 's, Second plan at \./test.pl line.*,,' -e 's,Failed test in ./test.pl at line .*,Failed test (),'
  8. }
  9. perl ./test.pl 2>&1 | rationalize | grep -v '^# \+in ./test.pl at line'> test.pl.out
  10. perlstatus=$?
  11. ./test 2>&1 | rationalize > test.c.out
  12. cstatus=$?
  13. ret=0
  14. diff -u test.pl.out test.c.out
  15. if [ $? -eq 0 ]; then
  16. echo 'ok 1 - output is identical'
  17. else
  18. echo 'not ok 1 - output is identical'
  19. ret=1
  20. fi
  21. if [ $perlstatus -eq $cstatus ]; then
  22. echo 'ok 2 - status code'
  23. else
  24. echo 'not ok 2 - status code'
  25. echo "# perlstatus = $perlstatus"
  26. echo "# cstatus = $cstatus"
  27. ret=1
  28. fi
  29. exit $ret