summaryrefslogtreecommitdiffstats
path: root/qa/runallonce.sh
diff options
context:
space:
mode:
Diffstat (limited to 'qa/runallonce.sh')
-rwxr-xr-xqa/runallonce.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/qa/runallonce.sh b/qa/runallonce.sh
new file mode 100755
index 000000000..bd809fef7
--- /dev/null
+++ b/qa/runallonce.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+set -ex
+
+basedir=`echo $0 | sed 's/[^/]*$//g'`.
+testdir="$1"
+[ -n "$2" ] && logdir=$2 || logdir=$1
+
+[ ${basedir:0:1} == "." ] && basedir=`pwd`/${basedir:1}
+
+PATH="$basedir/src:$PATH"
+
+[ -z "$testdir" ] || [ ! -d "$testdir" ] && echo "specify test dir" && exit 1
+cd $testdir
+
+for test in `cd $basedir/workunits && find . -executable -type f | $basedir/../src/script/permute`
+do
+ echo "------ running test $test ------"
+ pwd
+ [ -d $test ] && rm -r $test
+ mkdir -p $test
+ mkdir -p `dirname $logdir/$test.log`
+ test -e $logdir/$test.log && rm $logdir/$test.log
+ sh -c "cd $test && $basedir/workunits/$test" 2>&1 | tee $logdir/$test.log
+done