]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Enable configure cache during test-suite runs
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 5 Nov 2009 16:25:32 +0000 (17:25 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 5 Nov 2009 16:25:32 +0000 (17:25 +0100)
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.

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

index 8aaf47b476cdec1af8c3dbf05b99f66fd6129fcc..bd25d396697ad535728cb89e5874abad277f4e1b 100755 (executable)
@@ -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
index d71fab3dbc711bbed7db8326aaab7a94dd9bbcc8..452fd2741b26343987dd6abf290d8a23c4eb085e 100755 (executable)
@@ -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