From 8182d08a449c1c3cdc779631f9dfd3312e1b816b Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Thu, 5 Nov 2009 17:25:32 +0100 Subject: [PATCH] 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. --- test-builds.sh | 11 +++++++++++ test-suite/buildtest.sh | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) 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 -- 2.39.5