]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Tests: Add --action parameter for testing script
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Jan 2016 13:40:42 +0000 (02:40 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 18 Jan 2016 13:40:42 +0000 (02:40 +1300)
This command line option allows automake target to be provided as an
override to the target specified in the test build scripts. With this a
partial test can be run for all specified layers rather than a full
distcheck which can be quite slow.

test-builds.sh
test-suite/buildtest.sh

index 9d0b0152e86b8af26011f0bc9fc494fe9ec22be5..0307953304b61a0f26c9e0d866d0cc85e0d3d96d 100755 (executable)
@@ -13,12 +13,18 @@ top=`dirname $0`
 
 globalResult=0
 
+action=""
 cleanup="no"
 verbose="no"
 keepGoing="no"
 remove_cache_file="true"
 while [ $# -ge 1 ]; do
     case "$1" in
+    --action)
+       shift
+       action="$1"
+       shift
+       ;;
     --cleanup)
        cleanup="yes"
        shift
@@ -61,6 +67,7 @@ logtee() {
 
 buildtest() {
     opts=$1
+    action=$2
     layer=`basename ${opts} .opts`
     btlayer="bt${layer}"
     log=${btlayer}.log
@@ -77,10 +84,10 @@ buildtest() {
        result=255
        cd ${btlayer}
        if test -e $top/test-suite/buildtest.sh ; then
-           $top/test-suite/buildtest.sh ${opts} 2>&1
+           $top/test-suite/buildtest.sh "${action}" ${opts} 2>&1
            result=$?
        elif test -e ../$top/test-suite/buildtest.sh ; then
-           ../$top/test-suite/buildtest.sh ../${opts} 2>&1
+           ../$top/test-suite/buildtest.sh "${action}" ../${opts} 2>&1
            result=$?
        else
            echo "Error: cannot find $top/test-suite/buildtest.sh script"
@@ -154,7 +161,7 @@ for t in $tests; do
 
     # run the test, if any
     if test -n "$cfg"; then
-       buildtest $cfg
+       buildtest "$cfg" "$action"
     fi
 
     # quit on errors unless we should $keepGoing
index 33dcbefaadf185e554bbc5316ebf127137d30d3f..c2c5e870f9923033982f5ee2912ec04b0a4c10cc 100755 (executable)
@@ -13,7 +13,8 @@
 # Should be run from the source package root directory with paths relative to there.
 #
 
-config="${1}"
+action="${1}"
+config="${2}"
 base="`dirname ${0}`"
 
 # cache_file may be set by environment variable
@@ -44,6 +45,11 @@ else
        exit 1;
 fi
 
+# override the layers MAKETEST default
+if test "x${action}" != "x"; then
+    MAKETEST="${action}"
+fi
+
 #
 # empty all the existing code, reconfigure and builds test code
 # but skip if we have no files to remove.