From 6e6090e292713b3ae4bd15bc0fa30bb81ad1bd9c Mon Sep 17 00:00:00 2001 From: Mateusz Loskot Date: Fri, 13 Oct 2006 18:46:27 +0000 Subject: Added 'make check' target to run tests. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1355 4e78687f-474d-0410-85f9-8d5e500ac6b2 --- nad/Makefile.am | 22 ++++++++++++++++++---- nad/test27 | 27 +++++++++++++++++++++++++-- nad/test83 | 26 +++++++++++++++++++++++++- nad/testntv2 | 30 +++++++++++++++++++++++++++++- nad/testvarious | 27 ++++++++++++++++++++++++++- 5 files changed, 123 insertions(+), 9 deletions(-) diff --git a/nad/Makefile.am b/nad/Makefile.am index 00f65136..bc337a81 100644 --- a/nad/Makefile.am +++ b/nad/Makefile.am @@ -1,3 +1,14 @@ +# Executables paths passed to test scripts +EXEPATH = $(top_srcdir)/src +PROJEXE = $(EXEPATH)/proj +CS2CSEXE = $(EXEPATH)/cs2cs + +# PROJ.4 test scripts +TEST27 = ./test27 +TEST83 = ./test83 +TESTNTV2 = ./testntv2 +TESTVARIOUS = ./testvarious + pkgdata_DATA = GL27 nad.lst nad27 nad83 proj_def.dat world epsg esri \ esri.extra other.extra @@ -28,8 +39,11 @@ install-data-local: fi; \ done +check-local: + $(TEST27) $(PROJEXE) + $(TEST83) $(PROJEXE) + $(TESTNTV2) $(CS2CSEXE) + $(TESTVARIOUS) $(CS2CSEXE) -test: - ./test27 - ./test83 - ./testvarious +clean-local: + $(RM) $(TEST_DB) diff --git a/nad/test27 b/nad/test27 index 3774116c..cd25621d 100755 --- a/nad/test27 +++ b/nad/test27 @@ -1,14 +1,35 @@ : # Script to test most of the SPCS zones. -# # This script generated from execution of NMD's program l176, where # the second pair of numbers are respective easting and northing output. # # Proj will vary in the .001ft range with projections using Transverse # Mercator due to greater precision of meridinal distance function. # +EXE=$1 + +usage() +{ + echo "Usage: ${0} " + echo + exit 1 +} + +if test -z "${EXE}"; then + echo "*** ERROR: Missing path to 'proj' program." + usage +else + if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 + fi +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + OUT=proj_out27 -EXE=../src/proj INIT_FILE=./nad27 # echo "doing tests into file ${OUT}, please wait" @@ -816,10 +837,12 @@ if [ $? -ne 0 ] ; then echo "" echo "PROBLEMS HAVE OCCURED" 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/nad/test83 b/nad/test83 index 6465c183..2927dc76 100755 --- a/nad/test83 +++ b/nad/test83 @@ -7,8 +7,30 @@ # Proj will vary in the .001ft range with projections using Transverse # Mercator due to greater precision of meridinal distance function. # +EXE=$1 + +usage() +{ + echo "Usage: ${0} " + echo + exit 1 +} + +if test -z "${EXE}"; then + echo "*** ERROR: Missing path to 'proj' program." + usage +else + if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 + fi +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + OUT=proj_out83 -EXE=../src/proj INIT_FILE=./nad83 # echo "doing tests into file ${OUT}, please wait" @@ -696,10 +718,12 @@ if [ $? -ne 0 ] ; then echo "" echo "PROBLEMS HAVE OCCURED" 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/nad/testntv2 b/nad/testntv2 index 307f8141..096f4bbb 100755 --- a/nad/testntv2 +++ b/nad/testntv2 @@ -3,8 +3,31 @@ # Test NTv2 (.gsb) support. Assumes ntv2_0.gsb is installed. # # +EXE=$1 + +usage() +{ + echo "Usage: ${0} " + echo + exit 1 +} + +if test -z "${EXE}"; then + echo "*** ERROR: Missing path to 'cs2cs' program." + usage +else + if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 + fi +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + OUT=ntv2_out -EXE=../src/cs2cs +#EXE=../src/cs2cs # echo "doing tests into file ${OUT}, please wait" rm -f ${OUT} @@ -39,8 +62,13 @@ if [ $? -ne 0 ] ; then echo "" echo "PROBLEMS HAVE OCCURED" 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/nad/testvarious b/nad/testvarious index 53d36cc5..29eac6ed 100755 --- a/nad/testvarious +++ b/nad/testvarious @@ -2,8 +2,31 @@ # Script to do some testing of various transformation. # # +EXE=$1 + +usage() +{ + echo "Usage: ${0} " + echo + exit 1 +} + +if test -z "${EXE}"; then + echo "*** ERROR: Missing path to 'cs2cs' program." + usage +else + if test ! -x ${EXE}; then + echo "*** ERROR: Can not find '${EXE}' program!" + exit 1 + fi +fi + +echo "============================================" +echo "Running ${0} using ${EXE}:" +echo "============================================" + OUT=td_out -EXE=../src/cs2cs +#EXE=../src/cs2cs # echo "doing tests into file ${OUT}, please wait" rm -f ${OUT} @@ -150,10 +173,12 @@ if [ $? -ne 0 ] ; then echo "" echo "PROBLEMS HAVE OCCURED" 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 -- cgit v1.2.3