bootstrap: fix an error when gnulib is not used as a git submodule
* build-aux/bootstrap (gnulib_path): If its length is zero then
assign "gnulib" to it.
* build-aux/bootstrap: Redirect "git clone -h" stderr to stdout.
Jim Meyering [Sun, 16 May 2010 20:30:00 +0000 (22:30 +0200)]
init.sh: fix an error in the previous change; add more comments
* tests/init.sh: Compare exit code in loop against 9, not 2.
Patch by Bruno Haible.
Make the two tests more similar by adding an empty "then" clause.
Add comments.
Jim Meyering [Sun, 16 May 2010 16:34:08 +0000 (18:34 +0200)]
init.sh: avoid unnecessary shell re-exec
* tests/init.sh: Improve the re-exec-required check to first test the
current shell. If it passes the test, do not search for a shell that
does pass, and do not re-exec. This test is particularly contorted to
avoid triggering misbehavior in Solaris 10's /bin/sh whereby any use
of $(...) evokes a syntax error and causes immediate shell exit with
status 2. Bruno Haible reported that the re-exec made it impossible
to single-step through any init.sh-using script.
Jim Meyering [Tue, 11 May 2010 16:49:29 +0000 (18:49 +0200)]
maint.mk: tweak preceding change
* top/maint.mk (gl_extract_significant_defines_): Make exclusion
regexps tighter by anchoring at EOL, and make the new group "shy"
for slightly decreased overhead.
Eric Blake [Tue, 11 May 2010 14:52:39 +0000 (08:52 -0600)]
maint.mk: gnulib doesn't guarantee NSIG
Gnulib conditionally defines NSIG to 32 for some platforms. But since
NSIG is not mandated by standards, and there are platforms with 64
signals, we should not promise that NSIG is guaranteed.
Jim Meyering [Mon, 10 May 2010 07:29:09 +0000 (09:29 +0200)]
maint.mk: avoid using a temporary file in the always-defined-macros check
* top/maint.mk (.re-defmac): Remove rule.
(gl_trap_): Remove definition.
(sc_prohibit_always-defined_macros): Rewrite not to create and
depend on a temporary file. Instead, depend on GNU grep's ability
to read a list of regular expressions from stdin when given "-f -".
With my recent change in init.sh from the two-line form:
-# : ${srcdir=.}
-# . "$srcdir/init.sh"; path_prepend_ .
+# . "${srcdir=.}/init.sh"; path_prepend_ .
I noticed that using the one-line form would cause this test
to fail with a false-positive, or to stop working altogether,
depending on whether help-version changed or all the tests did.
* top/maint.mk (_hv_regex): Remove this definition.
(_hv_regex_weak): Use a weak regex to select all init.sh-sourcing files.
(_hv_regex_strong): Use a stronger regex to check for conformance.
(sc_cross_check_PATH_usage_in_tests): Rewrite to use the above.
Give a separate diagnostic for lack of conforming use.
Jim Meyering [Fri, 7 May 2010 07:19:41 +0000 (09:19 +0200)]
init.sh: improve comments
* tests/init.sh: Recommend the one-line init.sh-sourcing idiom:
. "${srcdir=.}/init.sh"; path_prepend_ .
Add a note about path_prepend_ and the alternative of using
TESTS_ENVIRONMENT.
exclude: Unescape hashed patterns in wildcard mode.
* lib/exclude.c (add_exclude): Unescape the pattern before adding it
to the hash list.
* tests/test-exclude8.sh: New test case.
* modules/exclude-tests: Add new test.
Eric Blake [Wed, 5 May 2010 22:19:18 +0000 (16:19 -0600)]
verify: automate tests
Had we automated this sooner, we would have caught the issue
with gcc -Werror -Wredundant-decls sooner.
* modules/verify-tests: New module.
* tests/test-verify.sh: New file.
* tests/test-verify.c: Guard each negative test with a unique id.
Also avoid warning about unused left hand of comma expressions.
Paul Eggert [Wed, 5 May 2010 20:57:26 +0000 (13:57 -0700)]
Further improvements to verify.h, suggested by Eric Blake.
* lib/verify.h (_GL_CONCAT, _GL_CONCAT0, _GL_GENSYM): Renamed from
the GL_* versions, to avoid collision with OpenGL.
(_GL_COUNTER): New macro, so that we can fall back on __LINE__ if
__COUNTER__ doesn't work. Test that __COUNTER__ increments rather
than testing merely whether it's defined.
Paul Eggert [Wed, 5 May 2010 19:50:00 +0000 (12:50 -0700)]
Modify verify.h to pacify gcc -Wredundant_decls.
* lib/verify.h (GL_CONCAT, GL_CONCAT0, GL_GENSYM): New macros.
These use the prefix "GL_" since they're likely to be useful elsewhere.
We may need to break them out into a different .h file.
(__COUNTER__): Define to 0 if the compiler doesn't support it.
(verify) [!defined __cplusplus]: Use them to avoid duplicate decls
of verify_function__.
Jim Meyering [Mon, 3 May 2010 16:30:38 +0000 (18:30 +0200)]
test-xalloc-die: avoid unwarranted test failure on OpenSolaris 5.11
* tests/test-xalloc-die.sh: Redirect stdout before stderr, (i.e.,
"> out 2> err", rather than "2> err > out"). Otherwise, with /bin/sh
on OpenSolaris 5.11 snv_134, we would end up with a stray "1> out"
line in the "err2" output file when running "make check" in verbose
mode (i.e., with set -x enabled).
Jim Meyering [Mon, 3 May 2010 08:08:20 +0000 (10:08 +0200)]
maint.mk: prohibit unwarranted use of <strings.h>
* top/maint.mk (sc_prohibit_strings_without_use): Reject inclusion of
strings.h in a file that does not also use strcasecmp, strncasecmp,
ffs or ffsll.
Eric Blake [Wed, 28 Apr 2010 16:13:24 +0000 (10:13 -0600)]
canonicalize-lgpl: avoid compiler warning
* lib/canonicalize-lgpl.c (versioned_symbol): Avoid an 'empty
declaration' / 'extraneous semicolon' warning with some compilers.
Reported by Andreas Gruenbacher.
Jim Meyering [Tue, 27 Apr 2010 15:29:03 +0000 (17:29 +0200)]
maint.mk: fix a bug introduced in last change
* top/maint.mk (gl_assured_headers_): Now that all names are on
one line, use sed's "g" modifier. Note that while the \.in\.h LHS
is not anchored to end of word, it should be adequate.
Jim Meyering [Tue, 27 Apr 2010 14:32:40 +0000 (16:32 +0200)]
maint.mk: avoid side-effect in latest syntax-check
* top/maint.mk (sc_prohibit_always_true_header_tests): Rework not
to run commands via $(shell...), and hence to incur cost only when
the new rule is actually run.
Jim Meyering [Fri, 9 Apr 2010 17:07:57 +0000 (19:07 +0200)]
maint.mk: syntax-check: prohibit HAVE_<header>_H that are always true
Derive the list of guaranteed header names from gnulib/lib/*.in.h,
and use that to create a regexp used to detect all #if HAVE_..._H uses.
* top/maint.mk (sc_prohibit_always_true_header_tests): New rule.
(gl_assured_headers_, az_, AZ_): Define.
(gl_header_upper_case_or_, gl_have_header_regex_): Define.
Jim Meyering [Fri, 23 Apr 2010 09:38:35 +0000 (11:38 +0200)]
vc-list-files tests: convert to use init.sh
* tests/test-vc-list-files-cvs.sh: Invoke "$srcdir/init.sh" and
path_prepend_.
Use Exit, not exit.
Use skip_ rather than open coding it.
Remove trap set-up and compare definitions.
* tests/test-vc-list-files-git.sh: Likewise.
* modules/vc-list-files-tests (Files): Add tests/init.sh.