|
1 | 1 | #!/bin/sh
|
2 | 2 | #
|
3 |
| -# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.18 2000/05/18 16:11:39 momjian Exp $ |
| 3 | +# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.19 2000/05/24 22:32:59 tgl Exp $ |
4 | 4 |
|
5 | 5 | # ----------
|
6 | 6 | # Check call syntax
|
@@ -104,18 +104,27 @@ FRONTEND="$BINDIR/psql $HOSTLOC -a -q -X"
|
104 | 104 | # testname/hostnamepattern=substitutefile
|
105 | 105 | # where the hostnamepattern is evaluated per the rules of expr(1) --- namely,
|
106 | 106 | # it is a standard regular expression with an implicit ^ at the start.
|
| 107 | +# |
| 108 | +# The tempfile hackery is needed because some shells will run the loop |
| 109 | +# inside a subshell, whereupon shell variables set therein aren't seen |
| 110 | +# outside the loop :-( |
107 | 111 | # ----------
|
108 |
| -SUBSTLIST="" |
109 |
| -exec 4<resultmap |
110 |
| -while read LINE <&4 |
| 112 | +TMPFILE="matches.$$" |
| 113 | +cat /dev/null > $TMPFILE |
| 114 | +while read LINE |
111 | 115 | do
|
112 | 116 | HOSTPAT=`expr "$LINE" : '.*/\(.*\)='`
|
113 | 117 | if [ `expr "$hostname" : "$HOSTPAT"` -ne 0 ]
|
114 | 118 | then
|
115 |
| - SUBSTLIST="$SUBSTLIST $LINE" |
| 119 | + # remove hostnamepattern from line so that there are no shell |
| 120 | + # wildcards in SUBSTLIST; else later 'for' could expand them! |
| 121 | + TESTNAME=`expr "$LINE" : '\(.*\)/'` |
| 122 | + SUBST=`echo "$LINE" | sed 's/^.*=//'` |
| 123 | + echo "$TESTNAME=$SUBST" >> $TMPFILE |
116 | 124 | fi
|
117 |
| -done |
118 |
| -exec 4<&- |
| 125 | +done <resultmap |
| 126 | +SUBSTLIST=`cat $TMPFILE` |
| 127 | +rm -f $TMPFILE |
119 | 128 |
|
120 | 129 | # ----------
|
121 | 130 | # Catch SIGINT and SIGTERM to shutdown the postmaster
|
|
258 | 267 | # Run the regression tests specified in the ./sql/run_check.tests file
|
259 | 268 | # ----------
|
260 | 269 | echo "=============== Running regression queries... ================"
|
261 |
| -echo "" > regression.diffs |
262 |
| -echo "" > regress.out |
| 270 | +cat /dev/null > regression.diffs |
| 271 | +cat /dev/null > regress.out |
263 | 272 |
|
264 | 273 | if [ "x$hostname" = "xi386-pc-qnx" ]; then
|
265 | 274 | DIFFOPT="-b"
|
@@ -439,7 +448,7 @@ lno=0
|
439 | 448 | EXPECTED="expected/${name}.out"
|
440 | 449 | for LINE in $SUBSTLIST
|
441 | 450 | do
|
442 |
| - if [ `expr "$LINE" : "$name/"` -ne 0 ] |
| 451 | + if [ `expr "$LINE" : "$name="` -ne 0 ] |
443 | 452 | then
|
444 | 453 | SUBST=`echo "$LINE" | sed 's/^.*=//'`
|
445 | 454 | EXPECTED="expected/${SUBST}.out"
|
|
0 commit comments