aboutsummaryrefslogtreecommitdiff
path: root/bisect/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bisect/test.sh')
-rwxr-xr-xbisect/test.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/bisect/test.sh b/bisect/test.sh
new file mode 100755
index 0000000..5d7eb13
--- /dev/null
+++ b/bisect/test.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+# This script calls the run.sh in the test-suite (see the test-suite dir)
+# and bails if the tests fail, giving enough to run.sh to mark that commit
+# as BAD and bail.
+
+if [[ $1 = '' ]]; then
+ echo "Syntax: $0 <full-test-name>"
+ exit 1
+fi
+testname=$1
+if [ ! -d test ]; then
+ echo "Missing test directory"
+ exit 1
+fi
+if [ ! -f test/run.sh ]; then
+ echo "Missing test script"
+ exit 1
+fi
+
+# Check which build was built last
+build_dir=build
+if [ build2/bin/clang -nt build/bin/clang ]; then
+ build_dir=build2
+fi
+
+# Update install dir
+rm -f install
+ln -s $build_dir install
+
+# Run the test
+cd test
+./run.sh -t $testname
+result=$?
+cd ..
+
+if [[ $result != 0 ]]; then
+ exit 1
+fi