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 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(), ack_timout_cb(), ack_transmission_done(), beacon_loss_timer_cb(), cancel_any_reception(), cca_start(), continue_deferred_transmission(), cpu_irq_leave_critical(), csma_backoff_calculation(), dispatch_event(), fifo_init(), flash_is_locked(), 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(), handle_incoming_msg(), handle_received_frame_irq(), handle_tx_end_irq(), hsmci_adtc_start(), hsmci_read_word(), hsmci_select_device(), hsmci_write_word(), hx8347a_get_pixel(), hx8347a_set_window(), ili9225_set_window(), 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(), mac_coord_realignment_command_tx_success(), mac_idle_trans(), mac_process_tal_data_ind(), mac_process_tal_tx_status(), mac_send_gts_ind(), mac_tx_gts_data(), main(), membag_init(), mxt_init(), nand_flash_raw_copy_block(), nand_flash_spare_scheme_read_extra(), nand_flash_spare_scheme_write_extra(), parse_mpdu(), pbuf_take_partial(), pdc_disable_transfer(), pdc_enable_transfer(), pdc_read_rx_counter(), pdc_read_rx_next_counter(), pdc_read_rx_next_ptr(), pdc_read_rx_ptr(), pdc_read_status(), pdc_read_tx_counter(), pdc_read_tx_next_counter(), pdc_read_tx_next_ptr(), pdc_read_tx_ptr(), pdc_rx_clear_cnt(), pdc_rx_init(), pdc_tx_init(), perform_cca_twice(), platform_process_rxdata(), 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(), print_temp(), process_data_ind_not_transient(), 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(), ser_fifo_init(), set_trx_state(), sleepmgr_get_sleep_mode(), sleepmgr_sleep(), slotted_csma_state_handling(), spi_master_setup_device(), start_ack_wait_timer(), start_beacon_loss_timer(), sw_timer_disable(), sw_timer_disable_callback(), sw_timer_enable(), sw_timer_enable_callback(), sw_timer_get_config_defaults(), sw_timer_init(), sw_timer_register_callback(), sw_timer_task(), sw_timer_unregister_callback(), switch_pll_on(), sysclk_enable_usb(), tal_pib_get(), tal_pib_set(), tal_reset(), tal_rx_enable(), tal_rx_frame_cb(), tal_task(), tal_trx_sleep(), tal_trx_wakeup(), tal_tx_frame(), 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(), trx_init(), trx_irq_awake_handler_cb(), trx_irq_handler_cb(), trx_reset(), twi_get_pdc_base(), tx_done(), tx_done_handling(), udd_ctrl_in_sent(), udi_cdc_comm_disable(), udi_cdc_data_disable(), udi_phdc_wait_metadata(), upload_frame(), win_create(), win_destroy(), win_get_area(), win_get_attributes(), win_hide(), win_inflate_area(), win_lower(), win_process_command_event(), win_process_events(), win_raise(), win_reparent(), win_set_area(), win_set_attributes(), win_show(), win_translate_win_to_root(), wtk_basic_frame_as_child(), wtk_basic_frame_create(), wtk_basic_frame_get_custom_data(), wtk_button_as_child(), wtk_button_create(), wtk_button_get_command(), wtk_button_handler(), wtk_button_size_hint(), wtk_check_box_as_child(), wtk_check_box_create(), wtk_check_box_get_command(), wtk_check_box_handler(), wtk_check_box_is_selected(), wtk_check_box_set(), wtk_check_box_size_hint(), wtk_check_box_toggle(), wtk_copy_string(), wtk_frame_as_child(), wtk_frame_as_parent(), wtk_frame_create(), wtk_frame_get_custom_data(), wtk_icon_button_as_child(), wtk_icon_button_create(), wtk_icon_button_get_command(), wtk_icon_button_handler(), wtk_icon_button_is_selected(), wtk_icon_button_select(), wtk_icon_button_size_hint(), wtk_icon_group_get_selected(), wtk_label_as_child(), wtk_label_change(), wtk_label_create(), wtk_label_handler(), wtk_label_size_hint(), wtk_plot_add_value(), wtk_plot_as_child(), wtk_plot_create(), wtk_plot_handler(), wtk_plot_set_colors(), wtk_plot_set_grid(), wtk_progress_bar_as_child(), wtk_progress_bar_create(), wtk_progress_bar_get_value(), wtk_progress_bar_handler(), wtk_progress_bar_set_colors(), wtk_progress_bar_set_value(), wtk_radio_button_as_child(), wtk_radio_button_create(), wtk_radio_button_get_command(), wtk_radio_button_handler(), wtk_radio_button_is_selected(), wtk_radio_button_select(), wtk_radio_button_size_hint(), wtk_radio_group_get_selected(), wtk_rescale_value(), wtk_slider_as_child(), wtk_slider_create(), wtk_slider_get_command(), wtk_slider_get_value(), wtk_slider_handler(), wtk_slider_is_moving(), and wtk_slider_set_value().