Files
meta-zephyr/lib/oeqa/runtime/zephyr.py
Juro Bystricky a3f51b0ada testimage: performace 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>
2017-02-04 08:15:57 -08:00

29 lines
1.0 KiB
Python

import unittest
from oeqa.oetest import oeRuntimeTest
class ZephyrTest(oeRuntimeTest):
def test_boot_zephyr(self):
success = False
logfile = self.target.qemurunnerlog
while True:
line = self.target.serial_readline().decode("utf-8")
# 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)