File: test1.sh

package info (click to toggle)
shapelib 1.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,884 kB
  • sloc: ansic: 10,567; sh: 4,620; cpp: 752; makefile: 192; pascal: 159
file content (56 lines) | stat: -rwxr-xr-x 1,803 bytes parent folder | download | duplicates (2)
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
56
#!/bin/sh

set -eu

readonly SCRIPTDIR=$(dirname "$0")
readonly EXPECT="${1:-$SCRIPTDIR/expect1.out}"
readonly EG_DATA="${2:-$SCRIPTDIR/shape_eg_data}"

{
echo -------------------------------------------------------------------------
echo Test 1: dump anno.shp
echo -------------------------------------------------------------------------
"${SHPDUMP:-./shpdump}" "$EG_DATA/anno.shp" | head -250

echo -------------------------------------------------------------------------
echo Test 2: dump brklinz.shp
echo -------------------------------------------------------------------------
"${SHPDUMP:-./shpdump}" "$EG_DATA/brklinz.shp" | head -500

echo -------------------------------------------------------------------------
echo Test 3: dump polygon.shp
echo -------------------------------------------------------------------------
"${SHPDUMP:-./shpdump}" "$EG_DATA/polygon.shp" | head -500

echo -------------------------------------------------------------------------
echo Test 4: dump pline.dbf - uses new F field type
echo -------------------------------------------------------------------------
"${DBFDUMP:-./dbfdump}" -m -h "$EG_DATA/pline.dbf" | head -50

echo -------------------------------------------------------------------------
echo Test 5: NULL Shapes.
echo -------------------------------------------------------------------------
"${SHPDUMP:-./shpdump}" "$EG_DATA/csah.dbf" | head -150
} > s1.out


supports_strip_trailing_cr() {
	diff --help 2>/dev/null | grep -q -- '--strip-trailing-cr'
}

run_diff() {
	if supports_strip_trailing_cr; then
		diff --strip-trailing-cr "$EXPECT" "s1.out"
	else
		diff "$EXPECT" "s1.out"
	fi
}

if result=$(run_diff); then
	echo "******* Stream 1 Succeeded *********"
	exit 0
else
	echo "******* Stream 1 Failed *********"
	echo "$result"
	exit 1
fi