bin/ai/regression/run.sh
author rubidium
Mon, 19 Mar 2007 00:00:26 +0000
branchnoai
changeset 9470 4593c953a276
parent 9469 7072beb81014
child 9481 39ba1c349d3d
permissions -rwxr-xr-x
(svn r9308) [NoAI] -Change: make the regression scripts run without any user intervention; not manual enabling and disabling of AIs
[NoAI] -Update: the regression outcome because the AI isn't chosen random anymore.
#!/bin/sh

if ! [ -f ai/regression/regression.nut ]; then
	echo "Make sure you are in the root of OpenTTD before starting this script."
	exit 1
fi

cp ai/regression/regression.nut ai/regression/main.nut

./openttd -a regression -x -c ai/regression/regression.cfg -snull -mnull -vnull -g ai/regression/regression.sav | awk '{ gsub("0x\\(nil\\)", "0x00000000", $0); print $0; }' > tmp.regression
res="`diff -u ai/regression/regression.txt tmp.regression`"
if [ -z "$res" ]; then
	echo "Regression test passed!"
else
	echo "Regression test failed! Difference:"
	echo "$res"
fi
echo ""
echo "Regression test done"

rm ai/regression/main.nut

if [ "$1" != "-k" ]; then
	rm -f tmp.regression
fi