Browse Source

tests: use shasum to avoid rarer dependency

pull/1780/head
Ethan Buchman 7 years ago
parent
commit
a55adfaa4f
1 changed files with 23 additions and 23 deletions
  1. +23
    -23
      tests/test_cli/test.sh

+ 23
- 23
tests/test_cli/test.sh View File

@ -10,29 +10,29 @@ DIR="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )"
cd "$DIR" || exit cd "$DIR" || exit
function testExample() { 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 testExample 1 tests/test_cli/ex1.abci abci-cli dummy


Loading…
Cancel
Save