summaryrefslogtreecommitdiff
path: root/client/test.sh
diff options
context:
space:
mode:
authordeva <deva>2009-08-31 11:33:57 +0000
committerdeva <deva>2009-08-31 11:33:57 +0000
commit86bd08d47842e5681835412ac6c08d7135a6adc5 (patch)
tree767a04c8e126d152bab922629a65a4f3e02d0953 /client/test.sh
parent6cbc11417ee97c50fadedc1cb976f15a0c69fecc (diff)
Initial attempt on a unit test system.
Diffstat (limited to 'client/test.sh')
-rwxr-xr-xclient/test.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/client/test.sh b/client/test.sh
new file mode 100755
index 0000000..1c3c96d
--- /dev/null
+++ b/client/test.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+TEST_PRO_IN=test.pro.in
+TEST_PRO=test.pro
+MAKEFILE=Makefile.test
+TESTFILES=test/test*.cc
+TEST_APP=test_app
+
+rm -f test.log
+
+for TEST in $TESTFILES
+do
+ OUTPUT=$TEST.log
+
+ echo -e "\033[0;2mTesting $TEST:"
+ echo Testing $TEST: > $OUTPUT
+
+ echo -n "* Compiling $TEST test"
+ echo Compiling $TEST test: > $OUTPUT
+ echo ${COMPILE} >> $OUTPUT
+ cpp -P -E -DTESTFILE=\"$TEST\" $TEST_PRO_IN -o $TEST_PRO
+ qmake -makefile $TEST_PRO -o $MAKEFILE
+ if make -f $MAKEFILE >> ${OUTPUT} 2>&1; then
+ echo -e "\r\t\t\t\t\t\t[\033[1;32mSuccess\033[0;2m]"
+ echo "[Success]" >> $OUTPUT
+
+ echo -n "* Running $TEST test"
+ echo Running $TEST test: >> $OUTPUT
+ if ./$TEST_APP >> $OUTPUT 2>&1; then
+ echo -e "\r\t\t\t\t\t\t[\033[1;32mSuccess\033[0;2m]"
+ echo "[Success]" >> $OUTPUT
+ else
+ echo -e "\r\t\t\t\t\t\t[\033[1;31mFailure\033[0;2m]"
+ echo "[Failure]" >> $OUTPUT
+ fi
+ else
+ echo -e "\r\t\t\t\t\t\t[\033[1;31mFailure\033[0;2m]"
+ echo "[Failure]" >> $OUTPUT
+ fi
+done
+
+rm -f $MAKEFILE $TEST_PRO $TEST_APP