]> git.ipfire.org Git - thirdparty/squid.git/blob - test-builds.sh
Merge from trunk
[thirdparty/squid.git] / test-builds.sh
1 #!/bin/sh
2 #
3 # Run specific build tests for a given OS environment.
4 #
5
6 cleanup="no"
7 if test "${1}" = "--cleanup" ; then
8 cleanup="yes"
9 shift
10 fi
11
12 # Things to catch
13 errors="^ERROR|\ error:|\ Error\ |No\ such|assertion\ failed|FAIL:"
14
15 # Run a single test build by name
16 tmp="${1}"
17 if test -e ./test-suite/buildtests/${tmp}.opts ; then
18 echo "TESTING: ${tmp}"
19 rm -f -r bt${tmp} && mkdir bt${tmp} && cd bt${tmp}
20 ../test-suite/buildtest.sh ../test-suite/buildtests/${tmp}
21 grep -E "${errors}" buildtest_*.log && exit 1
22 cd ..
23 exit 0
24 fi
25
26 #
27 # Run specific tests for each combination of configure-time
28 # Options.
29 #
30 # These layers are constructed from detailed knowledge of
31 # component dependencies.
32 #
33 for f in `ls -1 ./test-suite/buildtests/layer*.opts` ; do
34 layer=`echo "${f}" | grep -o -E "layer-[0-9]*-[^\.]*"`
35 rm -f -r bt${layer} && mkdir bt${layer} && cd bt${layer}
36 arg=`echo "${f}" | sed s/\\.opts//`
37 echo "TESTING: ${arg}"
38 ../test-suite/buildtest.sh ".${arg}"
39 grep -E "${errors}" buildtest_*.log && exit 1
40 cd ..
41 if test "${cleanup}" = "yes" ; then
42 echo "REMOVE: bt${layer}"
43 rm -f -r bt${layer}
44 fi
45 done