Test suite core declarations.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | test_case |
A test case. More... | |
struct | test_suite |
A test suite. More... | |
Macros | |
#define | Assert(expr) |
Assert() macro definition for unit testing. More... | |
Wrappers for printing debug information | |
| |
#define | dbg(__fmt_) printf_P(PROGMEM_STRING(__fmt_)) |
#define | dbg_info(__fmt_,...) printf_P(PROGMEM_STRING(__fmt_), __VA_ARGS__) |
#define | dbg_error(_x,...) printf_P(PROGMEM_STRING(_x), __VA_ARGS__) |
#define | dbg_putchar(c) putc(c, stdout) |
#define | dbg_vprintf_pgm(...) vfprintf_P(stdout, __VA_ARGS__) |
Test suite definition macros | |
#define | DEFINE_TEST_CASE(_sym, _setup, _run, _cleanup, _name) |
Create a test case struct. More... | |
#define | DEFINE_TEST_ARRAY(_sym) const struct test_case *const _sym[] |
Create an array of test case pointers. More... | |
#define | DEFINE_TEST_SUITE(_sym, _test_array, _name) |
Create a test suite. More... | |
Functions | |
void | test_case_fail (const struct test_case *test, int result, const char *file, unsigned int line, const char *fmt,...) |
Report a failure and jump out of current test case function. More... | |
Test suite interaction | |
int | test_suite_run (const struct test_suite *suite) |
Run a test suite. More... | |
Test data access | |
void * | test_priv_data |
Data pointer for test cases. More... | |
static void | test_set_data (void *data) |
Set private data pointer for the current test. More... | |
static void * | test_get_data (void) |
Get the private data pointer for the current test. More... | |
Test case pointer access | |
struct test_case * | test_case_ptr |
Pointer to current test case. More... | |
static void | test_set_case (const struct test_case *test) |
Set pointer to current test. More... | |
static struct test_case * | test_get_case (void) |
Get pointer to current test. More... | |
Test result reporting | |
#define | test_fail(test, result,...) test_case_fail(test, result, __FILE__, __LINE__, __VA_ARGS__) |
Fail the test. More... | |
#define | test_assert_true(test, condition,...) |
Verify that condition is true. More... | |
#define | test_assert_false(test, condition,...) test_assert_true(test, !(condition), __VA_ARGS__) |
Verify that condition is false. More... | |
enum | test_status { TEST_ERROR = -1, TEST_PASS = 0, TEST_FAIL = 1 } |
Status codes returned by test cases and fixtures. More... | |
#define Assert | ( | expr | ) |
Assert() macro definition for unit testing.
The Assert() macro is set up to use test_assert_true(), as this will only halt execution of the current test, allowing the remaining tests a chance to complete.
Referenced by _i2s_set_config(), cpu_irq_leave_critical(), genclk_enable_source(), i2s_clear_status(), i2s_disable_interrupt(), i2s_enable_interrupt(), i2s_get_config_defaults(), i2s_init(), i2s_read(), i2s_set_callback(), i2s_write(), pll_config_init(), pll_config_read(), pll_config_write(), pll_disable(), pll_enable(), pll_enable_config_defaults(), pll_enable_source(), pll_is_locked(), pll_wait_for_lock(), sleepmgr_get_sleep_mode(), sleepmgr_sleep(), sysclk_enable_usb(), uart_config_optical_interface(), uart_disable_optical_interface(), uart_enable_optical_interface(), uart_set_sleepwalking(), xdmac_channel_disable(), xdmac_channel_disable_interrupt(), xdmac_channel_enable(), xdmac_channel_enable_interrupt(), xdmac_channel_get_interrupt_mask(), xdmac_channel_get_interrupt_status(), xdmac_channel_get_status(), xdmac_channel_read_suspend(), xdmac_channel_readwrite_resume(), xdmac_channel_readwrite_suspend(), xdmac_channel_set_block_control(), xdmac_channel_set_config(), xdmac_channel_set_datastride_mempattern(), xdmac_channel_set_descriptor_addr(), xdmac_channel_set_descriptor_control(), xdmac_channel_set_destination_addr(), xdmac_channel_set_destination_microblock_stride(), xdmac_channel_set_microblock_control(), xdmac_channel_set_source_addr(), xdmac_channel_set_source_microblock_stride(), xdmac_channel_software_flush_request(), xdmac_channel_software_request(), xdmac_channel_write_suspend(), xdmac_configure_transfer(), xdmac_disable_interrupt(), xdmac_enable_interrupt(), xdmac_get_arbiter(), xdmac_get_config(), xdmac_get_interrupt_mask(), xdmac_get_interrupt_status(), xdmac_get_software_request_status(), and xdmac_get_type().