sanitycheck: simplify fault detection
Any fatal error will print "ZEPHYR FATAL ERROR" now, so we don't have to maintain a set of strings in the sanitycheck harness.py Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
96571a8c40
commit
81ef42d2bc
2 changed files with 8 additions and 14 deletions
|
@ -99,6 +99,9 @@ void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
||||||
{
|
{
|
||||||
struct k_thread *thread = k_current_get();
|
struct k_thread *thread = k_current_get();
|
||||||
|
|
||||||
|
/* sanitycheck looks for the "ZEPHYR FATAL ERROR" string, don't
|
||||||
|
* change it without also updating sanitycheck
|
||||||
|
*/
|
||||||
z_fatal_print(">>> ZEPHYR FATAL ERROR %d: %s", reason,
|
z_fatal_print(">>> ZEPHYR FATAL ERROR %d: %s", reason,
|
||||||
reason_to_str(reason));
|
reason_to_str(reason));
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,7 @@ result_re = re.compile("(PASS|FAIL|SKIP) - (test_)?(.*)")
|
||||||
class Harness:
|
class Harness:
|
||||||
GCOV_START = "GCOV_COVERAGE_DUMP_START"
|
GCOV_START = "GCOV_COVERAGE_DUMP_START"
|
||||||
GCOV_END = "GCOV_COVERAGE_DUMP_END"
|
GCOV_END = "GCOV_COVERAGE_DUMP_END"
|
||||||
FAULTS = [
|
FAULT = "ZEPHYR FATAL ERROR"
|
||||||
"Unknown Fatal Error",
|
|
||||||
"MPU FAULT",
|
|
||||||
"Kernel Panic",
|
|
||||||
"Kernel OOPS",
|
|
||||||
"BUS FAULT",
|
|
||||||
"CPU Page Fault"
|
|
||||||
]
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.state = None
|
self.state = None
|
||||||
|
@ -72,9 +65,8 @@ class Console(Harness):
|
||||||
self.state = "passed"
|
self.state = "passed"
|
||||||
|
|
||||||
if self.fail_on_fault:
|
if self.fail_on_fault:
|
||||||
for fault in self.FAULTS:
|
if self.FAULT in line:
|
||||||
if fault in line:
|
self.fault = True
|
||||||
self.fault = True
|
|
||||||
|
|
||||||
if self.GCOV_START in line:
|
if self.GCOV_START in line:
|
||||||
self.capture_coverage = True
|
self.capture_coverage = True
|
||||||
|
@ -107,9 +99,8 @@ class Test(Harness):
|
||||||
self.state = "failed"
|
self.state = "failed"
|
||||||
|
|
||||||
if self.fail_on_fault:
|
if self.fail_on_fault:
|
||||||
for fault in self.FAULTS:
|
if self.FAULT in line:
|
||||||
if fault in line:
|
self.fault = True
|
||||||
self.fault = True
|
|
||||||
|
|
||||||
if self.GCOV_START in line:
|
if self.GCOV_START in line:
|
||||||
self.capture_coverage = True
|
self.capture_coverage = True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue