summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
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-23 09:52:55 +0100
commitbbe06b443bc6dcd845feac65a8ca43151ffc4b44 (patch)
tree434a7b71e1a4ba15e65abdfc6ebeeb7f01fb3edf /meta/lib/oeqa/oetest.py
parente0b38f20a8627a056bb0ccc350a0d155d54f3c44 (diff)
downloadpoky-bbe06b443bc6dcd845feac65a8ca43151ffc4b44.tar.gz
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] (From OE-Core rev: 27138b2eeafa8b81f3020ad9d8a55263e636288c) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-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"):
106 suites.sort(cmp=lambda a,b: cmp((a.depth, a.index), (b.depth, b.index))) 106 suites.sort(cmp=lambda a,b: cmp((a.depth, a.index), (b.depth, b.index)))
107 return testloader.suiteClass(suites) 107 return testloader.suiteClass(suites)
108 108
109_buffer = ""
110
111def custom_verbose(msg, *args, **kwargs):
112 global _buffer
113 if msg[-1] != "\n":
114 _buffer += msg
115 else:
116 _buffer += msg
117 bb.plain(_buffer.rstrip("\n"), *args, **kwargs)
118 _buffer = ""
119
109def runTests(tc, type="runtime"): 120def runTests(tc, type="runtime"):
110 121
111 suite = loadTests(tc, type) 122 suite = loadTests(tc, type)
@@ -114,6 +125,8 @@ def runTests(tc, type="runtime"):
114 bb.note("Filter test cases by tags: %s" % tc.tagexp) 125 bb.note("Filter test cases by tags: %s" % tc.tagexp)
115 bb.note("Found %s tests" % suite.countTestCases()) 126 bb.note("Found %s tests" % suite.countTestCases())
116 runner = unittest.TextTestRunner(verbosity=2) 127 runner = unittest.TextTestRunner(verbosity=2)
128 if bb.msg.loggerDefaultVerbose:
129 runner.stream.write = custom_verbose
117 result = runner.run(suite) 130 result = runner.run(suite)
118 131
119 return result 132 return result