aboutsummaryrefslogtreecommitdiff
path: root/script/runtests.sh
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2014-09-10 11:00:34 +0530
committerSudar <sudar@sudarmuthu.com>2014-09-10 11:00:34 +0530
commitfe00b04a0e1a58f63ae134081d2d896f27ac3f2d (patch)
tree632698c837a0828541dde6acb72fd10f6cb1b7ec /script/runtests.sh
parente30bb5c28a42152007d70325477f364605b73f34 (diff)
parent48356f96ce05948a046d0732dedda66b3e0b69c8 (diff)
Merge pull request #254 from peplin/test-suite-and-ci
Add an automated test runner for example programs and Travis CI integration
Diffstat (limited to 'script/runtests.sh')
-rwxr-xr-xscript/runtests.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/script/runtests.sh b/script/runtests.sh
new file mode 100755
index 0000000..ad42f74
--- /dev/null
+++ b/script/runtests.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+failures=()
+
+for dir in tests/*/
+do
+ dir=${dir%*/}
+ example=${dir##*/}
+ pushd $dir
+ echo "Compiling $example..."
+ make_output=`make clean`
+ make_output=`make`
+ if [[ $? -ne 0 ]]; then
+ failures+=("$example")
+ echo "Example $example failed"
+ fi
+ popd
+done
+
+for failure in "${failures[@]}"; do
+ echo "Example $failure failed"
+done
+
+if [[ ${#failures[@]} -eq 0 ]]; then
+ echo "All tests passed."
+else
+ exit 1
+fi