diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-10-12 10:03:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-12 10:03:27 +0200 |
| commit | 6a877010114b7ccc12d017989500fa5f12f9e39c (patch) | |
| tree | c257d0e1296c2c6a874c750a0139983d6d3e41b3 /test | |
| parent | a16ead184573933b128e419253c69418212df495 (diff) | |
| parent | a159c44f35e58334646d3c8653acc86665c55cca (diff) | |
| download | PROJ-6a877010114b7ccc12d017989500fa5f12f9e39c.tar.gz PROJ-6a877010114b7ccc12d017989500fa5f12f9e39c.zip | |
Merge pull request #2897 from rouault/fix_2852
CMake build: generate invproj/invgeod binaries (symlinks on Unix, copy otherwise) (fixes #2852)
Diffstat (limited to 'test')
| -rw-r--r-- | test/cli/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | test/cli/Makefile.am | 8 | ||||
| -rwxr-xr-x | test/cli/testinvproj | 55 | ||||
| -rw-r--r-- | test/cli/testinvproj_out.dist | 1 | ||||
| -rwxr-xr-x | test/cli/testproj | 2 |
5 files changed, 66 insertions, 2 deletions
diff --git a/test/cli/CMakeLists.txt b/test/cli/CMakeLists.txt index 0f86ca3d..b136b05d 100644 --- a/test/cli/CMakeLists.txt +++ b/test/cli/CMakeLists.txt @@ -3,12 +3,14 @@ # set(CS2CS_BIN "cs2cs") set(PROJ_BIN "proj") +set(INVPROJ_BIN "invproj") set(PROJINFO_BIN "projinfo") set(CCT_BIN "cct") set(PROJSYNC_BIN "projsync") proj_add_test_script_sh("test27" PROJ_BIN) proj_add_test_script_sh("test83" PROJ_BIN) proj_add_test_script_sh("testproj" PROJ_BIN) +proj_add_test_script_sh("testinvproj" INVPROJ_BIN) proj_add_test_script_sh("testvarious" CS2CS_BIN) proj_add_test_script_sh("testdatumfile" CS2CS_BIN) proj_add_test_script_sh("testIGNF" CS2CS_BIN) diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 46d9d36c..bc840738 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -3,6 +3,7 @@ PROJ_LIB = ../../data/for_tests THIS_DIR = $(top_srcdir)/test/cli EXEPATH = ../../src PROJEXE = $(EXEPATH)/proj +INVPROJEXE = $(EXEPATH)/invproj CS2CSEXE = $(EXEPATH)/cs2cs PROJINFOEXE = $(EXEPATH)/projinfo CCTEXE = $(EXEPATH)/cct @@ -12,6 +13,7 @@ PROJSYNC_EXE = $(EXEPATH)/projsync TEST27 = $(THIS_DIR)/test27 TEST83 = $(THIS_DIR)/test83 TESTPROJ = $(THIS_DIR)/testproj +TESTINVPROJ = $(THIS_DIR)/testinvproj TESTNTV2 = $(THIS_DIR)/testntv2 TESTVARIOUS = $(THIS_DIR)/testvarious TESTFLAKY = $(THIS_DIR)/testflaky @@ -28,6 +30,7 @@ EXTRA_DIST = pj_out27.dist pj_out83.dist td_out.dist \ testprojinfo testprojinfo_out.dist \ testcct testcct_out.dist \ testproj testproj_out.dist \ + testinvproj testinvproj_out.dist \ test_projsync \ CMakeLists.txt @@ -43,6 +46,9 @@ test83-check: testproj-check: PROJ_LIB=$(PROJ_LIB) $(TESTPROJ) $(PROJEXE) +testinvproj-check: + PROJ_LIB=$(PROJ_LIB) $(TESTINVPROJ) $(INVPROJEXE) + testvarious-check: PROJ_SKIP_READ_USER_WRITABLE_DIRECTORY=YES PROJ_LIB=$(PROJ_LIB) $(TESTVARIOUS) $(CS2CSEXE) @@ -67,4 +73,4 @@ testprojsync-check: echo "Skipping testprojsync-check" endif -check-local: testprojinfo-check test27-check test83-check testproj-check testvarious-check testdatumfile-check testign-check testntv2-check testcct-check testprojsync-check +check-local: testprojinfo-check test27-check test83-check testproj-check testinvproj-check testvarious-check testdatumfile-check testign-check testntv2-check testcct-check testprojsync-check diff --git a/test/cli/testinvproj b/test/cli/testinvproj new file mode 100755 index 00000000..878fd118 --- /dev/null +++ b/test/cli/testinvproj @@ -0,0 +1,55 @@ +: +# Script to test invproj exe +# +TEST_CLI_DIR=`dirname $0` +EXE=$1 + +usage() +{ + echo "Usage: ${0} <path to 'invproj' program>" + echo + exit 1 +} + +if test -z "${EXE}"; then + EXE=../../src/invproj +fi + +if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 +fi + +if test -z "${PROJ_LIB}"; then + export PROJ_LIB="`dirname $0`/../../data" +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + +OUT=testinvproj_out +# +echo "doing tests into file ${OUT}, please wait" +# +$EXE +proj=tmerc +ellps=GRS80 -E -f '%.3f' >${OUT} <<EOF +146339.48 5431555.61 +EOF + +# +# do 'diff' with distribution results +echo "diff ${OUT} with testinvproj_out.dist" +diff -u -b ${OUT} ${TEST_CLI_DIR}/testinvproj_out.dist +if [ $? -ne 0 ] ; then + echo "" + echo "PROBLEMS HAVE OCCURRED" + echo "test file ${OUT} saved" + echo + exit 100 +else + echo "TEST OK" + echo "test file ${OUT} removed" + echo + /bin/rm -f ${OUT} + exit 0 +fi diff --git a/test/cli/testinvproj_out.dist b/test/cli/testinvproj_out.dist new file mode 100644 index 00000000..6b52306f --- /dev/null +++ b/test/cli/testinvproj_out.dist @@ -0,0 +1 @@ +146339.48 5431555.61 2.000 49.000 diff --git a/test/cli/testproj b/test/cli/testproj index 8686224e..d03932fb 100755 --- a/test/cli/testproj +++ b/test/cli/testproj @@ -12,7 +12,7 @@ usage() } if test -z "${EXE}"; then - EXE=../../src/cs2cs + EXE=../../src/proj fi if test ! -x ${EXE}; then |
