summaryrefslogtreecommitdiff
path: root/gnulib-tool
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-12-25 14:30:57 +0100
committerBruno Haible <bruno@clisp.org>2021-12-25 14:30:57 +0100
commit9af17c55629c4cbe2facdc9edb5242136567ebba (patch)
tree6ea3c80d124dd3b10d7233574a4e601276da1bff /gnulib-tool
parent83948c64d10c77fb964e6523a9524729d6a66f32 (diff)
downloadgnulib-9af17c55629c4cbe2facdc9edb5242136567ebba.tar.gz
gnulib-tool: Fix handling of module libtextstyle-optional.
Reported by Paul Eggert in <https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00152.html>. * gnulib-tool (func_repeat_module_in_tests): New function. (func_emit_tests_Makefile_am, func_create_testdir): Use it for the file list and when creating tests/Makefile.am.
Diffstat (limited to 'gnulib-tool')
-rwxr-xr-xgnulib-tool41
1 files changed, 35 insertions, 6 deletions
diff --git a/gnulib-tool b/gnulib-tool
index c2607c95a0..9b7cf334a4 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -2797,6 +2797,27 @@ func_verify_tests_module ()
fi
}
+# func_repeat_module_in_tests
+# tests whether, when the tests have their own configure.ac script, a given
+# module should be repeated in the tests, although it was already among the main
+# modules.
+# Input:
+# - module module name argument
+func_repeat_module_in_tests ()
+{
+ case "$module" in
+ libtextstyle-optional)
+ # This module is special because it relies on a gl_LIBTEXTSTYLE_OPTIONAL
+ # invocation that it does not itself do or require. Therefore if the
+ # tests contain such an invocation, the module - as part of tests -
+ # will produce different AC_SUBSTed variable values than the same module
+ # - as part of the main configure.ac -.
+ echo true ;;
+ *)
+ echo false ;;
+ esac
+}
+
# func_get_dependencies_recursively module
# Input:
# - local_gnulib_path from --local-dir
@@ -4132,7 +4153,11 @@ func_emit_tests_Makefile_am ()
{
for module in $modules; do
if $for_test && ! $single_configure; then
- func_verify_tests_module
+ if `func_repeat_module_in_tests`; then
+ func_verify_module
+ else
+ func_verify_tests_module
+ fi
else
func_verify_module
fi
@@ -6478,11 +6503,15 @@ func_create_testdir ()
if $single_configure; then
func_modules_to_filelist_separately
else
- func_modules_to_filelist
- if test $verbose -ge 0; then
- echo "File list:"
- echo "$files" | sed -e 's/^/ /'
- fi
+ main_modules="$modules"
+ testsrelated_modules=`for module in $modules; do
+ if \`func_repeat_module_in_tests\`; then
+ echo $module
+ fi
+ done`
+ saved_modules="$modules"
+ func_modules_to_filelist_separately
+ modules="$saved_modules"
fi
# Add files for which the copy in gnulib is newer than the one that
# "automake --add-missing --copy" would provide.