From: Amos Jeffries Date: Sat, 19 Jul 2008 10:10:50 +0000 (-0600) Subject: Testbed: cleanup bashism in test scripts X-Git-Tag: SQUID_3_1_0_1~49^2~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d885c4dd4e87f8445370451ff9b179c1bfc5830;p=thirdparty%2Fsquid.git Testbed: cleanup bashism in test scripts --- diff --git a/test-builds.sh b/test-builds.sh index 3c003a1bc5..2c4d855363 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -1,11 +1,12 @@ -# #!/bin/bash +#!/bin/sh # # Run specific build tests for a given OS environment. # -if test -f "./test-suite/buildtests/os-${1}.opts" ; then - echo "TESTING: ${1}" - ./test-suite/buildtest.sh ./test-suite/buildtests/os-${1} +tmp="${1}" +if test -x "./test-suite/buildtests/os-${tmp}.opts" ; then + echo "TESTING: ${tmp}" + ./test-suite/buildtest.sh ./test-suite/buildtests/os-${tmp} fi # @@ -17,6 +18,7 @@ fi # for f in `ls -1 ./test-suite/buildtests/layer*.opts` ; do - echo "TESTING: ${f/.opts}" - ./test-suite/buildtest.sh ${f/.opts} + arg=`echo "${f}" | sed s/\\.opts//` + echo "TESTING: ${arg}" + ./test-suite/buildtest.sh "${arg}" done diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh index 07a2f5ed06..4c3e214e1a 100755 --- a/test-suite/buildtest.sh +++ b/test-suite/buildtest.sh @@ -1,4 +1,4 @@ -# #!/bin/bash +#!/bin/sh -ex # # Configure and run a test build against any given set of configure options # or compile-time flags. @@ -12,19 +12,19 @@ dist="${1}" log=`echo "${dist}" | sed s/..test-suite.buildtests.//g ` # ... and send everything there... -( +{ -if test -f ${dist/.opts}.opts ; then - echo "BUILD: ${dist/.opts}.opts" - . ./${dist/.opts}.opts +if test -x ${dist%%.opts}.opts ; then + echo "BUILD: ${dist%%.opts}.opts" + . ./${dist%%.opts}.opts else echo "BUILD: DEFAULT" OPTS="" fi -if test -f ${dist/.opts/}.flags ; then -# echo "DEBUG: ${dist/.opts}.flags" - FLAGS=`cat ./${dist}.flags` +if test -f ${dist%%.opts}.flags ; then +# echo "DEBUG: ${dist%%.opts}.flags" + FLAGS=`cat ./${dist%%.opts}.flags` # else nothing set for flags. fi @@ -42,7 +42,6 @@ rm -f -r src/fs/aufs/.deps src/fs/diskd/.deps && make check && make - -) 2>&1 > ./buildtest_${log}.log +} 2>&1 > ./buildtest_${log}.log # do not build any of the install's ...