- Test code has -q option for quiet output.

This commit is contained in:
W.C.A. Wijngaards 2021-05-21 17:08:58 +02:00
parent ff6b527184
commit 4f7c194a83
3 changed files with 44 additions and 16 deletions

View file

@ -1,3 +1,6 @@
21 May 2021: Wouter
- Test code has -q option for quiet output.
19 May 2021: George
- Fix for #411, #439, #469: Reset the DNS message ID when moving queries
between TCP streams.

View file

@ -1,5 +1,11 @@
#!/usr/bin/env bash
. testdata/common.sh
quiet=0
if test "$1" = "-q"; then
quiet=1
tdirarg="-q"
shift
fi
NEED_SPLINT='00-lint.tdir'
NEED_DOXYGEN='01-doc.tdir'
@ -33,7 +39,7 @@ fi
export -n NOTIFY_SOCKET
cd testdata;
sh ../testcode/mini_tdir.sh clean
sh ../testcode/mini_tdir.sh $tdirarg clean
rm -f .perfstats.txt
for test in `ls -d *.tdir`; do
SKIP=0
@ -57,10 +63,10 @@ for test in `ls -d *.tdir`; do
fi
if test $SKIP -eq 0; then
echo $test
sh ../testcode/mini_tdir.sh -a ../.. exe $test
sh ../testcode/mini_tdir.sh -a ../.. $tdirarg exe $test
else
echo "skip $test"
fi
done
sh ../testcode/mini_tdir.sh report
sh ../testcode/mini_tdir.sh $tdirarg report
cat .perfstats.txt

View file

@ -5,14 +5,23 @@ if test "$1" = "-a"; then
shift
shift
fi
quiet=0
if test "$1" = "-q"; then
quiet=1
shift
fi
if test "$1" = "clean"; then
echo "rm -f result.* .done* .tdir.var.master .tdir.var.test"
if test $quiet = 0; then
echo "rm -f result.* .done* .tdir.var.master .tdir.var.test"
fi
rm -f result.* .done* .tdir.var.master .tdir.var.test
exit 0
fi
if test "$1" = "fake"; then
echo "minitdir fake $2"
if test $quiet = 0; then
echo "minitdir fake $2"
fi
echo "fake" > .done-`basename $2 .tdir`
exit 0
fi
@ -37,7 +46,7 @@ if test "$1" = "-f" && test "$2" = "report"; then
desc=`grep ^Description: "result.$name" | sed -e 's/Description: //'`
fi
if test -f ".done-$name"; then
if test "$1" != "-q"; then
if test $quiet = 0; then
echo "** PASSED ** $timelen $name: $desc"
pass=`expr $pass + 1`
fi
@ -65,7 +74,7 @@ if test "$1" = "report" || test "$2" = "report"; then
for result in *.tdir; do
name=`basename $result .tdir`
if test -f ".done-$name"; then
if test "$1" != "-q"; then
if test $quiet = 0; then
echo "** PASSED ** : $name"
fi
else
@ -82,9 +91,9 @@ fi
if test "$1" != 'exe'; then
# usage
echo "mini tdir. Reduced functionality for old shells."
echo " tdir exe <file>"
echo " tdir fake <file>"
echo " tdir clean"
echo " tdir [-q] exe <file>"
echo " tdir [-q] fake <file>"
echo " tdir [-q] clean"
echo " tdir [-q|-f] report"
exit 1
fi
@ -117,7 +126,9 @@ if test -f .done-$name; then
fi
# Copy
echo "minitdir copy $1 to $dir"
if test $quiet = 0; then
echo "minitdir copy $1 to $dir"
fi
mkdir $dir
if cp --help 2>&1 | grep -- "-a" >/dev/null; then
cp -a $name.tdir/* $dir/
@ -131,7 +142,9 @@ echo "minitdir exe $name" > $result
grep "Description:" $name.dsc >> $result 2>&1
echo "DateRunStart: "`date "+%s" 2>/dev/null` >> $result
if test -f $name.pre; then
echo "minitdir exe $name.pre"
if test $quiet = 0; then
echo "minitdir exe $name.pre"
fi
echo "minitdir exe $name.pre" >> $result
$shell $name.pre $args >> $result
if test $? -ne 0; then
@ -139,7 +152,9 @@ if test -f $name.pre; then
fi
fi
if test -f $name.test; then
echo "minitdir exe $name.test"
if test $quiet = 0; then
echo "minitdir exe $name.test"
fi
echo "minitdir exe $name.test" >> $result
$shell $name.test $args >>$result 2>&1
if test $? -ne 0; then
@ -149,12 +164,16 @@ if test -f $name.test; then
else
echo "$name: PASSED" >> $result
echo "$name: PASSED" > ../.done-$name
echo "$name: PASSED"
if test $quiet = 0; then
echo "$name: PASSED"
fi
success="yes"
fi
fi
if test -f $name.post; then
echo "minitdir exe $name.post"
if test $quiet = 0; then
echo "minitdir exe $name.post"
fi
echo "minitdir exe $name.post" >> $result
$shell $name.post $args >> $result
if test $? -ne 0; then