CUnit Programmers Reference
3.0
|
Data Structures | |
struct | CU_CI_named_test |
Define a test with a name. More... | |
Macros | |
#define | CU_CI_FIXTURE_QUIET() (void)(__cu_suite_setup || __cu_suite_teardown || __cu_test_setup || __cu_test_teardown ); |
ifndef NO_CU_CI_AUTO_PREMAIN More... | |
#define | CU_CI_RUN_SUITES() CU_CI_main(argc, argv); |
Run all registered tests and save a junit xml report in the current working directory Exit non-zero if any tests/setup/teardown or asserts have failed. | |
#define | CU_CI_RUN() |
Run all registered suites in sorted order, save a junit xml report in the current dir and return the cunit exit status (0 for no-errors);. | |
#define | CU_CI_DEFINE_SUITE(name, init, clean, setup, teardown) |
Set the current suite including any setup/teardown functions. More... | |
#define | CUNIT_CI_TEST(test) CU_CI_add_test(#test, test) |
Add a new test to the current suite. More... | |
#define | CU_CI_SUITE_H(suitename) void suitename(void); |
Define a suite export function in a header, for use with CU_CI_SUITE() | |
#define | CU_CI_SUITE_REGISTER(_suitename, ...) |
Register the suite definition for the current file. | |
#define | CU_CI_SUITE(_suitename, ...) |
Set an auto exported suite definition function for the current file. More... | |
#define | CU_CI_USE_SUITE(suite) CU_CI_FIXTURE_QUIET(); void cu_suite_ ## suite(void); cu_suite_ ## suite() |
Register a cunit suite defined with CU_CI_SUITE. | |
#define | CU_SUITE_SETUP() |
Define a suite setup routine. | |
#define | CU_SUITE_TEARDOWN() |
Define a suite cleanup routine. | |
#define | CU_TEST_SETUP() |
Define a pre test setup routine. | |
#define | CU_TEST_TEARDOWN() |
Define a post test cleanup routine. | |
#define | CUNIT_CI_RUN(_suitename, ...) |
Run the given tests as part of a single exe suite. | |
#define | CUNIT_CI_CLEAR_SETUPS() |
Silence compiler warnings about unused test fixture variables. | |
Typedefs | |
typedef struct CU_CI_named_test | CU_CI_named_test |
Define a test with a name. | |
Functions | |
CU_EXPORT void | CU_CI_args (int *argc, char ***argv) |
Obtain the command line arguments and count that was passed to CU_CI_main() More... | |
CU_EXPORT int | CU_CI_main (int argc, char **argv) |
Main Entry point to CI mode of CUnit. More... | |
CU_EXPORT void | CU_CI_add_suite (const char *name, CU_InitializeFunc init, CU_CleanupFunc clean, CU_SetUpFunc setup, CU_TearDownFunc teardown) |
Add a suite to CUnit CI. More... | |
CU_EXPORT void | CU_CI_add_test (const char *name, CU_TestFunc test) |
Add a test to the current CUnit CI suite. More... | |
#define CU_CI_DEFINE_SUITE | ( | name, | |
init, | |||
clean, | |||
setup, | |||
teardown | |||
) |
Set the current suite including any setup/teardown functions.
name | the suite name |
init | suite setup function |
clean | suite teardown function |
setup | test setup function |
teardown | test teardown function |
#define CU_CI_FIXTURE_QUIET | ( | ) | (void)(__cu_suite_setup || __cu_suite_teardown || __cu_test_setup || __cu_test_teardown ); |
ifndef NO_CU_CI_AUTO_PREMAIN
Silence warnings about unused fixture functions
#define CU_CI_SUITE | ( | _suitename, | |
... | |||
) |
Set an auto exported suite definition function for the current file.
For use with suites defined in multiple source files via CU_CI_ADD_SUITE(name) and compilers that support attribute((constructor)) and modern MSVC
#define CUNIT_CI_TEST | ( | test | ) | CU_CI_add_test(#test, test) |
Add a new test to the current suite.
test | the test function to call. |
CU_EXPORT void CU_CI_add_suite | ( | const char * | name, |
CU_InitializeFunc | init, | ||
CU_CleanupFunc | clean, | ||
CU_SetUpFunc | setup, | ||
CU_TearDownFunc | teardown | ||
) |
Add a suite to CUnit CI.
name | suite name |
init | optional suite setup function |
clean | optional suite cleanup function |
setup | optional per test setup function |
teardown | optional per test cleanup function |
References CU_add_suite_with_setup_and_teardown(), CU_initialize_registry(), CU_registry_initialized(), and CUE_SUCCESS.
CU_EXPORT void CU_CI_add_test | ( | const char * | name, |
CU_TestFunc | test | ||
) |
Add a test to the current CUnit CI suite.
name | test name |
test | test function |
References CU_add_test().
CU_EXPORT void CU_CI_args | ( | int * | argc, |
char *** | argv | ||
) |
Obtain the command line arguments and count that was passed to CU_CI_main()
argc | |
argv |
CU_EXPORT int CU_CI_main | ( | int | argc, |
char ** | argv | ||
) |
Main Entry point to CI mode of CUnit.
argc | command line args count |
argv | vector of command line args |
References CU_get_registry(), CU_print_all_suite_tests(), and CUE_SUCCESS.