]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added buildtest parallelization (only available on Linux)
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 19 Feb 2009 08:56:47 +0000 (09:56 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 19 Feb 2009 08:56:47 +0000 (09:56 +0100)
test-suite/buildtest.sh

index 87561671a821c37c96b338ca40c09b6ea398052b..9316254b650d109e264822b698f7ce864037c6ef 100755 (executable)
@@ -11,6 +11,14 @@ dist="${1}"
 # Figure out where to log the test output
 log=`echo "${dist}" | sed s/..test-suite.buildtests.//g `
 
+#if we are on Linux, let's try parallelizing
+pjobs="" #default
+if [ -e /proc/cpuinfo ]; then
+    ncpus=`grep '^processor' /proc/cpuinfo | tail -1|awk '{print $3}'`
+    ncpus=`expr $ncpus + 1`
+    pjobs="-j$ncpus"
+fi
+
 # ... and send everything there...
 {
 
@@ -37,8 +45,8 @@ fi
 #
 rm -f -r src/fs/aufs/.deps src/fs/diskd/.deps &&
        ../configure --silent ${OPTS} 2>&1 &&
-       make check 2>&1 &&
-       make 2>&1
+       make $pjobs check 2>&1 &&
+       make $pjobs 2>&1
 
 } 2>&1 > ./buildtest_${log}.log