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