11#include <CppUTest/CommandLineTestRunner.h>
31 #if CPPUTEST_HAVE_EXCEPTIONS
41 SimpleString what =
"Assertion failed!\n";
47 what += StringFrom(line);
49 CHECK_TEXT(
false, what.asCharString());
62 SimpleString what =
"Kernel panic!\n";
64 what += StringFrom(
id);
66 CHECK_TEXT(
false, what.asCharString());
115 int32_t result = RUN_ALL_TESTS(argc, argv);
int main(int argc, char **argv)
void STK_ASSERT_HANDLER(const char *message, const char *file, int32_t line)
void(* g_RelaxCpuHandler)()
__stk_relax_cpu handler.
void STK_PANIC_HANDLER_DEFAULT(EKernelPanicId id)
Default panic handler: disable interrupts, record the id, and spin in a tight loop — a defined,...
Namespace of STK package.
EKernelPanicId
Identifies the source of a kernel panic.
@ KERNEL_PANIC_NONE
Panic is absent (no fault).
void SetTls(Word tp)
Write raw thread-pointer (TP) register used as per-task TLS storage.
Word GetTls()
Read raw thread-pointer (TP) register used as per-task TLS storage.
bool IsInsideISR()
Check whether the CPU is currently executing inside a hardware interrupt service routine (ISR).
Namespace of the test inventory.
TestContext g_TestContext
Global instance of the TestContext.
IKernelService * g_KernelService
int32_t g_CriticalSectionState
Critical section state.
EKernelPanicId g_PanicValue
Panic value.
bool g_InsideISR
ISR state.
static void Exit()
Exit a critical section.
static void Enter()
Enter a critical section.
void Lock()
Acquire SpinLock, blocking until it is available.
void Unlock()
Release SpinLock, allowing another thread or core to acquire it.
Interface for the kernel services exposed to the user processes during run-time when Kernel started s...
static IKernelService * GetInstance()
Get CPU-local instance of the kernel service.
Throwable class for catching assertions from STK_ASSERT_HANDLER().
Common context for a test suite.
static void ShowTestSuitePrologue()
Show text string as prologue before tests start.
static void ShowTestSuiteEpilogue(int32_t result)
Show text string as epilogue after tests end.