]> granicus.if.org Git - postgis/commitdiff
Jeff Adams new testing of loader with cmd line options.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 16 Mar 2011 14:06:54 +0000 (14:06 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 16 Mar 2011 14:06:54 +0000 (14:06 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@6907 b70326c6-7e19-0410-871a-916f4a2858ee

26 files changed:
regress/loader/README
regress/loader/TSIPolygon-wkb.expected [new file with mode: 0644]
regress/loader/TSIPolygon-wkb.sql [new file with mode: 0644]
regress/loader/TSIPolygon-wkt.expected [new file with mode: 0644]
regress/loader/TSIPolygon-wkt.sql [new file with mode: 0644]
regress/loader/TSIPolygon.dbf [new file with mode: 0644]
regress/loader/TSIPolygon.opts [new file with mode: 0644]
regress/loader/TSIPolygon.shp [new file with mode: 0644]
regress/loader/TSIPolygon.shx [new file with mode: 0644]
regress/loader/TSTIPolygon-wkb.expected [new file with mode: 0644]
regress/loader/TSTIPolygon-wkb.sql [new file with mode: 0644]
regress/loader/TSTIPolygon-wkt.expected [new file with mode: 0644]
regress/loader/TSTIPolygon-wkt.sql [new file with mode: 0644]
regress/loader/TSTIPolygon.dbf [new file with mode: 0644]
regress/loader/TSTIPolygon.opts [new file with mode: 0644]
regress/loader/TSTIPolygon.shp [new file with mode: 0644]
regress/loader/TSTIPolygon.shx [new file with mode: 0644]
regress/loader/TSTPolygon-wkb.expected [new file with mode: 0644]
regress/loader/TSTPolygon-wkb.sql [new file with mode: 0644]
regress/loader/TSTPolygon-wkt.expected [new file with mode: 0644]
regress/loader/TSTPolygon-wkt.sql [new file with mode: 0644]
regress/loader/TSTPolygon.dbf [new file with mode: 0644]
regress/loader/TSTPolygon.opts [new file with mode: 0644]
regress/loader/TSTPolygon.shp [new file with mode: 0644]
regress/loader/TSTPolygon.shx [new file with mode: 0644]
regress/run_test

index 86bd83f9d3ef0a5c08a66fb932583862d228b97c..e9d2060413113464233af0793f3dcd0a9a5a55db 100644 (file)
@@ -11,3 +11,9 @@ We need two separate tests for WKB and WKT as the WKT mode will not support M va
 Also, the tester script will dump the WKB loaded table and compare the resulting
 shapefile with the original one (only .shp, .dbf is not compared as field sizes are not
 retained, we might use a dbf viewer for that, but that's not currently implemented)
+
+Optional:
+  You may provide a <name>.opts file to set custom command line options for shp2pgsql.
+  The first line that does not begin with a # is used.
+
+  Also see ../README for a description of optional setup/teardown script files.
diff --git a/regress/loader/TSIPolygon-wkb.expected b/regress/loader/TSIPolygon-wkb.expected
new file mode 100644 (file)
index 0000000..1f4a60b
--- /dev/null
@@ -0,0 +1 @@
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
diff --git a/regress/loader/TSIPolygon-wkb.sql b/regress/loader/TSIPolygon-wkb.sql
new file mode 100644 (file)
index 0000000..e680818
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(the_geom) from loadedshp;
+
diff --git a/regress/loader/TSIPolygon-wkt.expected b/regress/loader/TSIPolygon-wkt.expected
new file mode 100644 (file)
index 0000000..1f4a60b
--- /dev/null
@@ -0,0 +1 @@
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
diff --git a/regress/loader/TSIPolygon-wkt.sql b/regress/loader/TSIPolygon-wkt.sql
new file mode 100644 (file)
index 0000000..e680818
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(the_geom) from loadedshp;
+
diff --git a/regress/loader/TSIPolygon.dbf b/regress/loader/TSIPolygon.dbf
new file mode 100644 (file)
index 0000000..13b4aee
Binary files /dev/null and b/regress/loader/TSIPolygon.dbf differ
diff --git a/regress/loader/TSIPolygon.opts b/regress/loader/TSIPolygon.opts
new file mode 100644 (file)
index 0000000..c3c86db
--- /dev/null
@@ -0,0 +1,6 @@
+# You cannot create a test tablespace because tablespaces need to be directories that
+# are owned by the postgres user, which is rarely the same as the user running the test,
+# and you can't chown without sudo, so we gave up on trying to have a test that proves
+# the -T and -X parameters work.  However we can at least test that they don't cause
+# any problems, which is what this test is for.
+-X pg_default
diff --git a/regress/loader/TSIPolygon.shp b/regress/loader/TSIPolygon.shp
new file mode 100644 (file)
index 0000000..997b43f
Binary files /dev/null and b/regress/loader/TSIPolygon.shp differ
diff --git a/regress/loader/TSIPolygon.shx b/regress/loader/TSIPolygon.shx
new file mode 100644 (file)
index 0000000..c16ea0a
Binary files /dev/null and b/regress/loader/TSIPolygon.shx differ
diff --git a/regress/loader/TSTIPolygon-wkb.expected b/regress/loader/TSTIPolygon-wkb.expected
new file mode 100644 (file)
index 0000000..1f4a60b
--- /dev/null
@@ -0,0 +1 @@
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
diff --git a/regress/loader/TSTIPolygon-wkb.sql b/regress/loader/TSTIPolygon-wkb.sql
new file mode 100644 (file)
index 0000000..e680818
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(the_geom) from loadedshp;
+
diff --git a/regress/loader/TSTIPolygon-wkt.expected b/regress/loader/TSTIPolygon-wkt.expected
new file mode 100644 (file)
index 0000000..1f4a60b
--- /dev/null
@@ -0,0 +1 @@
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
diff --git a/regress/loader/TSTIPolygon-wkt.sql b/regress/loader/TSTIPolygon-wkt.sql
new file mode 100644 (file)
index 0000000..e680818
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(the_geom) from loadedshp;
+
diff --git a/regress/loader/TSTIPolygon.dbf b/regress/loader/TSTIPolygon.dbf
new file mode 100644 (file)
index 0000000..13b4aee
Binary files /dev/null and b/regress/loader/TSTIPolygon.dbf differ
diff --git a/regress/loader/TSTIPolygon.opts b/regress/loader/TSTIPolygon.opts
new file mode 100644 (file)
index 0000000..2ae1438
--- /dev/null
@@ -0,0 +1,6 @@
+# You cannot create a test tablespace because tablespaces need to be directories that
+# are owned by the postgres user, which is rarely the same as the user running the test,
+# and you can't chown without sudo, so we gave up on trying to have a test that proves
+# the -T and -X parameters work.  However we can at least test that they don't cause
+# any problems, which is what this test is for.
+-T pg_default -X pg_default
diff --git a/regress/loader/TSTIPolygon.shp b/regress/loader/TSTIPolygon.shp
new file mode 100644 (file)
index 0000000..997b43f
Binary files /dev/null and b/regress/loader/TSTIPolygon.shp differ
diff --git a/regress/loader/TSTIPolygon.shx b/regress/loader/TSTIPolygon.shx
new file mode 100644 (file)
index 0000000..c16ea0a
Binary files /dev/null and b/regress/loader/TSTIPolygon.shx differ
diff --git a/regress/loader/TSTPolygon-wkb.expected b/regress/loader/TSTPolygon-wkb.expected
new file mode 100644 (file)
index 0000000..1f4a60b
--- /dev/null
@@ -0,0 +1 @@
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
diff --git a/regress/loader/TSTPolygon-wkb.sql b/regress/loader/TSTPolygon-wkb.sql
new file mode 100644 (file)
index 0000000..e680818
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(the_geom) from loadedshp;
+
diff --git a/regress/loader/TSTPolygon-wkt.expected b/regress/loader/TSTPolygon-wkt.expected
new file mode 100644 (file)
index 0000000..1f4a60b
--- /dev/null
@@ -0,0 +1 @@
+MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0),(5 5,8 5,8 8,5 8,5 5)),((-1 -1,-1 -10,-10 -10,-10 -1,-1 -1),(-5 -5,-8 -5,-8 -8,-5 -8,-5 -5)))
diff --git a/regress/loader/TSTPolygon-wkt.sql b/regress/loader/TSTPolygon-wkt.sql
new file mode 100644 (file)
index 0000000..e680818
--- /dev/null
@@ -0,0 +1,2 @@
+select ST_Asewkt(the_geom) from loadedshp;
+
diff --git a/regress/loader/TSTPolygon.dbf b/regress/loader/TSTPolygon.dbf
new file mode 100644 (file)
index 0000000..13b4aee
Binary files /dev/null and b/regress/loader/TSTPolygon.dbf differ
diff --git a/regress/loader/TSTPolygon.opts b/regress/loader/TSTPolygon.opts
new file mode 100644 (file)
index 0000000..d3b7053
--- /dev/null
@@ -0,0 +1,6 @@
+# You cannot create a test tablespace because tablespaces need to be directories that
+# are owned by the postgres user, which is rarely the same as the user running the test,
+# and you can't chown without sudo, so we gave up on trying to have a test that proves
+# the -T and -X parameters work.  However we can at least test that they don't cause
+# any problems, which is what this test is for.
+-T pg_default
diff --git a/regress/loader/TSTPolygon.shp b/regress/loader/TSTPolygon.shp
new file mode 100644 (file)
index 0000000..997b43f
Binary files /dev/null and b/regress/loader/TSTPolygon.shp differ
diff --git a/regress/loader/TSTPolygon.shx b/regress/loader/TSTPolygon.shx
new file mode 100644 (file)
index 0000000..c16ea0a
Binary files /dev/null and b/regress/loader/TSTPolygon.shx differ
index 67ec01a282cacadcfe25239e73142cb14fca72d0..5b215da342d99053fb4461dadc59048781dea0d1 100755 (executable)
@@ -210,6 +210,11 @@ run_loader_test ()
 
        #echo "SELECT * from ${_tblname}" > ${TEST}.sql
 
+       # See if there is a custom command-line options file
+       if [ -r ${TEST}.opts ]; then
+               _custom_opts=`grep -v -m1 ^\s*# ${TEST}.opts`
+       fi
+
 
        #
        # Run in HEXWKB insert mode
@@ -217,7 +222,7 @@ run_loader_test ()
 
        show_progress
 
-       ${SHP2PGSQL} -g the_geom ${TEST}.shp $_tblname \
+       ${SHP2PGSQL} $_custom_opts -g the_geom ${TEST}.shp $_tblname \
                > ${TMPDIR}/loader \
                2> ${TMPDIR}/loader.err