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 _sercom_default_handler(), _sercom_get_default_pad(), _sercom_get_sercom_inst_index(), _system_pinmux_config(), _uhd_ctrl_request_end(), _uhd_ep0_setup(), _uhd_ep0_transfer_complete(), _uhd_pipe_trans_complete(), _usart_read_buffer(), _usart_set_config(), _usart_write_buffer(), cpu_irq_leave_critical(), extint_chan_disable_callback(), extint_chan_enable_callback(), extint_chan_get_config_defaults(), extint_chan_set_config(), extint_disable_events(), extint_enable_events(), extint_nmi_get_config_defaults(), extint_nmi_set_config(), extint_register_callback(), extint_unregister_callback(), port_get_config_defaults(), port_group_get_input_level(), port_group_get_output_level(), port_group_set_config(), port_group_set_output_level(), port_group_toggle_output_level(), port_pin_set_config(), sleepmgr_get_sleep_mode(), sleepmgr_sleep(), system_apb_clock_clear_mask(), system_apb_clock_get_hz(), system_apb_clock_set_divider(), system_apb_clock_set_mask(), system_clock_init(), system_clock_source_dfll_get_config_defaults(), system_clock_source_disable(), system_clock_source_enable(), system_clock_source_osc32k_get_config_defaults(), system_clock_source_osc8m_get_config_defaults(), system_clock_source_write_calibration(), system_clock_source_xosc32k_get_config_defaults(), system_clock_source_xosc_get_config_defaults(), system_cpu_clock_set_divider(), system_flash_set_waitstates(), system_gclk_chan_disable(), system_gclk_chan_get_config_defaults(), system_gclk_chan_set_config(), system_gclk_gen_get_config_defaults(), system_gclk_gen_set_config(), system_interrupt_clear_pending(), system_interrupt_is_pending(), system_interrupt_set_pending(), system_interrupt_set_priority(), system_pinmux_get_config_defaults(), system_pinmux_get_group_from_gpio_pin(), system_pinmux_group_set_config(), system_pinmux_group_set_input_sample_mode(), system_voltage_reference_disable(), system_voltage_reference_enable(), uhc_enumeration_step12(), uhc_enumeration_step13(), uhc_notify_connection(), uhc_request_bos_desc(), uhd_get_speed(), uhd_setup_request(), uhi_hid_mouse_install(), uhi_hid_mouse_uninstall(), usart_abort_job(), usart_disable(), usart_disable_callback(), usart_disable_transceiver(), usart_enable(), usart_enable_callback(), usart_enable_transceiver(), usart_get_config_defaults(), usart_get_job_status(), usart_init(), usart_is_syncing(), usart_read_buffer_job(), usart_read_buffer_wait(), usart_read_job(), usart_read_wait(), usart_register_callback(), usart_reset(), usart_unregister_callback(), usart_write_buffer_job(), usart_write_buffer_wait(), usart_write_job(), usart_write_wait(), usb_device_disable_callback(), usb_device_enable_callback(), usb_device_endpoint_disable_callback(), usb_device_endpoint_enable_callback(), usb_device_endpoint_get_config_defaults(), usb_device_endpoint_read_buffer_job(), usb_device_endpoint_register_callback(), usb_device_endpoint_set_config(), usb_device_endpoint_setup_buffer_job(), usb_device_endpoint_unregister_callback(), usb_device_endpoint_write_buffer_job(), usb_device_register_callback(), usb_device_unregister_callback(), usb_disable(), usb_enable(), usb_get_config_defaults(), usb_get_state_machine_status(), usb_host_disable_callback(), usb_host_enable_callback(), usb_host_pipe_abort_job(), usb_host_pipe_disable_callback(), usb_host_pipe_enable_callback(), usb_host_pipe_get_config(), usb_host_pipe_get_config_defaults(), usb_host_pipe_lpm_job(), usb_host_pipe_read_job(), usb_host_pipe_register_callback(), usb_host_pipe_set_auto_zlp(), usb_host_pipe_set_config(), usb_host_pipe_setup_job(), usb_host_pipe_unregister_callback(), usb_host_pipe_write_job(), usb_host_register_callback(), usb_host_unregister_callback(), and usb_init().