aboutsummaryrefslogtreecommitdiff
path: root/test/cli/testinvproj
blob: 878fd1181ad4ddd416e6e12f284c0e81211a3982 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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