From: Collin Funk Date: Mon, 18 Mar 2024 23:26:34 +0000 (-0700) Subject: gnulib-tool.py: Follow gnulib-tool changes, part 66. X-Git-Tag: v1.0~267 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0bfce9c52e1d8b3b0913326bcf109223569e3ea4;p=gnulib.git gnulib-tool.py: Follow gnulib-tool changes, part 66. Follow gnulib-tool change 2021-12-25 Bruno Haible 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. --- diff --git a/ChangeLog b/ChangeLog index 3e0ceadca5..37c4e2801b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2024-03-19 Collin Funk + + gnulib-tool.py: Follow gnulib-tool changes, part 66. + Follow gnulib-tool change + 2021-12-25 Bruno Haible + 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 gnulib-tool.py: Follow gnulib-tool changes, part 65. diff --git a/gnulib-tool.py.TODO b/gnulib-tool.py.TODO index ada248c59f..819cca07e6 100644 --- a/gnulib-tool.py.TODO +++ b/gnulib-tool.py.TODO @@ -73,21 +73,6 @@ Date: Tue Mar 1 10:01:22 2022 -0800 -------------------------------------------------------------------------------- -commit 9af17c55629c4cbe2facdc9edb5242136567ebba -Author: Bruno Haible -Date: Sat Dec 25 14:30:57 2021 +0100 - - gnulib-tool: Fix handling of module libtextstyle-optional. - - Reported by Paul Eggert in - . - - * 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 Date: Thu Jun 8 15:09:31 2017 +0200 diff --git a/pygnulib/GLEmiter.py b/pygnulib/GLEmiter.py index f4db15481f..16984e7d99 100644 --- a/pygnulib/GLEmiter.py +++ b/pygnulib/GLEmiter.py @@ -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: diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 4e4306fe37..a96a2988b5 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -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.''' diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py index e33319b575..6c3aeceb58 100644 --- a/pygnulib/GLTestDir.py +++ b/pygnulib/GLTestDir.py @@ -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: