Index: src/test/regress/GNUmakefile =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/test/regress/GNUmakefile,v retrieving revision 1.42 diff -c -w -r1.42 GNUmakefile *** src/test/regress/GNUmakefile 21 Mar 2003 17:18:34 -0000 1.42 --- src/test/regress/GNUmakefile 28 Oct 2003 19:34:26 -0000 *************** *** 25,30 **** --- 25,37 ---- # default encoding MULTIBYTE = SQL_ASCII + # maximum simultaneous connections for parallel tests + + MAXCONNOPT := + ifdef MAX_CONNECTIONS + MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS) + endif + ## ## Prepare for tests *************** *** 113,119 **** ## check: all ! $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) installcheck: all $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --- 120,126 ---- ## check: all ! $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) installcheck: all $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) Index: src/test/regress/pg_regress.sh =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/test/regress/pg_regress.sh,v retrieving revision 1.35 diff -c -w -r1.35 pg_regress.sh *** src/test/regress/pg_regress.sh 7 Aug 2003 14:36:31 -0000 1.35 --- src/test/regress/pg_regress.sh 28 Oct 2003 19:34:26 -0000 *************** *** 13,18 **** --- 13,20 ---- Options: --debug turn on debug mode in programs that are run --inputdir=DIR take input files from DIR (default \`.') + --max-connections=NN maximum number of concurrent connections + (default = 0 meaning unlimited) --multibyte=ENCODING use ENCODING as the multibyte encoding, and also run a test by the same name --outputdir=DIR place output files in DIR (default \`.') *************** *** 92,97 **** --- 94,100 ---- dbname=regression hostname=localhost + maxconnections=0 : ${GMAKE='@GMAKE@'} *************** *** 124,129 **** --- 127,135 ---- --temp-install=*) temp_install=`expr "x$1" : "x--temp-install=\(.*\)"` shift;; + --max-connections=*) + maxconnections=`expr "x$1" : "x--max-connections=\(.*\)"` + shift;; --outputdir=*) outputdir=`expr "x$1" : "x--outputdir=\(.*\)"` shift;; *************** *** 156,161 **** --- 162,186 ---- esac done + # ---------- + # warn of cygwin likely failure + # if not 0 < maxconnections <= 10 + # and we are running parallel tests + # ---------- + + case $host_platform in *-*-cygwin*) + case "$schedule" in *parallel*) + if [ $maxconnections -lt 1 -o $maxconnections -gt 10 ] ; then + echo max connections of $maxconnections is likely to fail on cygwin + echo try \"$me --max-connections=10\" or \"gmake MAX_CONNECTIONS=10 check\" + echo if this happens + echo + fi + ;; + esac + ;; + esac + # ---------- # When on QNX or BeOS, don't use Unix sockets. *************** *** 556,566 **** --- 581,599 ---- else # Start a parallel group $ECHO_N "parallel group ($# tests): $ECHO_C" + if [ $maxconnections -gt 0 ] ; then + testnum=0 + test $# -gt $maxconnections && $ECHO_N "(in groups of $maxconnections) $ECHO_C" + fi for name do ( $PSQL -d "$dbname" <"$inputdir/sql/$name.sql" >"$outputdir/results/$name.out" 2>&1 $ECHO_N " $name$ECHO_C" ) & + if [ $maxconnections -gt 0 ] ; then + testnum=`expr \( $testnum + 1 \) % $maxconnections` + test $testnum -eq 0 && wait + fi done wait echo