]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: frencesco chemolli <kinkie@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 23 Feb 2009 11:05:52 +0000 (00:05 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 23 Feb 2009 11:05:52 +0000 (00:05 +1300)
testBed: add parallel make capability to build testing

This small patch to the test-suite system allows for parallel-make in
the test-suite (only on Linux). This will allow for shorter build-test
times on multicpu/multicore systems.

1  2 
test-suite/buildtest.sh

index 395d4966832923cc8c953d37716e59fabc079b71,9316254b650d109e264822b698f7ce864037c6ef..ed76be6a28be5343d1b5a4a477ce937ff018cc97
@@@ -7,11 -7,24 +7,19 @@@
  #
  
  dist="${1}"
 -
 -# Figure out where to log the test output
 -log=`echo "${dist}" | sed s/..test-suite.buildtests.//g `
 +base="`dirname $0`"
  
 -# ... and send everything there...
 -{
 -
+ #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
  if test -e ${dist%%.opts}.opts ; then
        echo "BUILD: ${dist%%.opts}.opts"
 -      . ./${dist%%.opts}.opts
 +      . ${dist%%.opts}.opts
  else
        echo "BUILD: DEFAULT"
        OPTS=""
@@@ -30,9 -44,10 +38,9 @@@ f
  # above command currently encounters dependancy problems on cleanup.
  #
  rm -f -r src/fs/aufs/.deps src/fs/diskd/.deps &&
 -      ../configure --silent ${OPTS} 2>&1 &&
 -      make $pjobs check 2>&1 &&
 -      make $pjobs 2>&1
 -
 -} 2>&1 > ./buildtest_${log}.log
 +      $base/../configure --silent ${OPTS} 2>&1 &&
-       make check 2>&1 &&
-       make distcheck 2>&1 &&
-       make 2>&1
++      make ${pjobs} check 2>&1 &&
++      make ${pjobs} distcheck 2>&1 &&
++      make ${pjobs} 2>&1
  
  # do not build any of the install's ...