annotate tests/test-perror.sh @ 40231:9b3c79fdfe0b

strtod: fix clash with strtold Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817). * lib/strtod.c (compute_minus_zero, minus_zero): Simplify by remving the macro / external variable, and having just a function. User changed. This avoids the need for an external variable that might clash.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 11 Mar 2019 16:40:29 -0700
parents 8c1a17df67e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #!/bin/sh
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
2 : ${srcdir=.}
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
3 . "$srcdir/init.sh"; path_prepend_ .
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
18714
7a6575389402 perror tests: Tweak for z/OS.
Bruno Haible <bruno@clisp.org>
parents: 14813
diff changeset
5 # Test NULL prefix. Result should not contain a number, except in lines that
7a6575389402 perror tests: Tweak for z/OS.
Bruno Haible <bruno@clisp.org>
parents: 14813
diff changeset
6 # start with 'EDC' (IBM z/OS libc produces an error identifier before the
7a6575389402 perror tests: Tweak for z/OS.
Bruno Haible <bruno@clisp.org>
parents: 14813
diff changeset
7 # error message).
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 18714
diff changeset
8 ${CHECKER} test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
18714
7a6575389402 perror tests: Tweak for z/OS.
Bruno Haible <bruno@clisp.org>
parents: 14813
diff changeset
9 grep -v '^EDC' t-perror.tmp | grep '[0-9]' > /dev/null \
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
10 && fail_ "result should not contain a number"
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 # Test empty prefix. Result should be the same.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 18714
diff changeset
13 ${CHECKER} test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
14 diff t-perror.tmp t-perror1.tmp \
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
15 || fail_ "empty prefix should behave like NULL argument"
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 # Test non-empty prefix.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 18714
diff changeset
18 ${CHECKER} test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
20 diff t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly"
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
22 # Test exit status.
40221
8c1a17df67e0 tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents: 18714
diff changeset
23 ${CHECKER} test-perror >out 2>/dev/null || fail_ "unexpected exit status"
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
24 test -s out && fail_ "unexpected output"
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
25
14813
d9fdb6400ff8 perror: avoid spurious test failure on HP-UX
Eric Blake <eblake@redhat.com>
parents: 14776
diff changeset
26 Exit 0