From 97af7875f77046b0704d1dedc5fd64c8d2847270 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Fri, 4 Mar 2005 14:13:23 +0000 Subject: [PATCH] Parametrized test output dir and added Makefile git-svn-id: http://svn.osgeo.org/postgis/trunk@1478 b70326c6-7e19-0410-871a-916f4a2858ee --- regress/Makefile | 21 +++++++++++++++++++++ regress/run_index_regress | 8 ++++++-- regress/run_lwgeom_regress | 8 ++++++-- regress/run_ogc_regress | 8 ++++++-- regress/run_regress | 8 ++++++-- 5 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 regress/Makefile diff --git a/regress/Makefile b/regress/Makefile new file mode 100644 index 000000000..77270e253 --- /dev/null +++ b/regress/Makefile @@ -0,0 +1,21 @@ +TMPDIR?=/tmp + +test: test-common test-index test-lwgeom test-ogc + +test-lwgeom: + @./run_lwgeom_regress + +test-common: + @./run_regress + +test-index: + @./run_index_regress + +test-ogc: + @./run_ogc_regress + +clean: + rm -f $(TMPDIR)/regress_out + rm -f $(TMPDIR)/lwgeom_regress_out + rm -f $(TMPDIR)/regress_index_out + rm -f $(TMPDIR)/regress_ogc_out diff --git a/regress/run_index_regress b/regress/run_index_regress index 02b79a6af..0986ad571 100755 --- a/regress/run_index_regress +++ b/regress/run_index_regress @@ -5,11 +5,15 @@ echo "" echo "Index Creation will take some time..." echo "" +if [ -z "$TMPDIR" ]; then + TMPDIR=/tmp +fi + DB=postgis_reg createdb $DB > /dev/null createlang plpgsql $DB > /dev/null psql -f ../lwpostgis.sql $DB > /dev/null 2>&1 -psql -tA < regress_index.sql $DB > regress_index_out 2>&1 -diff regress_index_out regress_index_expected +psql -tA < regress_index.sql $DB > "${TMPDIR}/regress_index_out" 2>&1 +diff regress_index_expected "${TMPDIR}/regress_index_out" sleep 1 dropdb $DB > /dev/null diff --git a/regress/run_lwgeom_regress b/regress/run_lwgeom_regress index f1d59084b..ea0ca7a50 100755 --- a/regress/run_lwgeom_regress +++ b/regress/run_lwgeom_regress @@ -3,6 +3,10 @@ echo "Running LWGEOM Regression Test..." echo "" echo "Building a database for testing (postgis_reg)." +if [ -z "$TMPDIR" ]; then + TMPDIR=/tmp +fi + DB=postgis_reg createdb $DB > /dev/null @@ -15,7 +19,7 @@ psql -f ../lwpostgis.sql $DB > /dev/null 2>&1 echo "there shouldnt be any real output produced after this line." echo "" -psql -tA < lwgeom_regress.sql $DB 2>&1 | grep -v "^INSERT" > lwgeom_regress_out -diff lwgeom_regress_out lwgeom_regress_expected +psql -tA < lwgeom_regress.sql $DB 2>&1 | grep -v "^INSERT" > "${TMPDIR}/lwgeom_regress_out" +diff lwgeom_regress_expected "${TMPDIR}/lwgeom_regress_out" sleep 1 dropdb $DB > /dev/null diff --git a/regress/run_ogc_regress b/regress/run_ogc_regress index 15c53b859..a6320a454 100755 --- a/regress/run_ogc_regress +++ b/regress/run_ogc_regress @@ -4,11 +4,15 @@ echo echo " expected:'<' obtained:'>'" echo +if [ -z "$TMPDIR" ]; then + TMPDIR=/tmp +fi + DB=postgis_reg createdb $DB > /dev/null createlang plpgsql $DB > /dev/null psql -f ../lwpostgis.sql $DB > /dev/null 2>&1 -psql -tA < regress_ogc.sql $DB 2>&1 | grep -v INSERT > regress_ogc_out -diff regress_ogc_expected regress_ogc_out +psql -tA < regress_ogc.sql $DB 2>&1 | grep -v INSERT > "${TMPDIR}/regress_ogc_out" +diff regress_ogc_expected "${TMPDIR}/regress_ogc_out" sleep 1 dropdb $DB > /dev/null diff --git a/regress/run_regress b/regress/run_regress index f2b62dbf5..79220a23b 100755 --- a/regress/run_regress +++ b/regress/run_regress @@ -4,11 +4,15 @@ echo echo " expected:'<' obtained:'>'" echo +if [ -z "$TMPDIR" ]; then + TMPDIR=/tmp +fi + DB=postgis_reg createdb $DB > /dev/null createlang plpgsql $DB > /dev/null psql -f ../lwpostgis.sql $DB > /dev/null 2>&1 -psql -tA < regress.sql $DB 2>&1 | grep -v INSERT > regress_out -diff regress_expected regress_out +psql -tA < regress.sql $DB 2>&1 | grep -v INSERT > "${TMPDIR}/regress_out" +diff regress_expected "${TMPDIR}/regress_out" sleep 1 dropdb $DB > /dev/null -- 2.40.0