aboutsummaryrefslogtreecommitdiff
path: root/test/cli/testinvproj
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-10-12 10:03:27 +0200
committerGitHub <noreply@github.com>2021-10-12 10:03:27 +0200
commit6a877010114b7ccc12d017989500fa5f12f9e39c (patch)
treec257d0e1296c2c6a874c750a0139983d6d3e41b3 /test/cli/testinvproj
parenta16ead184573933b128e419253c69418212df495 (diff)
parenta159c44f35e58334646d3c8653acc86665c55cca (diff)
downloadPROJ-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/cli/testinvproj')
-rwxr-xr-xtest/cli/testinvproj55
1 files changed, 55 insertions, 0 deletions
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