]> git.ipfire.org Git - thirdparty/squid.git/blob - test-builds.sh
Correct test-builds to allow individual tests run by name
[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 # Run a single test build by name
13 tmp="${1}"
14 if test -e ./test-suite/buildtests/${tmp}.opts ; then
15 echo "TESTING: ${tmp}"
16 rm -f -r bt${tmp} && mkdir bt${tmp} && cd bt${tmp}
17 ../test-suite/buildtest.sh ../test-suite/buildtests/${tmp}
18 ( grep -E "^ERROR|\ error:\ |No\ such" buildtest_*.log && exit 1 )
19 cd ..
20 exit 0
21 fi
22
23 #
24 # Run specific tests for each combination of configure-time
25 # Options.
26 #
27 # These layers are constructed from detailed knowledge of
28 # component dependencies.
29 #
30 for f in `ls -1 ./test-suite/buildtests/layer*.opts` ; do
31 layer=`echo "${f}" | grep -o -E "layer-[0-9]*-[^\.]*"`
32 rm -f -r bt${layer} && mkdir bt${layer} && cd bt${layer}
33 arg=`echo "${f}" | sed s/\\.opts//`
34 echo "TESTING: ${arg}"
35 ../test-suite/buildtest.sh ".${arg}" ||
36 ( grep -E "^ERROR|\ error:\ |No\ such" buildtest_*.log && exit 1 )
37 cd ..
38 if test "${cleanup}" = "yes" ; then
39 echo "REMOVE: bt${layer}"
40 rm -f -r bt${layer}
41 fi
42 done