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.

35 lines
596 B

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