+2024-03-06 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool.py: Follow gnulib-tool changes, part 42.
+ Follow gnulib-tool change
+ 2019-02-15 Bruno Haible <bruno@clisp.org>
+ gnulib-tool: Support --import with just a few tests, not --with-tests.
+ * pygnulib/GLImport.py (GLImport.execute): Use 'gentests' instead of
+ 'inctests' when generating files.
+ * pygnulib/GLMakefileTable.py (GLMakefileTable.parent): Add 'gentests'
+ argument and use it instead of 'inctests'.
+
2024-03-05 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Follow gnulib-tool changes, part 41.
--------------------------------------------------------------------------------
-commit dc135c4fd14cdc219d316c61f344e64090cb33fd
-Author: Bruno Haible <bruno@clisp.org>
-Date: Fri Feb 15 21:27:44 2019 +0100
-
- gnulib-tool: Support --import with just a few tests, not --with-tests.
-
- * gnulib-tool (func_import): New variable 'gentests'. Use it instead of
- 'inctests' when generating files; use 'inctests' only for computing the
- transitive closure.
-
---------------------------------------------------------------------------------
-
commit 425ee42259b04956aae20afc5204775ae6e79744
Author: Bruno Haible <bruno@clisp.org>
Date: Wed Jan 23 05:11:54 2019 +0100
verbose = self.config['verbosity']
actioncmd = self.actioncmd()
+ # Determine whether to put anything into $testsbase.
+ testsfiles = [ file
+ for file in filetable['all']
+ if file.startswith('tests/') or file.startswith('tests=lib/') ]
+ gentests = len(testsfiles) > 0
+
# Create all necessary directories.
dirs = list()
if pobase:
for file in filetable['all']
if file.startswith('doc/') ]:
dirs += [docbase]
+ if gentests:
+ dirs += [testsbase]
dirs += [sourcebase, m4base, auxdir]
dirs += [ os.path.dirname(pair[0])
for pair in filetable['new'] ]
testsbase_base = os.path.basename(testsbase)
self.makefiletable.editor(testsbase_dir, 'SUBDIRS', testsbase_base, True)
self.makefiletable.editor('', 'ACLOCAL_AMFLAGS', '-I %s' % m4base)
- self.makefiletable.parent()
+ self.makefiletable.parent(gentests)
# Create library makefile.
basename = joinpath(sourcebase, makefile_am)
os.remove(tmpfile)
# Create tests Makefile.
- inctests = self.config.checkInclTestCategory(TESTS['tests'])
- if inctests:
+ if gentests:
basename = joinpath(testsbase, makefile_am)
tmpfile = self.assistant.tmpfilename(basename)
emit, uses_subdirs = self.emitter.tests_Makefile_am(basename,
print(' - "include %s" from within "%s/Makefile.am",' % (makefile_name, sourcebase))
if pobase:
print(' - add "%s/Makefile.in to AC_CONFIG_FILES in %s,' % (pobase, configure_ac))
- if inctests:
+ if gentests:
if makefile_am == 'Makefile.am':
print(' - add "%s/Makefile" to AC_CONFIG_FILES in %s,' % (testsbase, configure_ac))
else: # if makefile_am != 'Makefile.am'
dictionary = {'dir': dir, 'var': var, 'val': val, 'dotfirst': dotfirst}
self.table += [dictionary]
- def parent(self):
- '''GLMakefileTable.parent()
+ def parent(self, gentests):
+ '''GLMakefileTable.parent(gentests)
Add a special row to Makefile.am table with the first parent directory
which contains or will contain Makefile.am file.
GLConfig: sourcebase, m4base, testsbase, incl_test_categories,
- excl_test_categories, makefile_name.'''
+ excl_test_categories, makefile_name.
+ gentests is a bool that is True if files are placed in $testsbase.'''
+ if type(gentests) is not bool:
+ raise TypeError('gentests must be a bool, not %s' % (type(gentests).__name__))
m4base = self.config['m4base']
sourcebase = self.config['sourcebase']
testsbase = self.config['testsbase']
while (dir1
and (joinpath(self.config['destdir'], dir1, mfd)
or joinpath(dir1, mfd) == joinpath(sourcebase, mfx)
- or (inctests and joinpath(dir1, mfd) == joinpath(testsbase, mfx)))):
+ or (gentests and joinpath(dir1, mfd) == joinpath(testsbase, mfx)))):
dir2 = joinpath(os.path.basename(dir1), dir2)
dir1 = os.path.dirname(dir1)
self.editor(dir1, 'EXTRA_DIST', joinpath(dir2, 'gnulib-cache.m4'))