]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Fix handling of module libtextstyle-optional.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Dec 2021 13:30:57 +0000 (14:30 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Dec 2021 13:30:57 +0000 (14:30 +0100)
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.

ChangeLog
gnulib-tool

index cc9c38192d9d55384f66278ee7ae47df71e67201..54b3a3548ff21a44e884eedec29373dbdf27a8e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2021-12-25  Bruno Haible  <bruno@clisp.org>
+
+       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.
+
 2021-12-25  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool: Respect applicability 'all' without --single-configure.
index c2607c95a0f855e8b299ac2e4c0e4184cb0a28b3..9b7cf334a4b5fd21c5351cfe1f0608b47500aa4a 100755 (executable)
@@ -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.