From: Amos Jeffries Date: Sun, 18 Jan 2009 03:30:40 +0000 (+1300) Subject: Import 3.1 TestBed scripts. X-Git-Tag: SQUID_3_0_STABLE12~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=502629c581d4c84528c8bea667f5d6bd5948857c;p=thirdparty%2Fsquid.git Import 3.1 TestBed scripts. I'm sick of fiddling with the old manual testing permutations. 3.1 testbed is now stable enough to port. This adds the basic build test structure and layers which 3.0 is currently known to pass. Some 'make check' errors prevent further layers being added at this time. That is expected to change. --- diff --git a/Makefile.am b/Makefile.am index b3290881a1..ff3a26b936 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,3 +42,6 @@ EXTRA_DIST = \ install-pinger: chown root $(DEFAULT_PINGER) chmod 4711 $(DEFAULT_PINGER) + +all-am: + @echo "Build Successful." diff --git a/test-builds.sh b/test-builds.sh index d27fd5b108..f6ed713fcd 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -1,6 +1,47 @@ #!/bin/sh # -# Dummy script to allow 3.0 snapshots now that 3.x depends -# on a clean bill of health before snapshots are built. +# Run specific build tests for a given OS environment. # -echo "NOP: 3.0 has no TestBed integration." + +cleanup="no" +if test "${1}" = "--cleanup" ; then + cleanup="yes" + shift +fi + +# Things to catch +errors="^ERROR|\ error:|\ Error\ |No\ such|assertion\ failed|FAIL:" + +# Run a single test build by name +tmp="${1}" +if test -e ./test-suite/buildtests/${tmp}.opts ; then + echo "TESTING: ${tmp}" + rm -f -r bt${tmp} && mkdir bt${tmp} && cd bt${tmp} + ../test-suite/buildtest.sh ../test-suite/buildtests/${tmp} + grep -E "${errors}" buildtest_*.log && exit 1 + cd .. + exit 0 +fi + +# +# Run specific tests for each combination of configure-time +# Options. +# +# These layers are constructed from detailed knowledge of +# component dependencies. +# +for f in `ls -1 ./test-suite/buildtests/layer*.opts` ; do + layer=`echo "${f}" | grep -o -E "layer-[0-9]*-[^\.]*"` + rm -f -r bt${layer} && mkdir bt${layer} && cd bt${layer} + arg=`echo "${f}" | sed s/\\.opts//` + echo "TESTING: ${arg}" + ../test-suite/buildtest.sh ".${arg}" + grep -E "${errors}" buildtest_*.log && exit 1 + result=`tail -2 buildtest_*.log | head -1` + test "${result}" = "Build Successful." || ( tail -1 buildtest_*.log ; exit 1 ) + cd .. + if test "${cleanup}" = "yes" ; then + echo "REMOVE: bt${layer}" + rm -f -r bt${layer} + fi +done diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh new file mode 100755 index 0000000000..b7f6c3671a --- /dev/null +++ b/test-suite/buildtest.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Configure and run a test build against any given set of configure options +# or compile-time flags. +# +# Should be run from the source package root directory with paths relative to there. +# + +dist="${1}" + +# Figure out where to log the test output +log=`echo "${dist}" | sed s/..test-suite.buildtests.//g ` + +# ... and send everything there... +{ + +if test -e ${dist%%.opts}.opts ; then + echo "BUILD: ${dist%%.opts}.opts" + . ./${dist%%.opts}.opts +else + echo "BUILD: DEFAULT" + OPTS="" + FLAGS="" +fi + +# +# empty all the existing code, reconfigure and builds test code + +make -k distclean || echo "distclean done. errors are unwanted but okay here." + +# +# 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 check 2>&1 && + make 2>&1 + +} 2>&1 > ./buildtest_${log}.log + +# do not build any of the install's ... diff --git a/test-suite/buildtests/layer-00-default.opts b/test-suite/buildtests/layer-00-default.opts new file mode 100644 index 0000000000..5f4d232ef0 --- /dev/null +++ b/test-suite/buildtests/layer-00-default.opts @@ -0,0 +1,5 @@ +# +# Default configuration options. +# - Nothing special configured. Just whatever is found by "./configure" +# +OPTS=""