As mentioned in <https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00018.html>, $ ./gnulib-tool --extract-dependents hamt should return hamt-tests
This patch does it. 2024-08-16 Bruno Haible <[email protected]> gnulib-tool.py: Correct the result of --extract-dependents. * pygnulib/GLModuleSystem.py (GLModule.getDependents): Add the current module's test module, if that exists. diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 1f758fb0e5..e9855f775c 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -596,6 +596,11 @@ def getDependents(self) -> list[GLModule]: listing = [ line for line in listing if self.modulesystem.file_is_module(line) ] + # ${module}-tests implicitly depends on ${module}, if both exist. + if self.isNonTests(): + implicit_dependent = self.name+'-tests' + if self.modulesystem.exists(implicit_dependent): + listing.append(implicit_dependent) candidates = sorted(set(listing)) result = [] for name in candidates:
