]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[rt46602] Add ability to prevent deletion of output files when running all tests
authorStephen Morris <stephen@isc.org>
Wed, 20 Dec 2017 19:05:59 +0000 (19:05 +0000)
committerEvan Hunt <each@isc.org>
Sun, 25 Feb 2018 17:27:12 +0000 (09:27 -0800)
Some tests may need to examine all output files from all system tests.
Allow the deletion of these files to be inhibited if required.

(cherry picked from commit 00bc29640ba57ef4a18721bc4c75c78cdfc2fea1)
(cherry picked from commit 6917ea971a88440cb92645831d9335b57542f7ea)
(cherry picked from commit 9040d3d3670998f4acb2020226164dcdde51a0b1)

bin/tests/system/Makefile.in
bin/tests/system/runall.sh

index 0459ff4c033d01eb99e34d534d18d62cf75edeb6..e779045dadf726dd72e5498c52b2926b2e299e60 100644 (file)
@@ -68,7 +68,7 @@ parallel.mk:
        for directory in $(PARALLEL) ; do \
                echo "" >> $@ ; \
                echo "$$directory:" >> $@ ; \
-               echo "  @$(SHELL) ./run.sh -r -p $$port $$directory 2>&1 | tee $$directory/test.output" >> $@ ; \
+               echo "  @$(SHELL) ./run.sh $$NOCLEAN -r -p $$port $$directory 2>&1 | tee $$directory/test.output" >> $@ ; \
                port=`expr $$port + 100` ; \
        done
 
@@ -76,7 +76,7 @@ parallel.mk:
 
 test: parallel.mk subdirs
        @$(MAKE) -f parallel.mk check
-       @$(SHELL) ./runsequential.sh -r
+       @$(SHELL) ./runsequential.sh $$NOCLEAN -r
        @$(SHELL) ./testsummary.sh
 
 check: test
index 3909934515fd64c357504a76e1f24f92d08687c8..e7adab0f1c27ddc3c5008e7d8f209532a45d2e90 100644 (file)
 SYSTEMTESTTOP=.
 . $SYSTEMTESTTOP/conf.sh
 
-usage="Usage: ./runall.sh [numprocesses]"
+usage="Usage: ./runall.sh [-n] [numprocesses]"
+
+while getopts "n" flag; do
+    case "$flag" in
+       n) CLEANFLAG="NOCLEAN=-n" ;;
+       *) echo "$usage" >&2 ; exit 1 ;;
+    esac
+done
+shift `expr $OPTIND - 1`
 
 if [ $# -eq 0 ]; then
     numproc=1
@@ -34,7 +42,7 @@ elif [ $# -eq 1 ]; then
     test "$1" -eq "$1" > /dev/null 2>& 1
     if [ $? -ne 0 ]; then
         # Value passed is not numeric
-        echo "$usage"
+        echo "$usage" >&2
         exit 1
     fi
     numproc=$1
@@ -43,6 +51,6 @@ else
     exit 1
 fi
 
-make -j $numproc check
+$CLEANFLAG make -j $numproc check
 
 exit $?