summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-08 14:03:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-04 17:23:57 +0000
commit3f6fbed1e13f117cad68249119ed3c467364438c (patch)
treea35fd247fbd220770a8e247928d83f08c102736e /meta
parent292c2ae888be483029f43538ddbe51cdc9fcbf69 (diff)
downloadpoky-3f6fbed1e13f117cad68249119ed3c467364438c.tar.gz
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. (From OE-Core rev: 1826a8cb8cf4c51307003617864d2ffab273eb0b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/core/runner.py8
-rw-r--r--meta/lib/oeqa/selftest/cases/runqemu.py2
2 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index f6539e60b6..2d756da6d0 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -45,6 +45,14 @@ class OETestResult(_TestResult):
45 self.tc = tc 45 self.tc = tc
46 self._tc_map_results() 46 self._tc_map_results()
47 47
48 def startTest(self, test):
49 # Allow us to trigger the testcase buffer mode on a per test basis
50 # so stdout/stderr are only printed upon failure. Enables debugging
51 # but clean output
52 if hasattr(test, "buffer"):
53 self.buffer = True
54 super(OETestResult, self).startTest(test)
55
48 def _tc_map_results(self): 56 def _tc_map_results(self):
49 self.tc._results['failures'] = self.failures 57 self.tc._results['failures'] = self.failures
50 self.tc._results['errors'] = self.errors 58 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 1991be7d0c..1a8d12178d 100644
--- a/meta/lib/oeqa/selftest/cases/runqemu.py
+++ b/meta/lib/oeqa/selftest/cases/runqemu.py
@@ -14,6 +14,8 @@ class RunqemuTests(OESelftestTestCase):
14 14
15 image_is_ready = False 15 image_is_ready = False
16 deploy_dir_image = '' 16 deploy_dir_image = ''
17 # We only want to print runqemu stdout/stderr if there is a test case failure
18 buffer = True
17 19
18 def setUpLocal(self): 20 def setUpLocal(self):
19 super(RunqemuTests, self).setUpLocal() 21 super(RunqemuTests, self).setUpLocal()