aboutsummaryrefslogtreecommitdiff
path: root/test/cli
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-10-09 18:54:54 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-10-09 20:32:31 +0200
commita159c44f35e58334646d3c8653acc86665c55cca (patch)
treeea37740b95c92cf44d5f586128bbd5972e7f92c1 /test/cli
parent42c453973f13574cde679092ff2a5986b74d667f (diff)
downloadPROJ-a159c44f35e58334646d3c8653acc86665c55cca.tar.gz
PROJ-a159c44f35e58334646d3c8653acc86665c55cca.zip
Add testing of invproj
Diffstat (limited to 'test/cli')
-rw-r--r--test/cli/CMakeLists.txt2
-rw-r--r--test/cli/Makefile.am8
-rwxr-xr-xtest/cli/testinvproj55
-rw-r--r--test/cli/testinvproj_out.dist1
4 files changed, 65 insertions, 1 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