]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Testbed: cleanup bashism in test scripts
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 19 Jul 2008 10:10:50 +0000 (04:10 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 19 Jul 2008 10:10:50 +0000 (04:10 -0600)
test-builds.sh
test-suite/buildtest.sh

index 3c003a1bc5f4c324f5b52349099c791f0872e259..2c4d85536310c997fdb9dfc2e32d9621fe8d2168 100755 (executable)
@@ -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
index 07a2f5ed06700f0365e59952c90f40ee1ce51622..4c3e214e1a67d3876d911beb299be54f8e352c03 100755 (executable)
@@ -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 ...