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