From a55adfaa4fc25ca2c7f0db44c349b13203bf94c8 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Fri, 5 Jan 2018 22:33:18 -0500 Subject: [PATCH] tests: use shasum to avoid rarer dependency --- tests/test_cli/test.sh | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/test_cli/test.sh b/tests/test_cli/test.sh index dcf2dcc8b..ccbb313c5 100755 --- a/tests/test_cli/test.sh +++ b/tests/test_cli/test.sh @@ -10,29 +10,29 @@ DIR="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )" cd "$DIR" || exit function testExample() { - N=$1 - INPUT=$2 - APP="$3 $4" - - echo "Example $N: $APP" - $APP &> /dev/null & - sleep 2 - abci-cli --log_level=error --verbose batch < "$INPUT" > "${INPUT}.out.new" - killall "$3" - - pre=$(sha256sum < "${INPUT}.out") - post=$(sha256sum < "${INPUT}.out.new") - - if [[ "$pre" != "$post" ]]; then - echo "You broke the tutorial" - echo "Got:" - cat "${INPUT}.out.new" - echo "Expected:" - cat "${INPUT}.out" - exit 1 - fi - - rm "${INPUT}".out.new + N=$1 + INPUT=$2 + APP="$3 $4" + + echo "Example $N: $APP" + $APP &> /dev/null & + sleep 2 + abci-cli --log_level=error --verbose batch < "$INPUT" > "${INPUT}.out.new" + killall "$3" + + pre=$(shasum < "${INPUT}.out") + post=$(shasum < "${INPUT}.out.new") + + if [[ "$pre" != "$post" ]]; then + echo "You broke the tutorial" + echo "Got:" + cat "${INPUT}.out.new" + echo "Expected:" + cat "${INPUT}.out" + exit 1 + fi + + rm "${INPUT}".out.new } testExample 1 tests/test_cli/ex1.abci abci-cli dummy