bin/ai/regression/run.sh
branchnoai
changeset 9461 ab1079656642
child 9463 4019df972af1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/ai/regression/run.sh	Sun Mar 18 20:15:57 2007 +0000
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+if ! [ -f ai/regression/main.nut ]; then
+	echo "Make sure you are in the root of OpenTTD before starting this script."
+	exit 1
+fi
+
+if [ -n "`cat ai/regression/main.nut | grep '//iFRegression <-FRegression();'`" ]; then
+	echo "Enable the Regression AI before starting the regression test."
+	echo "Also disable any other AI. Check main.nut in ai/regression for"
+	echo "more information about this."
+	exit 1
+fi
+
+./openttd -snull -mnull -vnull -g ai/regression/regression.sav > 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 -f tmp.regression