You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
553 B

  1. #! /bin/bash
  2. function testExample() {
  3. N=$1
  4. INPUT=$2
  5. APP=$3
  6. echo "Example $N"
  7. $APP &> /dev/null &
  8. sleep 2
  9. tmsp-cli --verbose batch < $INPUT > "${INPUT}.out.new"
  10. killall "$APP"
  11. pre=`shasum < "${INPUT}.out"`
  12. post=`shasum < "${INPUT}.out.new"`
  13. if [[ "$pre" != "$post" ]]; then
  14. echo "You broke the tutorial"
  15. echo "Got:"
  16. cat "${INPUT}.out.new"
  17. echo "Expected:"
  18. cat "${INPUT}.out"
  19. exit 1
  20. fi
  21. rm "${INPUT}".out.new
  22. }
  23. testExample 1 tests/test_cli/ex1.tmsp dummy
  24. testExample 2 tests/test_cli/ex2.tmsp counter
  25. echo ""
  26. echo "PASS"