aboutsummaryrefslogtreecommitdiff
path: root/flatcc/scripts/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'flatcc/scripts/test.sh')
-rwxr-xr-xflatcc/scripts/test.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/flatcc/scripts/test.sh b/flatcc/scripts/test.sh
new file mode 100755
index 0000000..d87924b
--- /dev/null
+++ b/flatcc/scripts/test.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env sh
+
+set -e
+
+HERE=`dirname $0`
+cd $HERE/..
+ROOT=`pwd`
+
+DBGDIR=$ROOT/build/Debug
+RELDIR=$ROOT/build/Release
+
+if [ "$1" = "--debug" ]; then
+ DEBUG=$1
+ echo "running debug build"
+ shift
+fi
+
+if [ "$1" != "--no-clean" ]; then
+ echo "cleaning build before tests ..."
+ $ROOT/scripts/cleanall.sh
+else
+ shift
+fi
+
+echo "building before tests ..."
+$ROOT/scripts/build.sh $DEBUG
+
+echo "running test in debug build ..."
+cd $DBGDIR && ctest $ROOT
+
+if [ "$DEBUG" != "--debug" ]; then
+echo "running test in release build ..."
+cd $RELDIR && ctest $ROOT
+echo "TEST PASSED"
+else
+ echo "DEBUG TEST PASSED"
+fi
+