annotate tests/test-perror.sh @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents d9fdb6400ff8
children 7a6575389402
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
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 # Test NULL prefix. Result should not contain a number.
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
6 test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
7 grep '[0-9]' t-perror.tmp > /dev/null \
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
8 && fail_ "result should not contain a number"
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 # Test empty prefix. Result should be the same.
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
11 test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
12 diff t-perror.tmp t-perror1.tmp \
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
13 || fail_ "empty prefix should behave like NULL argument"
10435
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
c3629eb821c3 Tests for module 'perror'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 # Test non-empty prefix.
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
16 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
17 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
18 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
19
14776
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
20 # Test exit status.
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
21 test-perror >out 2>/dev/null || fail_ "unexpected exit status"
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
22 test -s out && fail_ "unexpected output"
a3bd209aea02 test-perror: rewrite to use init script
Eric Blake <eblake@redhat.com>
parents: 10463
diff changeset
23
14813
d9fdb6400ff8 perror: avoid spurious test failure on HP-UX
Eric Blake <eblake@redhat.com>
parents: 14776
diff changeset
24 Exit 0