|
@ -1,6 +1,12 @@ |
|
|
#! /bin/bash |
|
|
#! /bin/bash |
|
|
|
|
|
|
|
|
cd $GOPATH/src/github.com/tendermint/abci |
|
|
|
|
|
|
|
|
# Get the root directory. |
|
|
|
|
|
SOURCE="${BASH_SOURCE[0]}" |
|
|
|
|
|
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done |
|
|
|
|
|
DIR="$( cd -P "$( dirname "$SOURCE" )/../.." && pwd )" |
|
|
|
|
|
|
|
|
|
|
|
# Change into that dir because we expect that. |
|
|
|
|
|
cd "$DIR" || exit |
|
|
|
|
|
|
|
|
function testExample() { |
|
|
function testExample() { |
|
|
N=$1 |
|
|
N=$1 |
|
@ -10,17 +16,17 @@ function testExample() { |
|
|
echo "Example $N" |
|
|
echo "Example $N" |
|
|
$APP &> /dev/null & |
|
|
$APP &> /dev/null & |
|
|
sleep 2 |
|
|
sleep 2 |
|
|
abci-cli --verbose batch < $INPUT > "${INPUT}.out.new" |
|
|
|
|
|
killall "$APP" |
|
|
|
|
|
|
|
|
abci-cli --verbose batch < "$INPUT" > "${INPUT}.out.new" |
|
|
|
|
|
killall "$APP" |
|
|
|
|
|
|
|
|
pre=`shasum < "${INPUT}.out"` |
|
|
|
|
|
post=`shasum < "${INPUT}.out.new"` |
|
|
|
|
|
|
|
|
pre=$(shasum < "${INPUT}.out") |
|
|
|
|
|
post=$(shasum < "${INPUT}.out.new") |
|
|
|
|
|
|
|
|
if [[ "$pre" != "$post" ]]; then |
|
|
if [[ "$pre" != "$post" ]]; then |
|
|
echo "You broke the tutorial" |
|
|
echo "You broke the tutorial" |
|
|
echo "Got:" |
|
|
|
|
|
|
|
|
echo "Got:" |
|
|
cat "${INPUT}.out.new" |
|
|
cat "${INPUT}.out.new" |
|
|
echo "Expected:" |
|
|
|
|
|
|
|
|
echo "Expected:" |
|
|
cat "${INPUT}.out" |
|
|
cat "${INPUT}.out" |
|
|
exit 1 |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|