From cf5e67c140ee3e147a9928e47d2f11439689f0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rud=C3=A1=20Moura?= Date: Tue, 26 Aug 2014 15:34:57 -0300 Subject: [PATCH] avocado.plugins.runner: Option --silent exclusive to run. Remove generic option --silent and turn it to subcommand run. Signed-off-by: Ruda Moura --- avocado/plugins/runner.py | 3 ++ avocado/plugins/silentresult.py | 35 ------------------- .../all/functional/avocado/basic_tests.py | 2 +- 3 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 avocado/plugins/silentresult.py diff --git a/avocado/plugins/runner.py b/avocado/plugins/runner.py index 502ef4d0..a229e03a 100644 --- a/avocado/plugins/runner.py +++ b/avocado/plugins/runner.py @@ -114,6 +114,9 @@ class TestRunner(plugin.Plugin): help=('Unique Job id. Used by a server when job ' 'was created at the server and run on a ' 'different test machine')) + + self.parser.add_argument('-s', '--silent', action='store_true', default=False, + help='Silent output, do not display results.') super(TestRunner, self).configure(self.parser) def run(self, args): diff --git a/avocado/plugins/silentresult.py b/avocado/plugins/silentresult.py deleted file mode 100644 index d9d47db6..00000000 --- a/avocado/plugins/silentresult.py +++ /dev/null @@ -1,35 +0,0 @@ -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# See LICENSE for more details. -# -# Copyright: Red Hat Inc. 2014 -# Author: Ruda Moura - -""" -Silent output module. -""" - -from avocado.plugins import plugin - - -class Silent(plugin.Plugin): - - """ - Silent output plugin. - """ - - name = 'silent_output' - enabled = True - - def configure(self, parser): - self.parser = parser.application.add_argument( - '--silent', action='store_true', default=False, - help='Silent output, do not display results.') - self.configured = True diff --git a/selftests/all/functional/avocado/basic_tests.py b/selftests/all/functional/avocado/basic_tests.py index da92ea2f..c24ab186 100644 --- a/selftests/all/functional/avocado/basic_tests.py +++ b/selftests/all/functional/avocado/basic_tests.py @@ -150,7 +150,7 @@ class RunnerOperationTest(unittest.TestCase): def test_silent_output(self): os.chdir(basedir) - cmd_line = './scripts/avocado --silent run sleeptest' + cmd_line = './scripts/avocado run --silent sleeptest' result = process.run(cmd_line, ignore_status=True) expected_rc = 0 expected_output = '' -- GitLab