]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Import 3.1 TestBed scripts.
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 18 Jan 2009 03:30:40 +0000 (16:30 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 18 Jan 2009 03:30:40 +0000 (16:30 +1300)
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.

Makefile.am
test-builds.sh
test-suite/buildtest.sh [new file with mode: 0755]
test-suite/buildtests/layer-00-default.opts [new file with mode: 0644]

index b3290881a186735ebac68ca0eb2c6b7b79b0b8a5..ff3a26b9368f916575d1ad7cfe61ffe726a40ed5 100644 (file)
@@ -42,3 +42,6 @@ EXTRA_DIST = \
 install-pinger:
        chown root $(DEFAULT_PINGER) 
        chmod 4711 $(DEFAULT_PINGER)
+
+all-am:
+       @echo "Build Successful."
index d27fd5b108f4adb5a97abe7dee89dcd74f9c3b67..f6ed713fcd7089c32a0b1452d46c9b5b0369a19c 100755 (executable)
@@ -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 (executable)
index 0000000..b7f6c36
--- /dev/null
@@ -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 (file)
index 0000000..5f4d232
--- /dev/null
@@ -0,0 +1,5 @@
+#
+# Default configuration options.
+#  - Nothing special configured. Just whatever is found by "./configure"
+#
+OPTS=""