#!/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
--- /dev/null
+#!/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 ...