]>
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 rm -f -r ${btlayer} && mkdir
${btlayer}
50 if test -e $top/test-suite
/buildtest.sh
; then
51 $top/test-suite
/buildtest.sh
${opts} 2>&1
53 elif test -e ..
/$top/test-suite
/buildtest.sh
; then
54 ..
/$top/test-suite
/buildtest.sh ..
/${opts} 2>&1
57 echo "Error: cannot find $top/test-suite/buildtest.sh script"
61 # log the result for the outer script to notice
62 echo "buildtest.sh result is $result";
63 } 2>&1 | logtee
${log}
65 result
=1 # failure by default
66 if grep -q '^buildtest.sh result is 0$' ${log}; then
70 # Display BUILD parameters to double check that we are building the
71 # with the right parameters. TODO: Make less noisy.
72 grep -E "BUILD" ${log}
74 errors
="^ERROR|\ error:|\ Error\ |No\ such|assertion\ failed|FAIL:"
75 grep -E "${errors}" ${log}
77 if test "${cleanup}" = "yes" ; then
78 echo "REMOVE DATA: ${btlayer}"
82 if test $result -eq 0; then
83 # successful execution
84 if test "$verbose" = yes; then
85 echo "Build OK. Global result is $globalResult."
88 echo "Build Failed. Last log lines are:"
93 if test "${cleanup}" = "yes" ; then
94 echo "REMOVE LOG: ${log}"
99 # Decide what tests to run, $* contains test spec names or filenames.
100 # Use all knows specs if $* is empty or a special macro called 'all'.
101 if test -n "$*" -a "$*" != all
; then
104 tests
=`ls -1 $top/test-suite/buildtests/layer*.opts`
108 if test -e "$t"; then
109 # A configuration file
111 elif test -e "$top/test-suite/buildtests/${t}.opts"; then
112 # A well-known configuration name
113 cfg
="$top/test-suite/buildtests/${t}.opts"
115 echo "Error: Unknown test specs '$t'"
120 # run the test, if any
121 if test -n "$cfg"; then
125 # quit on errors unless we should $keepGoing
126 if test $globalResult -ne 0 -a $keepGoing != yes; then