From 13c6bee1ec90e02d75a429d557a3b4efe40defa1 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Sat, 18 Jul 2009 19:01:31 +0000 Subject: [PATCH] Apply fix to allow regression tests to run on MingW by fixing PATH and removing trailing CR/LFs on some outputs. git-svn-id: http://svn.osgeo.org/postgis/trunk@4321 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/Makefile.in | 9 +++++++-- regress/run_test | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/regress/Makefile.in b/regress/Makefile.in index 39b81d25d..7303d6895 100644 --- a/regress/Makefile.in +++ b/regress/Makefile.in @@ -3,14 +3,19 @@ TMPDIR?=/tmp POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@ POSTGIS_GEOS_VERSION=@POSTGIS_GEOS_VERSION@ POSTGIS_PROJ_VERSION=@POSTGIS_PROJ_VERSION@ -PGSQL_BINDIR=@PGSQL_BINDIR@ + +# MingW hack: rather than use PGSQL_BINDIR directly, we change +# to the directory and then use "pwd" to return the path. This +# ensures that the returned path is in MSYS format, otherwise +# colons in drive letters will break PATH. +PGSQL_BINDIR=$(shell pushd "@PGSQL_BINDIR@" && pwd && popd) srcdir=$(shell pwd) # # Put path from pg_config into front of search path # -PATH := $(PGSQL_BINDIR):$(PATH) +PATH := "$(PGSQL_BINDIR):$(PATH)" export PATH diff --git a/regress/run_test b/regress/run_test index ed6de3653..ffd528bf5 100755 --- a/regress/run_test +++ b/regress/run_test @@ -181,7 +181,8 @@ run_loader_test () show_progress - if [ `${PSQL} -t -A -c "SELECT count(*) FROM pg_tables WHERE tablename = '${_tblname}'" "${DB}"` -gt 0 ]; then + # MingW hack: use tr to strip off any trailing CR/LFs introduce by MingW which confuse expr + if [ `${PSQL} -t -A -c "SELECT count(*) FROM pg_tables WHERE tablename = '${_tblname}'" "${DB}" | tr -d '\r\n'` -gt 0 ]; then ${PSQL} -c "DROP TABLE ${_tblname}" "${DB}" >> ${TMPDIR}/regress_log 2>&1 fi -- 2.50.1