2007-09-10 20:28:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2012-11-21 21:28:52 +00:00
|
|
|
# Argument can be substring of tests (such as 'local')
|
|
|
|
|
2010-06-14 22:05:47 +00:00
|
|
|
export LANG=C
|
2010-05-27 22:34:00 +00:00
|
|
|
SHFILE=/tmp/unittest-parallel.sh
|
|
|
|
|
2013-01-21 22:07:32 +00:00
|
|
|
if [ "$TRIES" = "3" ] ; then
|
|
|
|
# Try a failing test thrice
|
|
|
|
echo Retrying 3 times
|
|
|
|
ls -t tests-to-run/*${1}*.sh |
|
|
|
|
perl -pe 's:(.*/(.*)).sh:bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 >/dev/null || bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 >/dev/null || bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 || touch $1.sh: ' \
|
|
|
|
>$SHFILE
|
|
|
|
else
|
|
|
|
# Run a failing test once
|
|
|
|
echo Not retrying
|
|
|
|
ls -t tests-to-run/*${1}*.sh |
|
|
|
|
perl -pe 's:(.*/(.*)).sh:bash $1.sh > actual-results/$2; diff -Naur wanted-results/$2 actual-results/$2 || touch $1.sh:' \
|
|
|
|
>$SHFILE
|
|
|
|
fi
|
2012-11-21 21:28:52 +00:00
|
|
|
|
2010-06-25 23:56:14 +00:00
|
|
|
mkdir -p actual-results
|
2011-07-16 23:46:02 +00:00
|
|
|
stdout sh -x $SHFILE | tee testsuite.log
|
2010-05-27 22:34:00 +00:00
|
|
|
rm $SHFILE
|
2011-07-16 23:46:02 +00:00
|
|
|
# If testsuite.log contains @@ then there is a diff
|
|
|
|
if grep -q '@@' testsuite.log ; then
|
|
|
|
false
|
|
|
|
else
|
|
|
|
# No @@'s: So everything worked: Copy the source
|
|
|
|
rm -rf src-passing-testsuite
|
|
|
|
cp -a ../src src-passing-testsuite
|
|
|
|
fi
|
|
|
|
rm testsuite.log
|
2007-09-10 20:28:03 +00:00
|
|
|
|