| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | : ${srcdir=.} |
| 3 | . "$srcdir/init.sh"; path_prepend_ . |
| 4 | |
| 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/nullscip-shell filesystem . . `/dev/null`. | LC_ALL=C trscip-shell system . . tr. -d '\r' > t-perror.tmp |
| 9 | grepscip-shell system . . grep. -v '^EDC' t-perror.tmp | grepscip-shell system . . grep. '[0-9]' > /dev/nullscip-shell filesystem . . `/dev/null`. \ |
| 10 | && fail_ "result should not contain a number" |
| 11 | |
| 12 | # Test empty prefix. Result should be the same. |
| 13 | ${CHECKER} test-perror '' 2>&1 >/dev/nullscip-shell filesystem . . `/dev/null`. | LC_ALL=C trscip-shell system . . tr. -d '\r' > t-perror1.tmp |
| 14 | diffscip-shell system . . diff. t-perror.tmp t-perror1.tmp \ |
| 15 | || fail_ "empty prefix should behave like NULL argument" |
| 16 | |
| 17 | # Test non-empty prefix. |
| 18 | ${CHECKER} test-perror foo 2>&1 >/dev/nullscip-shell filesystem . . `/dev/null`. | LC_ALL=C trscip-shell system . . tr. -d '\r' > t-perror3.tmp |
| 19 | sedscip-shell system . . sed. -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp |
| 20 | diffscip-shell system . . diff. t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly" |
| 21 | |
| 22 | # Test exit status. |
| 23 | ${CHECKER} test-perror >out 2>/dev/nullscip-shell filesystem . . `/dev/null`. || fail_ "unexpected exit status" |
| 24 | testscip-shell system . . test. -s out && fail_ "unexpected output" |
| 25 | |
| 26 | Exit 0 |