File: inet_address.test

package info (click to toggle)
libassa 3.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,084 kB
  • ctags: 2,323
  • sloc: cpp: 15,641; sh: 8,704; makefile: 372; perl: 51
file content (71 lines) | stat: -rwxr-xr-x 1,320 bytes parent folder | download | duplicates (9)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
## -*- sh -*-
##
## inet_address.test - Testing class INETAddress
##
## $Id: inet_address.test,v 1.3 2006/07/20 02:30:56 vlg Exp $

# Common definitions

if test -z "$srcdir" ; then
    srcdir=`echo "$0" |  sed 's,[^/]*$,,'`
    test "$srcdir" = "$0" && srdir=.
    test -z "$srcdir" && srcdir=.
    test "${VERBOSE+set}" != set && VERBOSE=1
fi

. $srcdir/defs

# this is the output we should expect to see
cat <<\EOF >ok
= Running inet_address_test Test =
Test 1 ... ok
Test 2 ... ok
Test 3 ... ok
Test 4 ... ok
Test 5 ... ok
Test 6 ... ok
Test 7 ... ok
Test 8 ... ok
Test 9 ... ok
Test completed successfully!
EOF

# Unexpected output
cat <<\EOF >errok
EOF

# You can specify command-line arguments here
RUNTEST="${top_builddir}/tests/inet_address_test"

# Run test
$RUNTEST 2> err | tee -i out >&2

rm -f inet_address_test.log

# Test against expected output

if ${CMP} -s out ok; then
    :
else
    echo "ok:" >&2
    cat ok >&2
    exit 1
fi

# Mungle error output to remove leading directories, 'lt-' or
# trailing '.exe'

sed -e "s,^[^:]*[lt-]*inet_address_test[.ex]*:,inet_address_test;," err >sederr && mv sederr err

# Show stderr if doesn't match expected output if VERBOSE=1

if "$CMP" -s err errok; then
    :
else
    echo "err:" >&2
    cat err >&2
    echo "errok:" >&2
    cat errok >&2
    exit 1
fi