summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Musat <george.l.musat@intel.com>2015-09-15 16:52:44 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-21 15:20:08 +0100
commit27138b2eeafa8b81f3020ad9d8a55263e636288c (patch)
treeb5d5025d267a27230a2d7efb433877fe50227bdf
parent2bc3d2e378da6555cf02ed46b1082643e1c0fe88 (diff)
downloadopenembedded-core-27138b2eeafa8b81f3020ad9d8a55263e636288c.tar.gz
openembedded-core-27138b2eeafa8b81f3020ad9d8a55263e636288c.tar.bz2
openembedded-core-27138b2eeafa8b81f3020ad9d8a55263e636288c.zip
oeqa/testimage: Enhance -v switch in testimage
When testimage is run with -v switch now individual test progress can be seen directly in bitbake console. [YOCTO #6841] Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/lib/oeqa/oetest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index a6f89b6a86..3816c1ae9b 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -106,6 +106,17 @@ def loadTests(tc, type="runtime"):
suites.sort(cmp=lambda a,b: cmp((a.depth, a.index), (b.depth, b.index)))
return testloader.suiteClass(suites)
+_buffer = ""
+
+def custom_verbose(msg, *args, **kwargs):
+ global _buffer
+ if msg[-1] != "\n":
+ _buffer += msg
+ else:
+ _buffer += msg
+ bb.plain(_buffer.rstrip("\n"), *args, **kwargs)
+ _buffer = ""
+
def runTests(tc, type="runtime"):
suite = loadTests(tc, type)
@@ -114,6 +125,8 @@ def runTests(tc, type="runtime"):
bb.note("Filter test cases by tags: %s" % tc.tagexp)
bb.note("Found %s tests" % suite.countTestCases())
runner = unittest.TextTestRunner(verbosity=2)
+ if bb.msg.loggerDefaultVerbose:
+ runner.stream.write = custom_verbose
result = runner.run(suite)
return result