From: Amos Jeffries Date: Mon, 18 Jan 2016 13:40:42 +0000 (+1300) Subject: Tests: Add --action parameter for testing script X-Git-Tag: SQUID_4_0_5~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61cd5ace7678ab781e07cc4da43872103c12026a;p=thirdparty%2Fsquid.git Tests: Add --action parameter for testing script 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. --- diff --git a/test-builds.sh b/test-builds.sh index 9d0b0152e8..0307953304 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -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 diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh index 33dcbefaad..c2c5e870f9 100755 --- a/test-suite/buildtest.sh +++ b/test-suite/buildtest.sh @@ -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.