diff options
Diffstat (limited to 'client/test.sh')
-rwxr-xr-x | client/test.sh | 42 |
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 |