gsgp/test/common

50 lines
612 B
Plaintext
Raw Normal View History

#!/bin/bash
# init the "game" and profile
export GSGP_ID=gsgptest
export GSGP_TITLE="Test Suite"
export GSGP_PROFILE=TEST
. "$( dirname $0 )/../util/common"
# annihilate profile to start fresh
rm -rf "$GSGP_PROFILE_PATH"
mkdir -p "$GSGP_PROFILE_PATH"
lastgiven=''
lastexpected=''
last()
{
lastgiven="$1"
lastexpected="$2"
}
assert-equal()
{
last "$1" "$2"
[ "$1" == "$2" ]
}
assert-eq()
{
last "$1" "$2"
[ $1 -eq $2 ]
}
simplefail()
{
echo "FAILURE: $1" >&2
}
fail()
{
simplefail "$1"
echo "Expected '$lastexpected', but received '$lastgiven'" >&2
echo >&2
}