mirror of
https://git.yoctoproject.org/meta-zephyr
synced 2026-09-12 09:49:32 +02:00
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>
29 lines
1.0 KiB
Python
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)
|