Parametrized test output dir and added Makefile

git-svn-id: http://svn.osgeo.org/postgis/trunk@1478 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Sandro Santilli 2005-03-04 14:13:23 +00:00
parent 18be19db54
commit 97af7875f7
5 changed files with 45 additions and 8 deletions

21
regress/Makefile Normal file
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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