diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-02-11 22:11:32 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-02-11 22:11:32 +0100 |
| commit | 593fcc4b57d0f5c3a46134add142ee8d9316aec6 (patch) | |
| tree | 7cc9927adb5f7eab6fd0851e71d2ba67a5d07d3b | |
| parent | dd1075784fecfbfa929787dbed271e876ca1693f (diff) | |
| download | PROJ-593fcc4b57d0f5c3a46134add142ee8d9316aec6.tar.gz PROJ-593fcc4b57d0f5c3a46134add142ee8d9316aec6.zip | |
test/cli/testcct: add minimalistic test of cct
| -rw-r--r-- | test/cli/Makefile.am | 9 | ||||
| -rwxr-xr-x | test/cli/testcct | 51 | ||||
| -rw-r--r-- | test/cli/testcct_out.dist | 3 |
3 files changed, 61 insertions, 2 deletions
diff --git a/test/cli/Makefile.am b/test/cli/Makefile.am index 50654968..9a8c7d5e 100644 --- a/test/cli/Makefile.am +++ b/test/cli/Makefile.am @@ -5,6 +5,7 @@ EXEPATH = ../../src PROJEXE = $(EXEPATH)/proj CS2CSEXE = $(EXEPATH)/cs2cs PROJINFOEXE = $(EXEPATH)/projinfo +CCTEXE = $(EXEPATH)/cct # PROJ.4 test scripts TEST27 = $(THIS_DIR)/test27 @@ -15,12 +16,13 @@ TESTFLAKY = $(THIS_DIR)/testflaky TESTDATUMFILE = $(THIS_DIR)/testdatumfile TESTIGN = $(THIS_DIR)/testIGNF TESTPROJINFO = $(THIS_DIR)/testprojinfo +TESTCCT = $(THIS_DIR)/testcct EXTRA_DIST = pj_out27.dist pj_out83.dist td_out.dist \ test27 test83 tv_out.dist tf_out.dist \ testflaky testvarious testdatumfile testntv2 ntv2_out.dist \ testIGNF proj_outIGNF.dist \ - testprojinfo testprojinfo_out.dist \ + testprojinfo testprojinfo_out.dist testcct_out.dist \ CMakeLists.txt testprojinfo-check: @@ -50,4 +52,7 @@ testntv2-check: PROJ_LIB=$(DATAPATH) $(TESTNTV2) $(CS2CSEXE) ; \ fi -check-local: testprojinfo-check test27-check test83-check testvarious-check testdatumfile-check testign-check testntv2-check +testcct-check: + PROJ_LIB=$(DATAPATH) $(TESTCCT) $(CCTEXT) + +check-local: testprojinfo-check test27-check test83-check testvarious-check testdatumfile-check testign-check testntv2-check testcct-check diff --git a/test/cli/testcct b/test/cli/testcct new file mode 100755 index 00000000..93749052 --- /dev/null +++ b/test/cli/testcct @@ -0,0 +1,51 @@ +: +# Test cct + +TEST_CLI_DIR=`dirname $0` +DATA_DIR=`dirname $0`/../../data +EXE=$1 + +usage() +{ + echo "Usage: ${0} <path to 'cct' program>" + echo + exit 1 +} + +if test -z "${EXE}"; then + EXE=../../src/cct +fi + +if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + +OUT=testcct_out + +rm -f ${OUT} + +echo "Testing cct -d 8 +proj=merc +R=1" >> ${OUT} +echo "90 45" 0 | $EXE -d 8 +proj=merc +R=1 >>${OUT} +echo "" >>${OUT} + +# do 'diff' with distribution results +echo "diff ${OUT} with testcct_out.dist" +diff -u ${OUT} ${TEST_CLI_DIR}/testcct_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/testcct_out.dist b/test/cli/testcct_out.dist new file mode 100644 index 00000000..44dd6964 --- /dev/null +++ b/test/cli/testcct_out.dist @@ -0,0 +1,3 @@ +Testing cct -d 8 +proj=merc +R=1 + 1.57079633 0.88137359 0.00000000 inf + |
