Test Runtime
Description
Runtime code for the test suite execution, this code is not part of the OS and should not be included in user applications.
Define Documentation
#define DELAY_BETWEEN_TESTS 200 |
Delay inserted between test cases.
Definition at line 42 of file test.h.
#define TEST_NO_BENCHMARKS FALSE |
If TRUE
then benchmarks are not included.
Definition at line 49 of file test.h.
#define test_fail |
( |
point |
|
) |
|
Value:{ \
_test_fail(point); \
return; \
}
Test failure enforcement.
Definition at line 118 of file test.h.
#define test_assert |
( |
point, |
|
|
condition, |
|
|
msg |
|
) |
|
Value:{ \
if (_test_assert(point, condition)) \
return; \
}
Test assertion.
- Parameters:
-
[in] | point | numeric assertion identifier |
[in] | condition | a boolean expression that must be verified to be true |
[in] | msg | failure message |
Definition at line 130 of file test.h.
#define test_assert_sequence |
( |
point, |
|
|
expected |
|
) |
|
Value:{ \
if (_test_assert_sequence(point, expected)) \
return; \
}
Test sequence assertion.
- Parameters:
-
[in] | point | numeric assertion identifier |
[in] | expected | string to be matched with the tokens buffer |
Definition at line 141 of file test.h.
#define test_assert_time_window |
( |
point, |
|
|
start, |
|
|
end |
|
) |
|
Value:{ \
if (_test_assert_time_window(point, start, end)) \
return; \
}
Test time window assertion.
- Parameters:
-
[in] | point | numeric assertion identifier |
[in] | start | initial time in the window (included) |
[in] | end | final time in the window (not included) |
Definition at line 153 of file test.h.
Function Documentation
Prints a decimal unsigned number.
- Parameters:
-
[in] | n | the number to be printed |
void test_print |
( |
char * |
msgp |
) |
|
Prints a line without final end-of-line.
- Parameters:
-
void test_println |
( |
char * |
msgp |
) |
|
Prints a line.
- Parameters:
-
void test_emit_token |
( |
char |
token |
) |
|
Emits a token into the tokens buffer.
- Parameters:
-
[in] | token | the token as a char |
void test_terminate_threads |
( |
void |
|
) |
|
Pends a termination request in all the test-spawned threads.
void test_wait_threads |
( |
void |
|
) |
|
Waits for the completion of all the test-spawned threads.
void test_cpu_pulse |
( |
unsigned |
duration |
) |
|
CPU pulse.
- Note:
- The current implementation is not totally reliable.
- Parameters:
-
[in] | duration | CPU pulse duration in milliseconds |
Delays execution until next system time tick.
void test_start_timer |
( |
unsigned |
ms |
) |
|
Starts the test timer.
- Parameters:
-
[in] | ms | time in milliseconds |
msg_t TestThread |
( |
void * |
p |
) |
|
Test execution thread function.
- Parameters:
-
Variable Documentation
Set to TRUE
when the test timer reaches its deadline.
Definition at line 265 of file test.c.