testsuite: Make target 3 to re-run tests 3 times.

This commit is contained in:
Ole Tange 2013-01-21 23:07:32 +01:00
parent 4d9b570128
commit efb467ef6e
2 changed files with 18 additions and 11 deletions

View file

@ -2,6 +2,10 @@ testsuite: ../src/parallel tests-to-run/* wanted-results/* startdb prereqlocal p
time sh Start.sh
date
3: ../src/parallel tests-to-run/* wanted-results/* startdb prereqlocal prereqremote
TRIES=3 time sh Start.sh
date
testdb: ../src/parallel tests-to-run/*sql* wanted-results/*sql* prereqdb
time sh Start.sh sql
date
@ -52,7 +56,7 @@ portable:
time bash Portable.sh
timings: tests-to-run/* ../src/parallel
ls tests-to-run/*.sh | xargs -n1 echo /usr/bin/time -f %e bash >/tmp/timing.script
ls tests-to-run/*.sh | parallel echo /usr/bin/time -f %e bash >/tmp/timing.script
stdout bash -x /tmp/timing.script | tee /tmp/timing.out
echo usr.bin.time_END >>/tmp/timing.out
perl -ne '/usr.bin.time/ and do { print $$last.$$h; $$h=$$_ }; chomp; $$last = $$_' /tmp/timing.out | sort -n >timings

View file

@ -5,16 +5,19 @@
export LANG=C
SHFILE=/tmp/unittest-parallel.sh
# Run a failing test once
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
if [ "$TRIES" = "3" ] ; then
# Try a failing test thrice
# 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: ' \
# >$SHFILE
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
mkdir -p actual-results
stdout sh -x $SHFILE | tee testsuite.log