From: Paul Ramsey Date: Wed, 16 Mar 2011 19:16:00 +0000 (+0000) Subject: Jeff Adams: Only automatically run -D tests if no custom parameters have been set. X-Git-Tag: 2.0.0alpha1~1890 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5138704f4c6029d9935a640189de1a554f75cf51;p=postgis Jeff Adams: Only automatically run -D tests if no custom parameters have been set. git-svn-id: http://svn.osgeo.org/postgis/trunk@6912 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/regress/run_test b/regress/run_test index 5b215da34..3efe5d3ef 100755 --- a/regress/run_test +++ b/regress/run_test @@ -255,36 +255,38 @@ run_loader_test () # - # Run in HEXWKB dump mode + # Test in HEXWKB dump mode for all "normal" (no custom parameters) test cases. + # Some custom parameters can be incompatible with -D. # + if [ -z "$_custom_opts" ]; then + show_progress - show_progress - - ${SHP2PGSQL} -g the_geom -D ${TEST}.shp $_tblname \ - > ${TMPDIR}/loader \ - 2> ${TMPDIR}/loader.err + ${SHP2PGSQL} -g the_geom -D ${TEST}.shp $_tblname \ + > ${TMPDIR}/loader \ + 2> ${TMPDIR}/loader.err - if [ $? -gt 0 ]; then - fail "running shp2pgsql -D" "${TMPDIR}/loader.err" - return 1 + if [ $? -gt 0 ]; then + fail "running shp2pgsql -D" "${TMPDIR}/loader.err" + return 1 - fi + fi - show_progress + show_progress - ${PSQL} -c "DROP table ${_tblname}" "${DB}" >> ${TMPDIR}/regress_log 2>&1 - ${PSQL} ${_psql_opts} -f ${TMPDIR}/loader "${DB}" > ${TMPDIR}/loader.err 2>&1 - if [ $? -gt 0 ]; then - fail "sourcing shp2pgsql -D output" "${TMPDIR}/loader.err" - return 1 - fi - - if [ -f "${TEST}-wkb.sql" ]; then - if run_simple_test ${TEST}-wkb.sql ${TEST}-wkb.expected "wkb dump"; then - : - else + ${PSQL} -c "DROP table ${_tblname}" "${DB}" >> ${TMPDIR}/regress_log 2>&1 + ${PSQL} ${_psql_opts} -f ${TMPDIR}/loader "${DB}" > ${TMPDIR}/loader.err 2>&1 + if [ $? -gt 0 ]; then + fail "sourcing shp2pgsql -D output" "${TMPDIR}/loader.err" return 1 fi + + if [ -f "${TEST}-wkb.sql" ]; then + if run_simple_test ${TEST}-wkb.sql ${TEST}-wkb.expected "wkb dump"; then + : + else + return 1 + fi + fi fi ########################################################### @@ -338,7 +340,7 @@ run_loader_test () show_progress - ${SHP2PGSQL} -g the_geom -w ${TEST}.shp $_tblname \ + ${SHP2PGSQL} $_custom_opts -g the_geom -w ${TEST}.shp $_tblname \ > ${TMPDIR}/loader \ 2> ${TMPDIR}/loader.err @@ -365,36 +367,39 @@ run_loader_test () fi # - # Run in WKT dump mode + # Test in WKT dump mode for all "normal" (no custom parameters) test cases. + # Some custom parameters can be incompatible with -D. # + if [ -z "$_custom_opts" ]; then - show_progress - - ${SHP2PGSQL} -g the_geom -D -w ${TEST}.shp $_tblname \ - > ${TMPDIR}/loader \ - 2> ${TMPDIR}/loader.err + show_progress - if [ $? -gt 0 ]; then - fail "running shp2pgsql -D -w" "${TMPDIR}/loader.err" - return 1 + ${SHP2PGSQL} -g the_geom -D -w ${TEST}.shp $_tblname \ + > ${TMPDIR}/loader \ + 2> ${TMPDIR}/loader.err - fi + if [ $? -gt 0 ]; then + fail "running shp2pgsql -D -w" "${TMPDIR}/loader.err" + return 1 - show_progress + fi - ${PSQL} -c "DROP table ${_tblname}" "${DB}" >> ${TMPDIR}/regress_log 2>&1 - ${PSQL} ${_psql_opts} -f ${TMPDIR}/loader "${DB}" > ${TMPDIR}/loader.err 2>&1 - if [ $? -gt 0 ]; then - fail "sourcing shp2pgsql -D -w output" "${TMPDIR}/loader.err" - return 1 - fi + show_progress - if [ -f "${TEST}-wkt.sql" ]; then - if run_simple_test ${TEST}-wkt.sql ${TEST}-wkt.expected "wkt dump"; then - : - else + ${PSQL} -c "DROP table ${_tblname}" "${DB}" >> ${TMPDIR}/regress_log 2>&1 + ${PSQL} ${_psql_opts} -f ${TMPDIR}/loader "${DB}" > ${TMPDIR}/loader.err 2>&1 + if [ $? -gt 0 ]; then + fail "sourcing shp2pgsql -D -w output" "${TMPDIR}/loader.err" return 1 fi + + if [ -f "${TEST}-wkt.sql" ]; then + if run_simple_test ${TEST}-wkt.sql ${TEST}-wkt.expected "wkt dump"; then + : + else + return 1 + fi + fi fi #rm ${TEST}.sql