diff options
| author | Even Rouault <even.rouault@mines-paris.org> | 2018-08-13 12:27:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-13 12:27:10 +0200 |
| commit | 88c20884fd948f8bcf958fa73026ae67efc1a2f4 (patch) | |
| tree | ec5463f56c18ff4e11cb7a5589d67d1e67dff36b | |
| parent | 666efb98088c007fc297e8cbd0648367bd62c014 (diff) | |
| parent | 053541430976621fe327a2e8b036534c97beac31 (diff) | |
| download | PROJ-88c20884fd948f8bcf958fa73026ae67efc1a2f4.tar.gz PROJ-88c20884fd948f8bcf958fa73026ae67efc1a2f4.zip | |
Merge pull request #1088 from rouault/simplify_travis_builds
Assorted fixes: Makefile, tests, gie enhancement, Travis-CI simplification
| -rw-r--r-- | docs/source/apps/gie.rst | 8 | ||||
| -rw-r--r-- | nad/Makefile.am | 2 | ||||
| -rw-r--r-- | src/gie.c | 24 | ||||
| -rw-r--r-- | test/gie/DHDN_ETRS89.gie | 3 | ||||
| -rw-r--r-- | test/gie/Makefile.am | 2 | ||||
| -rwxr-xr-x | travis/install.sh | 29 |
6 files changed, 50 insertions, 18 deletions
diff --git a/docs/source/apps/gie.rst b/docs/source/apps/gie.rst index fac4898a..8cbd2336 100644 --- a/docs/source/apps/gie.rst +++ b/docs/source/apps/gie.rst @@ -275,6 +275,14 @@ gie command language See ``gie -l`` for a list of error codes that can be ignored. +.. option:: require_grid <grid_name> + + Checks the availability of the grid <grid_name>. If it is not found, then + all :option:`accept`/:option:`expect` pairs until the next + :option:`operation` will be skipped. + :option:`require_grid` can be repeated several times to specify several grids whose + presence is required. + .. option:: echo <text> Add user defined text to the output stream. See the example below. diff --git a/nad/Makefile.am b/nad/Makefile.am index 2126c838..1f3dce7d 100644 --- a/nad/Makefile.am +++ b/nad/Makefile.am @@ -24,7 +24,7 @@ EXTRA_DIST = GL27 nad.lst proj_def.dat nad27 nad83 pj_out27.dist pj_out83.dist t esri.extra other.extra \ CH IGNF testIGNF proj_outIGNF.dist \ ITRF2000 ITRF2008 ITRF2014 \ - makefile.vc CMakeLists.txt tests/test_nodata.gtx + makefile.vc CMakeLists.txt tests/test_nodata.gtx null.lla process-nad2bin: @if [ -f $(NADPATH)/null.lla -a ! -f null ] || [ -f $(NADPATH)/conus.lla -a ! -f conus ] ; then \ @@ -149,7 +149,7 @@ static ffio *ffio_create (const char **tags, size_t n_tags, size_t max_record_si static const char *gie_tags[] = { "<gie>", "operation", "accept", "expect", "roundtrip", "banner", "verbose", - "direction", "tolerance", "ignore", "builtins", "echo", "skip", "</gie>" + "direction", "tolerance", "ignore", "require_grid", "builtins", "echo", "skip", "</gie>" }; static const size_t n_gie_tags = sizeof gie_tags / sizeof gie_tags[0]; @@ -187,6 +187,7 @@ typedef struct { size_t dimensions_given, dimensions_given_at_last_accept; double tolerance; int ignore; + int skip_test; const char *curr_file; FILE *fout; } gie_ctx; @@ -516,6 +517,20 @@ static int ignore (const char *args) { return 0; } +static int require_grid (const char *args) { + PJ_GRID_INFO grid_info; + const char* grid_filename = column (args, 1); + grid_info = proj_grid_info(grid_filename); + if( strlen(grid_info.filename) == 0 ) { + if (T.verbosity > 1) { + fprintf (T.fout, "Test skipped because of missing grid %s\n", + grid_filename); + } + T.skip_test = 1; + } + return 0; +} + static int direction (const char *args) { const char *endp = args; while (isspace (*endp)) @@ -571,6 +586,7 @@ either a conversion or a transformation) T.op_ok = 0; T.op_ko = 0; T.op_skip = 0; + T.skip_test = 0; direction ("forward"); tolerance ("0.5 mm"); @@ -1034,6 +1050,11 @@ static int dispatch (const char *cmnd, const char *args) { if (T.skip) return SKIP; if (0==strcmp (cmnd, "operation")) return operation ((char *) args); + if (T.skip_test) + { + if (0==strcmp (cmnd, "expect")) return another_skip(); + return 0; + } if (0==strcmp (cmnd, "accept")) return accept (args); if (0==strcmp (cmnd, "expect")) return expect (args); if (0==strcmp (cmnd, "roundtrip")) return roundtrip (args); @@ -1042,6 +1063,7 @@ static int dispatch (const char *cmnd, const char *args) { if (0==strcmp (cmnd, "direction")) return direction (args); if (0==strcmp (cmnd, "tolerance")) return tolerance (args); if (0==strcmp (cmnd, "ignore")) return ignore (args); + if (0==strcmp (cmnd, "require_grid")) return require_grid (args); if (0==strcmp (cmnd, "builtins")) return builtins (args); if (0==strcmp (cmnd, "echo")) return echo (args); if (0==strcmp (cmnd, "skip")) return skip (args); diff --git a/test/gie/DHDN_ETRS89.gie b/test/gie/DHDN_ETRS89.gie index f536821b..a1471a74 100644 --- a/test/gie/DHDN_ETRS89.gie +++ b/test/gie/DHDN_ETRS89.gie @@ -6,6 +6,7 @@ operation proj=latlong datum=potsdam ellps=bessel DE_DHDN (BeTA, 2007) to ETRS89 using NTv2 grid. epsg:15948 ------------------------------------------------------------------------------- +require_grid BETA2007.gsb tolerance 1 mm accept 7.482506019176 53.498461143331 # ETRS89_Lat-Lon expect 7.483333333333 53.500000000000 # DE_DHDN_Lat-Lon @@ -85,6 +86,8 @@ operation proj=latlong DE_DHDN to ETRS89 using deprecated 7 parameter Helmert transform. The results agree at the 3 m level. ------------------------------------------------------------------------------- + +require_grid BETA2007.gsb tolerance 3 m accept 7.482506019176 53.498461143331 # ETRS89_Lat-Lon diff --git a/test/gie/Makefile.am b/test/gie/Makefile.am index 7b1dc376..102f5a12 100644 --- a/test/gie/Makefile.am +++ b/test/gie/Makefile.am @@ -37,7 +37,7 @@ more_builtins: more_builtins.gie unitconvert: unitconvert.gie PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< -DHDN_ETRS89: +DHDN_ETRS89: DHDN_ETRS89.gie PROJ_LIB=$(PROJ_LIB) $(GIEEXE) $< check-local: 4D-API-cs2cs-style GDA axisswap builtins deformation ellipsoid more_builtins unitconvert DHDN_ETRS89 diff --git a/travis/install.sh b/travis/install.sh index ed7822a7..714d21ed 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -2,13 +2,8 @@ set -e -# Download grid files to nad/ +# Download grid files wget http://download.osgeo.org/proj/proj-datumgrid-1.7.zip -cd nad -unzip -o ../proj-datumgrid-1.7.zip -GRIDDIR=`pwd` -echo $GRIDDIR -cd .. # prepare build files ./autogen.sh @@ -30,7 +25,9 @@ cd build_autoconf ../configure --prefix=/tmp/proj_autoconf_install_from_dist_all make -j3 make install -PROJ_LIB=$GRIDDIR make check +# We have a small issue with out-of-tree builds where the null file is generated in the build directory, but other non-generated stuff is in $(top_srcdir)/nad +# Workaround this by using the install directory... +PROJ_LIB=/tmp/proj_autoconf_install_from_dist_all/share/proj make check find /tmp/proj_autoconf_install_from_dist_all cd .. @@ -40,21 +37,22 @@ cd build_cmake cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/proj_cmake_install make -j3 make install -PROJ_LIB=$GRIDDIR ctest +# The cmake build is not able to generate the null file, so copy it at hand +cp /tmp/proj_autoconf_install_from_dist_all/share/proj/null /tmp/proj_cmake_install/share/proj +PROJ_LIB=/tmp/proj_cmake_install/share/proj ctest find /tmp/proj_cmake_install cd .. # return to root cd ../.. -# cmake build with grids -mkdir build_cmake_nad -cd build_cmake_nad -cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/proj_cmake_install_nad -make -j3 -make install -find /tmp/proj_cmake_install_nad +# Install grid files +cd nad +unzip -o ../proj-datumgrid-1.7.zip +GRIDDIR=`pwd` +echo $GRIDDIR cd .. + # autoconf build with grids mkdir build_autoconf_nad cd build_autoconf_nad @@ -69,6 +67,7 @@ make test228 cd .. PROJ_LIB=../nad src/multistresstest cd .. + # autoconf build with grids and coverage if [ $TRAVIS_OS_NAME == "osx" ]; then CFLAGS="--coverage" ./configure; |
