5 extern bool const IS_TESTMOD;
7 void testmod_fatal_raise();
8 bool testmod_fatal_raised();
11 extern volatile int __testmod_r13;
12 extern volatile int __testmod_r14;
13 extern volatile int __testmod_r15;
15 __attribute__((always_inline))
16 inline void testmod_capture()
18 asm volatile (
"mov %0, r13" :
"=r"(__testmod_r13));
19 asm volatile (
"mov %0, r14" :
"=r"(__testmod_r14));
20 asm volatile (
"mov %0, r15" :
"=r"(__testmod_r15));
25 inline void testmod_return()
27 asm volatile (
"mov r13, %0" ::
"r"(__testmod_r13));
28 asm volatile (
"mov r14, %0" ::
"r"(__testmod_r14));
29 asm volatile (
"mov r15, %0" ::
"r"(__testmod_r15));
32 typedef void (*TestHandler)();
34 void testmod_load_next();
35 void __testmod_register__(TestHandler test_handler,
const char* name,
bool expect_fatal =
false);
38 #define _testmod_register_1(handler) DSC::__testmod_register__((handler), (#handler))
39 #define _testmod_register_2(handler, expect_fatal) DSC::__testmod_register__((handler), (#handler), (expect_fatal))
41 #define _ARG2(_0, _1, _2, ...) _2
42 #define NARG2(...) _ARG2(__VA_ARGS__, 2, 1, 0)
44 #define __testmod_register_N(N, ...) _testmod_register_ ## N (__VA_ARGS__)
45 #define _testmod_register_N(N, ...) __testmod_register_N(N, __VA_ARGS__)
46 #define testmod_register(...) _testmod_register_N(NARG2(__VA_ARGS__), __VA_ARGS__)
51 bool testmod_expected_fatal();
53 void testmod_report_success();
54 void testmod_report_fail();
56 void testmod_terminate();
58 extern void testmod_init();