]>
git.ipfire.org Git - thirdparty/squid.git/blob - test-builds.sh
3 # Run all or some build tests for a given OS environment.
12 while [ $# -ge 1 ]; do
33 if [ $verbose = yes ]; then
42 layer
=`basename ${opts} .opts`
45 echo "TESTING: ${layer}"
46 chmod -R 777 ${btlayer}
47 rm -f -r ${btlayer} && mkdir
${btlayer}
51 if test -e $top/test-suite
/buildtest.sh
; then
52 $top/test-suite
/buildtest.sh
${opts} 2>&1
54 elif test -e ..
/$top/test-suite
/buildtest.sh
; then
55 ..
/$top/test-suite
/buildtest.sh ..
/${opts} 2>&1
58 echo "Error: cannot find $top/test-suite/buildtest.sh script"
62 # log the result for the outer script to notice
63 echo "buildtest.sh result is $result";
64 } 2>&1 | logtee
${log}
66 result
=1 # failure by default
67 if grep -q '^buildtest.sh result is 0$' ${log}; then
71 # Display BUILD parameters to double check that we are building the
72 # with the right parameters. TODO: Make less noisy.
73 grep -E "BUILD" ${log}
75 errors
="^ERROR|\ error:|\ Error\ |No\ such|assertion\ failed|FAIL:|:\ undefined"
76 grep -E "${errors}" ${log}
78 if test "${cleanup}" = "yes" ; then
79 echo "REMOVE DATA: ${btlayer}"
80 chmod -R 777 ${btlayer}
84 if test $result -eq 0; then
85 # successful execution
86 if test "$verbose" = yes; then
87 echo "Build OK. Global result is $globalResult."
90 echo "Build Failed. Last log lines are:"
95 if test "${cleanup}" = "yes" ; then
96 echo "REMOVE LOG: ${log}"
101 # Decide what tests to run, $* contains test spec names or filenames.
102 # Use all knows specs if $* is empty or a special macro called 'all'.
103 if test -n "$*" -a "$*" != all
; then
106 tests
=`ls -1 $top/test-suite/buildtests/layer*.opts`
110 if test -e "$t"; then
111 # A configuration file
113 elif test -e "$top/test-suite/buildtests/${t}.opts"; then
114 # A well-known configuration name
115 cfg
="$top/test-suite/buildtests/${t}.opts"
117 echo "Error: Unknown test specs '$t'"
122 # run the test, if any
123 if test -n "$cfg"; then
127 # quit on errors unless we should $keepGoing
128 if test $globalResult -ne 0 -a $keepGoing != yes; then