2017-07-20 22:26:42 +00:00
|
|
|
#!/usr/bin/env bash
|
2010-03-17 18:13:53 +00:00
|
|
|
|
2017-07-20 22:26:42 +00:00
|
|
|
set -ex
|
2010-03-17 18:13:53 +00:00
|
|
|
|
|
|
|
basedir=`echo $0 | sed 's/[^/]*$//g'`.
|
|
|
|
testdir="$1"
|
|
|
|
[ -n "$2" ] && logdir=$2 || logdir=$1
|
|
|
|
|
|
|
|
[ ${basedir:0:1} == "." ] && basedir=`pwd`/${basedir:1}
|
|
|
|
|
2011-06-10 04:40:15 +00:00
|
|
|
PATH="$basedir/src:$PATH"
|
|
|
|
|
2010-03-17 18:13:53 +00:00
|
|
|
[ -z "$testdir" ] || [ ! -d "$testdir" ] && echo "specify test dir" && exit 1
|
|
|
|
cd $testdir
|
|
|
|
|
|
|
|
while true
|
|
|
|
do
|
2011-06-13 20:31:35 +00:00
|
|
|
for test in `cd $basedir/workunits && find . -executable -type f | $basedir/../src/script/permute`
|
2010-03-17 18:13:53 +00:00
|
|
|
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
|
|
|
|
done
|