maint.mk: Update system header list for #include syntax checks.
[gnulib.git] / tests / test-perror.sh
blobe6244413a0912470298845963a5ec7211c688f4b
1 #!/bin/sh
2 : "${srcdir=.}"
3 . "$srcdir/init.sh"; path_prepend_ .
5 # Test NULL prefix. Result should not contain a number, except in lines that
6 # start with 'EDC' (IBM z/OS libc produces an error identifier before the
7 # error message).
8 ${CHECKER} test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
9 grep -v '^EDC' t-perror.tmp | grep '[0-9]' > /dev/null \
10 && fail_ "result should not contain a number"
12 # Test empty prefix. Result should be the same.
13 ${CHECKER} test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp
14 diff t-perror.tmp t-perror1.tmp \
15 || fail_ "empty prefix should behave like NULL argument"
17 # Test non-empty prefix.
18 ${CHECKER} test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp
19 sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp
20 diff t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly"
22 # Test exit status.
23 ${CHECKER} test-perror >out 2>/dev/null || fail_ "unexpected exit status"
24 test -s out && fail_ "unexpected output"
26 Exit 0