osmith submitted this change.
testenv: improve output for missing -c argument
When a testsuite has multiple testenv.cfg files, the user needs to
explicitly choose a config, or "-c all" for all configs. Improve the
help output to directly print the arguments that need to be passed,
instead of printing the config file names. Mention that wildcards can be
used too.
Old:
[testenv] Found multiple testenv.cfg files:
[testenv] * testenv_generic.cfg
[testenv] * testenv_sccplite.cfg
[testenv] * testenv_vamos.cfg
[testenv] Select a specific config (e.g. '-c generic') or all ('-c all')
New:
[testenv] Found multiple testenv.cfg files, use one of:
[testenv] -c generic
[testenv] -c sccplite
[testenv] -c vamos
[testenv] You can also select all of them (-c all) or use the * character as wildcard.
Related: OS#6494
Change-Id: I3f273caff702b33d3d74a9e5c8d77b22f27d7cfc
---
M _testenv/testenv/testenv_cfg.py
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/_testenv/testenv/testenv_cfg.py b/_testenv/testenv/testenv_cfg.py
index 8bb4119..ea25614 100644
--- a/_testenv/testenv/testenv_cfg.py
+++ b/_testenv/testenv/testenv_cfg.py
@@ -209,11 +209,10 @@
sys.exit(1)
if len(ret) > 1 and not testenv.args.config:
- logging.error("Found multiple testenv.cfg files:")
+ logging.error("Found multiple testenv.cfg files, use one of:")
for path in ret:
- logging.error(f" * {os.path.basename(path)}")
- example = os.path.basename(ret[0]).split("_", 1)[1].split(".cfg", 1)[0]
- logging.error(f"Select a specific config (e.g. '-c {example}') or all ('-c all')")
+ logging.error(f" -c {os.path.basename(path).replace('testenv_', '', 1).replace('.cfg', '')}")
+ logging.error("You can also select all of them (-c all) or use the * character as wildcard.")
sys.exit(1)
return ret
To view, visit change 38520. To unsubscribe, or for help writing mail filters, visit settings.