CUnit Programmers Reference
3.0
|
Macros | |
#define | console_run_tests() CU_console_run_tests() |
Deprecated (version 1). More... | |
#define | IGNORE_RETURN(x) if(x){} |
Ignore return values in modern gcc. | |
Enumerations | |
enum | CU_STATUS { CU_STATUS_CONTINUE = 1 , CU_STATUS_MOVE_UP , CU_STATUS_STOP } |
Console interface status flag. More... | |
Functions | |
CU_EXPORT void | CU_console_run_tests (void) |
Run registered CUnit tests using the console interface. | |
static void | console_registry_level_run (CU_pTestRegistry pRegistry) |
Main loop for console interface. More... | |
static CU_STATUS | console_suite_level_run (CU_pSuite pSuite) |
Runs a selected suite within the console interface. More... | |
static CU_STATUS | console_set_options_run (void) |
Sets CUnit options interactively using console interface. More... | |
static CU_ErrorCode | console_run_all_tests (CU_pTestRegistry pRegistry) |
Runs all tests within the console interface. More... | |
static CU_ErrorCode | console_run_suite (CU_pSuite pSuite) |
Runs a specified suite within the console interface. More... | |
static CU_ErrorCode | console_run_single_test (CU_pSuite pSuite, CU_pTest pTest) |
( Runs a specific test for the specified suite within the console interface. More... | |
static void | console_test_start_message_handler (const CU_pTest pTest, const CU_pSuite pSuite) |
Handler function called at start of each test. More... | |
static void | console_test_complete_message_handler (const CU_pTest pTest, const CU_pSuite pSuite, const CU_pFailureRecord pFailure) |
Handler function called at completion of each test. More... | |
static void | console_all_tests_complete_message_handler (const CU_pFailureRecord pFailure) |
Handler function called at completion of all tests in a suite. More... | |
static void | console_suite_init_failure_message_handler (const CU_pSuite pSuite) |
Handler function called when suite initialization fails. More... | |
static void | console_suite_cleanup_failure_message_handler (const CU_pSuite pSuite) |
Handler function called when suite cleanup fails. More... | |
static CU_ErrorCode | select_test (CU_pSuite pSuite, CU_pTest *ppTest) |
Reads the number of a test from standard input and locates the test at that position. More... | |
static CU_ErrorCode | select_suite (CU_pTestRegistry pRegistry, CU_pSuite *ppSuite) |
Reads the number of a suite from standard input and locates the suite at that position. More... | |
static void | list_suites (CU_pTestRegistry pRegistry) |
Lists the suites in a registry to standard output. More... | |
static void | list_tests (CU_pSuite pSuite) |
Lists the tests in a suite to standard output. More... | |
static void | show_failures (void) |
Displays the record of test failures on standard output. | |
Variables | |
static CU_pSuite | f_pRunningSuite = NULL |
Pointer to the currently running suite. | |
static size_t | f_yes_width = 0 |
Common width measurements for output formatting. | |
#define console_run_tests | ( | ) | CU_console_run_tests() |
Deprecated (version 1).
enum CU_STATUS |
|
static |
Handler function called at completion of all tests in a suite.
pFailure | Pointer to the test failure record list. |
References CU_print_run_results().
|
static |
Main loop for console interface.
Displays actions and responds based on user imput. If pRegistry is NULL, will use the default internal CUnit test registry.
pRegistry | The CU_pTestRegistry to use for testing. |
References CU_STATUS_CONTINUE.
|
static |
Runs all tests within the console interface.
The test registry is changed to the specified registry before running the tests, and reset to the original registry when done. If pRegistry is NULL, the default internal CUnit test registry is used.
pRegistry | The CU_pTestRegistry containing the tests to be run. |
References CU_run_all_tests(), CU_set_registry(), and f_pRunningSuite.
|
static |
( Runs a specific test for the specified suite within the console interface.
pSuite | The suite containing the test to be run (non-NULL). |
pTest | The test to be run (non-NULL). |
References CU_run_test(), and f_pRunningSuite.
|
static |
Runs a specified suite within the console interface.
pSuite | The suite to be run (non-NULL). |
References CU_run_suite(), and f_pRunningSuite.
|
static |
Sets CUnit options interactively using console interface.
Displays actions and responds based on user imput.
References CU_STATUS_CONTINUE.
|
static |
Handler function called when suite cleanup fails.
pSuite | The suite for which cleanup failed. |
References CU_Suite::pName.
|
static |
Handler function called when suite initialization fails.
pSuite | The suite for which initialization failed. |
References CU_Suite::pName.
Runs a selected suite within the console interface.
Displays actions and responds based on user imput.
pSuite | The suite to use for testing (non-NULL). |
References CU_STATUS_CONTINUE, and CU_Suite::pName.
|
static |
Handler function called at completion of each test.
pTest | The test being run. |
pSuite | The suite containing the test. |
pFailure | Pointer to the 1st failure record for this test. |
|
static |
Handler function called at start of each test.
pTest | The test being run. |
pSuite | The suite containing the test. |
References f_pRunningSuite, CU_Test::pName, and CU_Suite::pName.
|
static |
Lists the suites in a registry to standard output.
pRegistry | The CU_pTestRegistry to query (non-NULL). |
References CU_get_registry(), and CU_TestRegistry::uiNumberOfSuites.
|
static |
Lists the tests in a suite to standard output.
pSuite | The suite to query (non-NULL). |
References CU_Suite::pName, and CU_Suite::uiNumberOfTests.
|
static |
Reads the number of a suite from standard input and locates the suite at that position.
If pRegistry is NULL, the default CUnit registry will be used. The located pSuite is returned in ppSuite. ppSuite will be NULL if there is no suite in the registry having the input name. Returns NULL if the suite is successfully located, non-NULL otherwise.
pRegistry | The CU_pTestRegistry to query. If NULL, use the default internal CUnit test registry. |
ppSuite | Pointer to location to store the selected suite. |
References CU_get_registry(), and CU_TestRegistry::uiNumberOfSuites.
|
static |
Reads the number of a test from standard input and locates the test at that position.
A pointer to the located test is stored in ppTest upon return.
pSuite | The suite to be queried. |
ppTest | Pointer to location to store the selected test. |
References CU_Suite::pName, and CU_Suite::uiNumberOfTests.