diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-12-21 14:22:22 +0000 |
---|---|---|
committer | Sam Thursfield <Sam Thursfield> | 2013-01-03 11:32:53 +0000 |
commit | c2693d6d08db26825688ddca5de6eb8a4b7cde4a (patch) | |
tree | 10611dcf065b1893421b83a9de53cf6feb83a048 /tests/test-verify.sh | |
parent | 861325a84f231a2a2da307b53ef5ff527d67e876 (diff) | |
download | m4-c2693d6d08db26825688ddca5de6eb8a4b7cde4a.tar.gz |
Commit files from tarball
Diffstat (limited to 'tests/test-verify.sh')
-rwxr-xr-x | tests/test-verify.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test-verify.sh b/tests/test-verify.sh new file mode 100755 index 00000000..3e767614 --- /dev/null +++ b/tests/test-verify.sh @@ -0,0 +1,24 @@ +#!/bin/sh +. "${srcdir=.}/init.sh" + +# We are not interested in triggering bugs in the compilers and tools +# (such as gcc 4.3.1 on openSUSE 11.0). +unset MALLOC_PERTURB_ + +# Rather than figure out how to invoke the compiler with the right +# include path ourselves, we let make do it: +(cd "$initial_cwd_" && rm -f test-verify.o \ + && $MAKE test-verify.o >/dev/null 2>&1) \ + || skip_ "cannot compile error-free" + +# Now, prove that we encounter all expected compilation failures: +: >out +: >err +for i in 1 2 3 4 5; do + (cd "$initial_cwd_" + rm -f test-verify.o + $MAKE CFLAGS=-DEXP_FAIL=$i test-verify.o) >>out 2>>err \ + && { warn_ "compiler didn't detect verification failure $i"; fail=1; } +done + +Exit $fail |