[oe-commits] [openembedded-core] 68/122: oeqa/runqemu: Only show stdout/stderr upon test failure

git at git.openembedded.org git at git.openembedded.org
Mon Dec 4 17:25:46 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch rocko
in repository openembedded-core.

commit 1826a8cb8cf4c51307003617864d2ffab273eb0b
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Nov 8 14:03:28 2017 +0000

    oeqa/runqemu: Only show stdout/stderr upon test failure
    
    In general we don't need to see the output of runqemu however if it fails
    we do. Use the buffer option that already exists in TestResult but allow
    us to trigger it on a per test basis.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
    Signed-off-by: Armin Kuster <akuster at mvista.com>
---
 meta/lib/oeqa/core/runner.py            | 8 ++++++++
 meta/lib/oeqa/selftest/cases/runqemu.py | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index f6539e6..2d756da 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -45,6 +45,14 @@ class OETestResult(_TestResult):
         self.tc = tc
         self._tc_map_results()
 
+    def startTest(self, test):
+        # Allow us to trigger the testcase buffer mode on a per test basis
+        # so stdout/stderr are only printed upon failure. Enables debugging
+        # but clean output
+        if hasattr(test, "buffer"):
+            self.buffer = True
+        super(OETestResult, self).startTest(test)
+
     def _tc_map_results(self):
         self.tc._results['failures'] = self.failures
         self.tc._results['errors'] = self.errors
diff --git a/meta/lib/oeqa/selftest/cases/runqemu.py b/meta/lib/oeqa/selftest/cases/runqemu.py
index 1991be7..1a8d121 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -14,6 +14,8 @@ class RunqemuTests(OESelftestTestCase):
 
     image_is_ready = False
     deploy_dir_image = ''
+    # We only want to print runqemu stdout/stderr if there is a test case failure
+    buffer = True
 
     def setUpLocal(self):
         super(RunqemuTests, self).setUpLocal()

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list