summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
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-11-09 12:24:24 +0000
commita3a122d2f58a6e3a220c099b2e948d4b4b280c4e (patch)
tree91b0539dc9a027a5a58bdd9371c5e0874ec583c7 /meta/lib/oeqa
parent729b1d3afd3d4b8eed4a4f4ddeb27780db47dcd5 (diff)
downloadpoky-a3a122d2f58a6e3a220c099b2e948d4b4b280c4e.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: 86bef95bccbe9dad3dc3445ea365439861966179) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-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()