Mercurial > gnulib
view tests/test-verify.sh @ 40198:5a34193cbc07
long-options: add parse_gnu_standard_options_only
Discussed in https://bugs.gnu.org/33468 .
* lib/long-options.c (parse_long_options): Use EXIT_SUCCESS instead
of 0.
(parse_gnu_standard_options_only): Add function to
process the GNU default options --help and --version and fail for any other
unknown long or short option. See
https://gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html .
* lib/long-options.h (parse_gnu_standard_options_only): Declare it.
* modules/long-options (depends-on): Add stdbool, exitfail.
* top/maint.mk (sc_prohibit_long_options_without_use): Update
syntax-check rule, add new function name.
author | Bernhard Voelker <mail@bernhard-voelker.de> |
---|---|
date | Thu, 29 Nov 2018 09:06:26 +0100 |
parents | f2fc38f20336 |
children |
line wrap: on
line source
#!/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-try.o \ && $MAKE test-verify-try.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-try.o $MAKE CFLAGS=-DEXP_FAIL=$i test-verify-try.o) >>out 2>>err \ && { warn_ "compiler didn't detect verification failure $i"; fail=1; } done Exit $fail