提交 5cf5736d 编写于 作者: R Rudá Moura

avocado app: Review command line options regarding test results output.

Group together jsonresult, xunitresult, htmlresult and journal
inside "output related arguments".

Side effect: export `self.parser.runner.output` to the plugins.
Signed-off-by: NRudá Moura <rmoura@redhat.com>
上级 2fb1e08a
......@@ -296,7 +296,7 @@ class HTML(plugin.Plugin):
self.enabled = False
return
self.parser = parser
self.parser.runner.add_argument(
self.parser.runner.output.add_argument(
'--html', type=str,
dest='html_output',
help=('Enable HTML output to the file where the result should be '
......@@ -304,14 +304,14 @@ class HTML(plugin.Plugin):
'since not all HTML resources can be embedded into a '
'single file (page resources will be copied to the '
'output file dir)'))
self.parser.runner.add_argument(
self.parser.runner.output.add_argument(
'--relative-links',
dest='relative_links',
action='store_true',
default=False,
help=('On the HTML report, generate anchor links with relative '
'instead of absolute paths. Current: %s' % False))
self.parser.runner.add_argument(
self.parser.runner.output.add_argument(
'--open-browser',
dest='open_browser',
action='store_true',
......
......@@ -123,7 +123,7 @@ class Journal(plugin.Plugin):
def configure(self, parser):
self.parser = parser
self.parser.runner.add_argument(
self.parser.runner.output.add_argument(
'--journal', action='store_true',
help='Records test status changes')
self.configured = True
......
......@@ -102,7 +102,7 @@ class JSON(plugin.Plugin):
def configure(self, parser):
self.parser = parser
self.parser.runner.add_argument(
self.parser.runner.output.add_argument(
'--json', type=str,
dest='json_output',
help='Enable JSON output to the file where the result should be written. '
......
......@@ -77,21 +77,24 @@ class TestRunner(plugin.Plugin):
'(hardware details, profilers, etc.). '
'Current: %(default)s'))
out = self.parser.add_argument_group('output related arguments')
out.add_argument('-s', '--silent', action='store_true', default=False,
help='Silence stdout')
out.add_argument('--show-job-log', action='store_true', default=False,
help=('Display only the job log on stdout. Useful '
'for test debugging purposes. No output will '
'be displayed if you also specify --silent'))
out.add_argument('--job-log-level', action='store',
help=("Log level of the job log. Options: "
"'debug', 'info', 'warning', 'error', "
"'critical'. Current: debug"),
default='debug')
self.parser.output = self.parser.add_argument_group('output related arguments')
self.parser.output.add_argument(
'-s', '--silent', action='store_true', default=False,
help='Silence stdout')
self.parser.output.add_argument(
'--show-job-log', action='store_true', default=False,
help=('Display only the job log on stdout. Useful '
'for test debugging purposes. No output will '
'be displayed if you also specify --silent'))
self.parser.output.add_argument(
'--job-log-level', action='store',
help=("Log level of the job log. Options: "
"'debug', 'info', 'warning', 'error', "
"'critical'. Current: debug"),
default='debug')
out_check = self.parser.add_argument_group('output check arguments')
......
......@@ -227,7 +227,7 @@ class XUnit(plugin.Plugin):
def configure(self, parser):
self.parser = parser
self.parser.runner.add_argument(
self.parser.runner.output.add_argument(
'--xunit', type=str, dest='xunit_output',
help=('Enable xUnit output to the file where the result should be written. '
"Use '-' to redirect to the standard output."))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册