summaryrefslogtreecommitdiff
path: root/gnulib-tool.py
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-08-03 17:55:24 +0200
committerBruno Haible <bruno@clisp.org>2022-08-03 18:09:34 +0200
commitf531502a86fc921fa02b24ba9d7170ff3b8f93b4 (patch)
tree6dc75b46ed4350e349975bf408f33a24e7d1cefc /gnulib-tool.py
parente2d15e5c893e42b32a840a6641d5fa8cef7b4f7c (diff)
downloadgnulib-f531502a86fc921fa02b24ba9d7170ff3b8f93b4.tar.gz
gnulib-tool.py: Fix broken 'for' loop.
* gnulib-tool.py (main): Canonicalize inctests before creating the GLConfig. Rewrite a broken 'for' loop. * pygnulib/GLConfig.py (GLConfig.setTestFlags): Remove unused statement.
Diffstat (limited to 'gnulib-tool.py')
-rwxr-xr-xgnulib-tool.py50
1 files changed, 21 insertions, 29 deletions
diff --git a/gnulib-tool.py b/gnulib-tool.py
index 0864d0d8c2..cbef01b3b2 100755
--- a/gnulib-tool.py
+++ b/gnulib-tool.py
@@ -523,28 +523,27 @@ def main():
dryrun = cmdargs.dryrun
verbose = -cmdargs.quiet + cmdargs.verbose
inctests = cmdargs.inctests
- flags = [cmdargs.inctests, cmdargs.obsolete, cmdargs.cxx,
- cmdargs.longrunning, cmdargs.privileged, cmdargs.unportable,
- cmdargs.alltests]
- testflags = list()
- for flag in flags:
- index = flags.index(flag)
- if flag != None:
- if flag:
- if index == 0:
- testflags += [constants.TESTS['tests']]
- elif index == 1:
- testflags += [constants.TESTS['obsolete']]
- elif index == 2:
- testflags += [constants.TESTS['cxx-tests']]
- elif index == 3:
- testflags += [constants.TESTS['longrunning-tests']]
- elif index == 4:
- testflags += [constants.TESTS['privileged-tests']]
- elif index == 5:
- testflags += [constants.TESTS['unportable-tests']]
- elif index == 6:
- testflags += [constants.TESTS['all-tests']]
+ # Canonicalize the inctests variable.
+ if inctests == None:
+ if mode in ['import', 'add-import', 'remove-import', 'update']:
+ inctests = False
+ elif mode in ['create-testdir', 'create-megatestdir', 'test', 'megatest']:
+ inctests = True
+ testflags = []
+ if inctests:
+ testflags += [constants.TESTS['tests']]
+ if cmdargs.obsolete:
+ testflags += [constants.TESTS['obsolete']]
+ if cmdargs.cxx:
+ testflags += [constants.TESTS['cxx-tests']]
+ if cmdargs.longrunning:
+ testflags += [constants.TESTS['longrunning-tests']]
+ if cmdargs.privileged:
+ testflags += [constants.TESTS['privileged-tests']]
+ if cmdargs.unportable:
+ testflags += [constants.TESTS['unportable-tests']]
+ if cmdargs.alltests:
+ testflags += [constants.TESTS['all-tests']]
lgpl = cmdargs.lgpl
if lgpl != None:
lgpl = lgpl[-1]
@@ -589,13 +588,6 @@ def main():
dryrun=dryrun,
)
- # Canonicalize the inctests variable.
- if inctests == None:
- if mode in ['import', 'add-import', 'remove-import', 'update']:
- config.disableTestFlag(TESTS['tests'])
- elif mode in ['create-testdir', 'create-megatestdir', 'test', 'megatest']:
- config.enableTestFlag(TESTS['tests'])
-
# Work in the given mode.
if mode in ['list']:
modulesystem = classes.GLModuleSystem(config)