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 | ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0])) |
Convenience macro for counting elements in arrays. More... | |
#define | Assert(expr) |
Assert() macro definition for unit testing. More... | |
Wrappers for printing debug information | |
| |
#define | dbg(__fmt_) printf(__fmt_) |
#define | dbg_info(__fmt_,...) printf(__fmt_, __VA_ARGS__) |
#define | dbg_error(_x,...) printf(_x, __VA_ARGS__) |
#define | dbg_putchar(c) putc(c, stdout) |
#define | dbg_vprintf_pgm(...) vfprintf(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(), acc_disable(), acc_disable_interrupt(), acc_enable(), acc_enable_interrupt(), acc_get_comparison_result(), acc_get_interrupt_status(), acc_get_writeprotect_status(), acc_init(), acc_reset(), acc_set_input(), acc_set_output(), acc_set_writeprotect(), aes_get_config_defaults(), aes_get_pdc_base(), aes_init(), aes_read_output_data(), aes_set_callback(), aes_set_config(), aes_write_initvector(), aes_write_input_data(), aes_write_key(), afec_ch_get_config_defaults(), afec_ch_sanity_check(), afec_disable(), afec_enable(), afec_get_config_defaults(), afec_init(), afec_set_callback(), afec_temp_sensor_get_config_defaults(), afec_temp_sensor_set_config(), cpu_irq_leave_critical(), fifo_init(), flash_is_locked(), func_transmit(), genclk_enable_source(), gfx_draw_char(), gfx_draw_char_hugemem(), gfx_draw_char_progmem(), gfx_draw_progmem_string_aligned(), gfx_draw_string_aligned(), gfx_generic_draw_bitmap_tiled(), gfx_generic_get_pixmap(), gfx_generic_put_bitmap(), gfx_generic_put_pixmap(), gfx_get_progmem_string_bounding_box(), gfx_get_string_bounding_box(), hsmci_adtc_start(), hsmci_read_word(), hsmci_select_device(), hsmci_write_word(), hx8347a_get_pixel(), hx8347a_set_window(), i2s_clear_status(), i2s_disable_interrupt(), i2s_enable_interrupt(), i2s_get_config_defaults(), i2s_init(), i2s_read(), i2s_set_callback(), i2s_write(), icm_set_callback(), ili9325_copy_pixels_to_screen(), ili9325_copy_raw_pixel_24bits_to_screen(), ili9325_duplicate_pixel(), ili9325_get_pixel(), ili9325_set_window(), ili9325_write_gram(), ili9341_copy_pixels_from_screen(), ili9341_copy_pixels_to_screen(), ili9341_duplicate_pixel(), ili9341_write_gram(), ili93xx_copy_pixels_to_screen(), ili93xx_copy_raw_pixel_24bits_to_screen(), ili93xx_duplicate_pixel(), ili93xx_get_pixel(), ili93xx_set_window(), ili9488_get_pixel(), main(), mcan_get_config_defaults(), mcan_init(), membag_init(), mxt_init(), pbuf_take_partial(), 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(), rstc_assert_reset_of_coprocessor(), rstc_disable_user_reset(), rstc_disable_user_reset_interrupt(), rstc_enable_user_reset(), rstc_enable_user_reset_interrupt(), rstc_set_external_reset(), sd_mmc_select_slot(), sd_mmc_start_read_blocks(), sd_mmc_start_write_blocks(), sleepmgr_get_sleep_mode(), sleepmgr_sleep(), spi_master_setup_device(), sysclk_enable_usb(), tc_disable_interrupt(), tc_disable_qdec_interrupt(), tc_enable_interrupt(), tc_enable_qdec_interrupt(), tc_get_feature(), tc_get_interrupt_mask(), tc_get_qdec_interrupt_mask(), tc_get_qdec_interrupt_status(), tc_get_status(), tc_get_version(), tc_init(), tc_init_2bit_gray(), tc_read_cv(), tc_read_ra(), tc_read_rb(), tc_read_rc(), tc_set_block_mode(), tc_set_writeprotect(), tc_start(), tc_stop(), tc_sync_trigger(), tc_write_ra(), tc_write_rb(), tc_write_rc(), time_tick_init(), translate_address(), transmit_mode_sync(), twihs_get_pdc_base(), udd_ctrl_in_sent(), udi_cdc_comm_disable(), udi_cdc_data_disable(), udi_phdc_wait_metadata(), uhc_enumeration_step12(), uhc_enumeration_step13(), uhc_notify_connection(), uhd_ctrl_interrupt(), uhd_ctrl_phase_setup(), uhd_ep_alloc(), uhd_get_speed(), uhd_interrupt(), uhd_pipe_interrupt(), uhd_setup_request(), uhi_aoa_install(), uhi_cdc_install(), uhi_hid_mouse_install(), uhi_hid_mouse_uninstall(), uhi_msc_cbw_sent(), uhi_msc_enable(), uhi_msc_enable_step2(), uhi_vendor_install(), 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().