30#if !defined(DELAY_BETWEEN_TESTS)
31#define DELAY_BETWEEN_TESTS 200
37#if !defined(TEST_NO_BENCHMARKS)
38#define TEST_NO_BENCHMARKS FALSE
44#if defined(CH_ARCHITECTURE_AVR) || defined(CH_ARCHITECTURE_MSP430)
45#define THREADS_STACK_SIZE 48
46#elif defined(CH_ARCHITECTURE_STM8)
47#define THREADS_STACK_SIZE 64
48#elif defined(CH_ARCHITECTURE_SIMIA32)
49#define THREADS_STACK_SIZE 512
51#define THREADS_STACK_SIZE 128
53#define WA_SIZE THD_WA_SIZE(THREADS_STACK_SIZE)
68 WORKING_AREA(T0, THREADS_STACK_SIZE);
69 WORKING_AREA(T1, THREADS_STACK_SIZE);
70 WORKING_AREA(T2, THREADS_STACK_SIZE);
71 WORKING_AREA(T3, THREADS_STACK_SIZE);
72 WORKING_AREA(T4, THREADS_STACK_SIZE);
94#if CH_DBG_THREADS_PROFILING
107#define test_fail(point) { \
119#define test_assert(point, condition, msg) { \
120 if (_test_assert(point, condition)) \
131#define test_assert_lock(point, condition, msg) { \
133 if (_test_assert(point, condition)) { \
146#define test_assert_sequence(point, expected) { \
147 if (_test_assert_sequence(point, expected)) \
158#define test_assert_time_window(point, start, end) { \
159 if (_test_assert_time_window(point, start, end)) \
163#if !defined(__DOXYGEN__)
164extern Thread *
threads[MAX_THREADS];
166extern void * ROMCONST
wa[];
Thread * threads[MAX_THREADS]
bool _test_fail(unsigned point)
void test_wait_threads(void)
Waits for the completion of all the test-spawned threads.
void test_printn(uint32_t n)
Prints a decimal unsigned number.
msg_t TestThread(void *p)
Test execution thread function.
bool _test_assert_sequence(unsigned point, char *expected)
void test_cpu_pulse(unsigned duration)
CPU pulse.
void test_terminate_threads(void)
Sets a termination request in all the test-spawned threads.
void test_emit_token(char token)
Emits a token into the tokens buffer.
systime_t test_wait_tick(void)
Delays execution until next system time tick.
void test_start_timer(unsigned ms)
Starts the test timer.
bool _test_assert(unsigned point, bool condition)
void test_print(const char *msgp)
Prints a line without final end-of-line.
bool test_timer_done
Set to TRUE when the test timer reaches its deadline.
bool _test_assert_time_window(unsigned point, systime_t start, systime_t end)
void test_println(const char *msgp)
Prints a line.
Structure representing a test case.
void(* execute)(void)
Test case execution function.
const char * name
Test case name.
void(* setup)(void)
Test case preparation function.
void(* teardown)(void)
Test case clean up function.
struct test_buffers::@28 wa
uint8_t buffer[WA_SIZE *5]