2 # Hell, this is really difficult with /bin/sh. I want my zsh back!
7 log
=$testdir/$myname.log
19 echo "usage: $myname [-0] [-1] [-2] [-a] [make options]"
20 echo " -0: run tests with all options defined and disabled (2 builds)"
21 echo " -1: run tests with one option defined and disabled"
22 echo " -2: run tests with two options defined and disabled"
23 echo " -a: run all possible tests"
24 echo " default is: myname -0 -1"
25 echo " logging output goes to $log and $log.*"
36 while [ -n "$1" ] ; do
37 if [ "$1" = "-h" ] ; then
40 elif [ "$1" = "-?" ] ; then
43 elif [ "$1" = "-0" ] ; then
47 elif [ "$1" = "-1" ] ; then
51 elif [ "$1" = "-2" ] ; then
55 elif [ "$1" = "-a" ] ; then
69 # set default if nothing was selected
70 if [ -z "$custom" ]; then
75 if [ ! -x .
/$myname ] ; then
76 echo please run
$myname from
$testdir
80 rm -f "$log"* > /dev
/null
2>&1
87 # clean up before next build
90 make clean
> /dev
/null
2>&1
91 make distclean
> /dev
/null
2>&1
92 rm -f config.cache
> /dev
/null
2>&1
93 for i
in `find . -name .deps -type d` ; do rm -rf $i; done > /dev
/null
2>&1
94 for i
in `find . -name Makefile` ; do rm -f $i; done > /dev
/null
2>&1
95 for i
in `find . -name "*.o"` ; do rm -f $i; done > /dev
/null
2>&1
98 # generate parameter list for configure
102 while [ ! "$1" = "" ]; do
103 CONFIGURE_OPTS
="$CONFIGURE_OPTS --disable-${BUILD_OPTIONS[$1]}"
107 while [ ! "${BUILD_OPTIONS[$c3]}" = "" ]; do
108 echo $CONFIGURE_OPTS |
grep -q -- "--disable-${BUILD_OPTIONS[$c3]}" ||
109 CONFIGURE_OPTS
="$CONFIGURE_OPTS --enable-${BUILD_OPTIONS[$c3]}"
114 # disable all enabled options and vice versa
117 CONFIGURE_OPTS
=`echo $CONFIGURE_OPTS |
118 sed -e 's/--enable-/--xyz-/g' |
119 sed -e 's/--disable-/--enable-/g' |
120 sed -e 's/--xyz-/--disable-/g'`
123 # call configure and make (with logging)
126 echo "+++ testing (logfile $1): $CONFIGURE_OPTS" >> $log
128 echo "cleaning up..." >> $log
131 echo "configuring..." >> $log
132 echo "./configure $CONFIGURE_OPTS" > $log.
$1
133 if nice .
/configure
--enable-extras $CONFIGURE_OPTS >> $log.
$1 2>&1; then
139 echo "building..." >> $log
140 if nice
make $MAKE_OPTS > $log.
$1 2>&1; then
148 ############################
149 # end of functions section #
150 ############################
153 # get the list of possible options
159 grep "^\(dnl dummy: \)\?smr_SWITCH" configure.in |
161 sed -e 's/^.*smr_SWITCH.//g' |
163 BUILD_OPTIONS
[$c1]="$i"
164 OPTIONS
="$OPTIONS $i"
173 if [ "$run_depth_1" = "1" ] ; then
176 echo " +++ running $i1 tests for depth 1 +++"
179 while [ ! "${BUILD_OPTIONS[$c1]}" = "" ]; do
181 echo build
${BUILD_OPTIONS[$c1]}_off
182 build
${BUILD_OPTIONS[$c1]}_off
184 echo build
${BUILD_OPTIONS[$c1]}_on
185 build
${BUILD_OPTIONS[$c1]}_on
190 if [ "$run_depth_2" = "1" ] ; then
191 i1
="$nopts * $nopts + $nopts"
193 echo " +++ running $i1 tests for depth 2 +++"
196 while [ -n "${BUILD_OPTIONS[$c1]}" ]; do
198 while [ -n "${BUILD_OPTIONS[$c2]}" ]; do
199 disable_options
$c1 $c2
200 echo build
${BUILD_OPTIONS[$c1]}_off
,${BUILD_OPTIONS[$c2]}_off
201 build
${BUILD_OPTIONS[$c1]}_off
203 echo build
${BUILD_OPTIONS[$c1]}_on
,${BUILD_OPTIONS[$c2]}_on
204 build
${BUILD_OPTIONS[$c1]}_on
211 if [ "$run_depth_0" = "1" ] ; then
213 echo " +++ running 2 tests for depth 0 +++"
217 echo build all_disabled
220 echo build all_enabled
224 if [ "$run_all" = "1" ] ; then
227 echo " +++ running $i1 tests for all combination of options +++"
230 while [ ! "$c1" = "$copts" ]; do
234 while [ ! "$i1" = "$nopts" ]; do
237 if [ "$i2" = "$c2" ]; then
238 opts_off
="$opts_off $i1"
243 disable_options
$opts_off
244 echo "test $c1 of $copts (logfile: `basename $log.$c1`):"
245 echo "$CONFIGURE_OPTS"