summaryrefslogtreecommitdiff
path: root/test/run_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/run_test.sh')
-rwxr-xr-xtest/run_test.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/run_test.sh b/test/run_test.sh
new file mode 100755
index 0000000..da293c0
--- /dev/null
+++ b/test/run_test.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# This is a script to faciliate running single tests.
+#
+# Usage: ./run_test.sh <test_1> <test_2> ... <test_n>
+# If no test string is passed then all tests are run.
+
+test_dir=$(dirname $0)
+cd $test_dir
+
+if [[ $# == 0 ]]
+then
+ echo "======================"
+ echo "All tests are now run."
+ echo "======================"
+ make -C .. check
+else
+ for TST in "$@"
+ do
+ echo "========================="
+ echo "The $TST test is now run."
+ echo "========================="
+ rm -f $TST*.o; make $TST && (./$TST; RES=$?; echo; echo "Result: $RES"; cat result_$TST.xml)
+ done
+fi