mirror of
https://git.yoctoproject.org/meta-zephyr
synced 2026-09-14 06:49:32 +02:00
testimage: performance improvements
Refactored processing of QEMU logs. The original code read QEMU logs every 30 seconds, which resulted in each test taking at least 30 seconds to finish. In reality, most tests take only a few seconds. Although the tests run in parallel, on systems with only a few CPUs this can make a very noticable difference. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
This commit is contained in:
@@ -5,19 +5,25 @@ class ZephyrTest(oeRuntimeTest):
|
||||
|
||||
def test_boot_zephyr(self):
|
||||
success = False
|
||||
logfile = self.target.wait_for_serial(180, 30)
|
||||
logfile = self.target.qemurunnerlog
|
||||
while True:
|
||||
line = self.target.serial_readline().decode("utf-8")
|
||||
|
||||
with open(logfile) as f:
|
||||
for line in f:
|
||||
# All good
|
||||
if "PROJECT EXECUTION SUCCESSFUL" in line:
|
||||
success = True
|
||||
break
|
||||
# Most likely cause for faults is incorrectly compiled code
|
||||
if "***** USAGE FAULT *****" in line:
|
||||
success = False
|
||||
self.assertTrue(success, msg='***** USAGE FAULT *****" in file:///%s' % logfile)
|
||||
break
|
||||
# All good
|
||||
if "PROJECT EXECUTION SUCCESSFUL" in line:
|
||||
success = True
|
||||
break
|
||||
|
||||
if "PROJECT EXECUTION FAILED" in line:
|
||||
success = False
|
||||
self.assertTrue(success, msg='PROJECT EXECUTION FAILED in file:///%s' % logfile)
|
||||
break
|
||||
|
||||
# Most likely cause for faults is incorrectly compiled code
|
||||
if "***** USAGE FAULT *****" in line:
|
||||
success = False
|
||||
self.assertTrue(success, msg='***** USAGE FAULT *****" in file:///%s' % logfile)
|
||||
break
|
||||
|
||||
# test program finished, complain if no success message
|
||||
self.assertTrue(success, msg='"PROJECT EXECUTION SUCCESSFUL" not in file:///%s' % logfile)
|
||||
|
||||
Reference in New Issue
Block a user