diff options
author | Bruno Haible <bruno@clisp.org> | 2022-08-03 22:29:52 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2022-08-04 01:51:24 +0200 |
commit | de028fc3637de15c3c0535e168bc5dda6a6084e6 (patch) | |
tree | ce2c1cbe871a38f016fa8bec573a19e24cd37550 /pygnulib/GLTestDir.py | |
parent | 1e57719d520683d08e8646fb2b778aa9d9afb294 (diff) | |
download | gnulib-de028fc3637de15c3c0535e168bc5dda6a6084e6.tar.gz |
gnulib-tool.py: Implement options --without-c++-tests etc.
* gnulib-tool.py (main): Accept options --without-c++-tests,
--without-longrunning-tests, --without-privileged-tests,
--without-unportable-tests.
Improve error message for --copy-file with invalid number of arguments.
Check for invalid options given in --import, --add-import,
--remove-import, --update modes.
Pass both sets of test categories to the GLConfig constructor.
* pygnulib/GLConfig.py (GLConfig.__init__): Accept incl_test_categories
and excl_test_categories instead of testflags.
(checkInclTestCategory): Renamed from checkTestFlag.
(enableInclTestCategory): Renamed from enableTestFlag.
(disableInclTestCategory): Renamed from disableTestFlag.
(getInclTestCategories): Renamed from getTestFlags.
(setInclTestCategories): Renamed from setTestFlags.
(resetInclTestCategories): Renamed from resetTestFlags.
(setInclTestCategory, checkExclTestCategory, enableExclTestCategory,
disableExclTestCategory, getExclTestCategories, setExclTestCategories,
resetExclTestCategories): New methods.
* pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Accept two
booleans as second and third constructor arguments.
(transitive_closure): Correct the determination of whether to include
each module, depending on the with-* and without-* options.
(transitive_closure_separately): Update.
* pygnulib/GLMakefileTable.py: Update.
* pygnulib/GLImport.py (__init__, actioncmd, gnulib_cache, execute):
Update.
* pygnulib/GLTestDir.py (GLTestDir.__init__, GLTestDir.execute,
GLMegaTestDir.__init__): Update.
Diffstat (limited to 'pygnulib/GLTestDir.py')
-rw-r--r-- | pygnulib/GLTestDir.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pygnulib/GLTestDir.py b/pygnulib/GLTestDir.py index 29c3010ce0..cb75ba1eab 100644 --- a/pygnulib/GLTestDir.py +++ b/pygnulib/GLTestDir.py @@ -87,7 +87,9 @@ class GLTestDir(object): self.emiter = GLEmiter(self.config) self.filesystem = GLFileSystem(self.config) self.modulesystem = GLModuleSystem(self.config) - self.moduletable = GLModuleTable(self.config) + self.moduletable = GLModuleTable(self.config, + True, + self.config.checkInclTestCategory(TESTS['all-tests'])) self.assistant = GLFileAssistant(self.config) self.makefiletable = GLMakefileTable(self.config) @@ -147,7 +149,6 @@ class GLTestDir(object): Create a scratch package with the given modules.''' auxdir = self.config['auxdir'] - testflags = list(self.config['testflags']) sourcebase = self.config['sourcebase'] m4base = self.config['m4base'] pobase = self.config['pobase'] @@ -180,8 +181,8 @@ class GLTestDir(object): # When computing transitive closures, don't consider $module to depend on # $module-tests. Need this because tests are implicitly GPL and may depend # on GPL modules - therefore we don't want a warning in this case. - saved_testflags = list(self.config['testflags']) - self.config.disableTestFlag(TESTS['tests']) + saved_inctests = self.config.checkInclTestCategory(TESTS['tests']) + self.config.disableInclTestCategory(TESTS['tests']) for requested_module in base_modules: requested_licence = requested_module.getLicense() if requested_licence != 'GPL': @@ -213,7 +214,7 @@ class GLTestDir(object): if incompatible: errormsg = 'module %s depends on a module with an incompatible license: %s\n' % (requested_module, module) sys.stderr.write(errormsg) - self.config.setTestFlags(saved_testflags) + self.config.setInclTestCategory(TESTS['tests'], saved_inctests) # Determine final module list. modules = self.moduletable.transitive_closure(base_modules) @@ -389,7 +390,7 @@ class GLTestDir(object): subdirs_with_configure_ac = list() testsbase_appened = False - inctests = self.config.checkTestFlag(TESTS['tests']) + inctests = self.config.checkInclTestCategory(TESTS['tests']) if inctests: directory = joinpath(self.testdir, testsbase) if not isdir(directory): @@ -863,7 +864,9 @@ class GLMegaTestDir(object): self.emiter = GLEmiter(self.config) self.filesystem = GLFileSystem(self.config) self.modulesystem = GLModuleSystem(self.config) - self.moduletable = GLModuleTable(self.config) + self.moduletable = GLModuleTable(self.config, + True, + self.config.checkInclTestCategory(TESTS['all-tests'])) self.assistant = GLFileAssistant(self.config) self.makefiletable = GLMakefileTable(self.config) |