]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Follow gnulib-tool changes, part 66.
authorCollin Funk <collin.funk1@gmail.com>
Mon, 18 Mar 2024 23:26:34 +0000 (16:26 -0700)
committerBruno Haible <bruno@clisp.org>
Tue, 19 Mar 2024 09:32:09 +0000 (10:32 +0100)
Follow gnulib-tool change
2021-12-25  Bruno Haible  <bruno@clisp.org>
gnulib-tool: Fix handling of module libtextstyle-optional.

* pygnulib/GLModuleSystem.py (GLModule.repeatModuleInTests): New function.
* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Use it for creating
the tests/Makefile.am.
* pygnulib/GLTestDir.py (GLTestDir.execute): Use it when creating the
file list.

ChangeLog
gnulib-tool.py.TODO
pygnulib/GLEmiter.py
pygnulib/GLModuleSystem.py
pygnulib/GLTestDir.py

index 3e0ceadca546a00a9e8c980d3085ebdbe50b15f9..37c4e2801b996f799ad73eac804ecc321208428e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2024-03-19  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Follow gnulib-tool changes, part 66.
+       Follow gnulib-tool change
+       2021-12-25  Bruno Haible  <bruno@clisp.org>
+       gnulib-tool: Fix handling of module libtextstyle-optional.
+       * pygnulib/GLModuleSystem.py (GLModule.repeatModuleInTests): New function.
+       * pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Use it for creating
+       the tests/Makefile.am.
+       * pygnulib/GLTestDir.py (GLTestDir.execute): Use it when creating the
+       file list.
+
 2024-03-19  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Follow gnulib-tool changes, part 65.
index ada248c59f93bc2ba0a33049f3cde37c7fc5ddcc..819cca07e61e896494f9d2fdd2c405af72d99219 100644 (file)
@@ -73,21 +73,6 @@ Date:   Tue Mar 1 10:01:22 2022 -0800
 
 --------------------------------------------------------------------------------
 
-commit 9af17c55629c4cbe2facdc9edb5242136567ebba
-Author: Bruno Haible <bruno@clisp.org>
-Date:   Sat Dec 25 14:30:57 2021 +0100
-
-    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.
-
---------------------------------------------------------------------------------
-
 commit 30459fe101541698ec704acb224946d73676750e
 Author: Bruno Haible <bruno@clisp.org>
 Date:   Thu Jun 8 15:09:31 2017 +0200
index f4db15481f0317b81fc11ac3196733e1690b7592..16984e7d99151d054b0ade104a0c9b39ebaf7b63 100644 (file)
@@ -1106,7 +1106,10 @@ AC_DEFUN([%V1%_LIBSOURCES], [
         longrun_snippets = ''
         for module in modules:
             if for_test and not single_configure:
-                accept = module.isTests()
+                if module.repeatModuleInTests():
+                    accept = True
+                else:
+                    accept = module.isTests()
             else:  # if for_test and not single_configure
                 accept = True
             if accept:
index 4e4306fe377cf45965772f2e804666e4ac73ab10..a96a2988b5f785d13e426d35930ac6e7df9803ec 100644 (file)
@@ -331,6 +331,18 @@ class GLModule(object):
         result = self.modulesystem.find(self.getTestsName())
         return result
 
+    def repeatModuleInTests(self) -> bool:
+        '''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.'''
+        # 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 -.
+        result = self.getName() == 'libtextstyle-optional'
+        return result
+
     def getDependenciesRecursively(self) -> str:
         '''Return a list of recursive dependencies of this module separated
         by a newline.'''
index e33319b575ab744ad3a078f4fc4e9b848d237a8d..6c3aeceb58e721ce763387d36ba37f9779d4ee1d 100644 (file)
@@ -321,11 +321,15 @@ class GLTestDir(object):
         if single_configure:
             main_filelist, tests_filelist = \
                 moduletable.filelist_separately(main_modules, tests_modules)
-            filelist = sorted(set(main_filelist + tests_filelist))
         else:  # if not single_configure
-            filelist = moduletable.filelist(modules)
+            main_modules = modules
+            tests_modules = [ module
+                              for module in modules
+                              if module.repeatModuleInTests() ]
+            main_filelist, tests_filelist = \
+                moduletable.filelist_separately(main_modules, tests_modules)
 
-        filelist = sorted(set(filelist))
+        filelist = sorted(set(main_filelist + tests_filelist))
 
         # Print list of files.
         if verbose >= 0: