]> granicus.if.org Git - postgis/commitdiff
Parametrized test output dir and added Makefile
authorSandro Santilli <strk@keybit.net>
Fri, 4 Mar 2005 14:13:23 +0000 (14:13 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 4 Mar 2005 14:13:23 +0000 (14:13 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1478 b70326c6-7e19-0410-871a-916f4a2858ee

regress/Makefile [new file with mode: 0644]
regress/run_index_regress
regress/run_lwgeom_regress
regress/run_ogc_regress
regress/run_regress

diff --git a/regress/Makefile b/regress/Makefile
new file mode 100644 (file)
index 0000000..77270e2
--- /dev/null
@@ -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
index 02b79a6af2b22a399b4f08c4108d7aa0e4982579..0986ad571d2cc760824aca6ff59f512bf6d13555 100755 (executable)
@@ -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
index f1d59084b5b9b4450d77e236e76da98ce16d5b35..ea0ca7a501abc059d10d5e7757c311ee07a77ec0 100755 (executable)
@@ -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
index 15c53b859b0f2f8237dacf694f74bc056837033a..a6320a45426cadcf2b1fef4bb5aeb46df50664c2 100755 (executable)
@@ -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
index f2b62dbf59f249a1a0c5cbaaf1649678a36cbdf2..79220a23b62764b2b5cf36a70220bce162c1e188 100755 (executable)
@@ -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