| 1 |
#!/bin/sh |
| 2 |
# Test of the 'error' module. |
| 3 |
|
| 4 |
. "${srcdir=.}/init.sh"; path_prepend_ . |
| 5 |
|
| 6 |
${CHECKER} test-error${EXEEXT} > out 2> err |
| 7 |
# Verify the exit code. |
| 8 |
case $? in |
| 9 |
4) ;; |
| 10 |
*) Exit 1;; |
| 11 |
esac |
| 12 |
|
| 13 |
# Normalize the stderr output on Windows platforms. |
| 14 |
tr -d '\015' < err | sed 's,.*test-error[.ex]*:,test-error:,' > err2 || Exit 1 |
| 15 |
|
| 16 |
# Verify the stderr output. |
| 17 |
compare - err2 <<\EOF || Exit 1 |
| 18 |
test-error: bummer |
| 19 |
test-error: Zonk 123 is too large |
| 20 |
test-error: Pokémon started |
| 21 |
test-error:d1/foo.c:10: invalid blub |
| 22 |
test-error:d1/foo.c:10: invalid blarn |
| 23 |
test-error:d1/foo.c:10: unsupported glink |
| 24 |
test-error:d1/foo.c:13: invalid brump |
| 25 |
test-error:d2/foo.c:13: unsupported flinge |
| 26 |
hammer |
| 27 |
boing 123 is too large |
| 28 |
d2/bar.c:11: bark too loud |
| 29 |
test-error: can't steal: Permission denied |
| 30 |
test-error: fatal error |
| 31 |
EOF |
| 32 |
|
| 33 |
# Verify the stdout output. |
| 34 |
test -s out && Exit 1 |
| 35 |
|
| 36 |
Exit 0 |