Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <ksched.h>

Functions

void k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf)
 Fatal error policy handler.
 
void test_message_capture (void)
 This test case verifies when fatal error log message can be captured.
 
int main (void)
 

Variables

static volatile int expected_reason = -1
 

Function Documentation

◆ main()

int main ( void  )

◆ test_message_capture()

void test_message_capture ( void  )

This test case verifies when fatal error log message can be captured.

Test Objective:

  • When the fatal error is triggered, if the debugging message function is turned on, the system can capture the log information.

Prerequisite Conditions:

  • N/A

Input Specifications:

  • N/A

Test Procedure:

  1. Writing a function deliberately triggers a koops exception.
  2. When the log module is enabled, it will log some information in the process of exception.
  3. The regex in testcase.yaml verify the kernel will dump thread id information and error type when exception occurs.

Expected Test Result:

  • The expected log message is caught.

Pass/Fail Criteria:

  • Success if the log matching regex in step 3.
  • Failure if the log is not matching regex in step 3.

Assumptions and Constraints:

  • N/A

Variable Documentation

◆ expected_reason

volatile int expected_reason = -1
static