dyre-0.8.8: Tests/recompile-relaunch/runTest.sh
#!/bin/sh
# Tests Dyre's ability to recompile a custom configuration
# upon relaunch, and restore the state again after.
# Assert the equality of two strings.
function assert() {
echo "$1" >&2
if [ "$1" != "$2" ]; then
echo "Failed test $3";
exit 1;
fi
}
mkdir working
cd working
### TEST A ###
cp ../RecompileRelaunchTest.hs ../Main.hs ../recompileRelaunchTest.hs .
ghc --make Main.hs -o recompileRelaunch > /dev/null 2>&1
OUTPUT_A=`./recompileRelaunch --dyre-debug --deny-reconf`
assert "$OUTPUT_A" "Testing....Successful" "A"
### TEST B ###
OUTPUT_B=`./recompileRelaunch --dyre-debug --deny-reconf`
assert "$OUTPUT_B" "..Successful..Successful" "B"
echo "Passed"
cd ..
rm -r working