From: Francesco Chemolli Date: Thu, 5 Nov 2009 16:25:32 +0000 (+0100) Subject: Enable configure cache during test-suite runs X-Git-Tag: SQUID_3_2_0_1~611 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8182d08a449c1c3cdc779631f9dfd3312e1b816b;p=thirdparty%2Fsquid.git Enable configure cache during test-suite runs Added to test-build.sh the command-line switch --use-config-cache, which causes the various unit test runs to share the config.cache. The cache is NOT reused across different test-builds invocations. --- diff --git a/test-builds.sh b/test-builds.sh index 8aaf47b476..bd25d39669 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -23,6 +23,12 @@ while [ $# -ge 1 ]; do keepGoing="yes" shift ;; + --use-config-cache) + #environment variable will be picked up by buildtest.sh + cache_file=/tmp/config.cache.$$ + export cache_file + shift + ;; *) break ;; @@ -105,6 +111,11 @@ buildtest() { fi } +# if using cache, make sure to clear it up first +if [ -n "$cache_file" -a -e "$cache_file" ]; then + rm $cache_file +fi + # Decide what tests to run, $* contains test spec names or filenames. # Use all knows specs if $* is empty or a special macro called 'all'. if test -n "$*" -a "$*" != all; then diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh index d71fab3dbc..452fd2741b 100755 --- a/test-suite/buildtest.sh +++ b/test-suite/buildtest.sh @@ -9,6 +9,12 @@ config="${1}" base="`dirname ${0}`" +# cache_file may be set by environment variable +configcache="" +if [ -n "$cache_file" ]; then + configcache="--cache-file=$cache_file" +fi + #if we are on Linux, let's try parallelizing if [ -z "$pjobs" -a -e /proc/cpuinfo ]; then ncpus=`grep '^processor' /proc/cpuinfo | tail -1|awk '{print $3}'` @@ -45,7 +51,7 @@ fi # above command currently encounters dependancy problems on cleanup. # # do not build any of the install's ... - $base/../configure ${OPTS} 2>&1 && + $base/../configure ${OPTS} ${configcache} 2>&1 && make ${pjobs} ${MAKETEST} 2>&1 # Remember and then explicitly return the result of the last command