CUnit Programmers Reference  3.0
Macros | Functions
CI

Macros

#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.
 
#define CU_CI_DEFINE_SUITE(name, init, clean, setup, teardown)   CU_CI_add_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_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()
 Disable CUCI setup/teardown and silence compiler warnings about unused variables.
 

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...
 

Detailed Description

Macro Definition Documentation

◆ CU_CI_DEFINE_SUITE

#define CU_CI_DEFINE_SUITE (   name,
  init,
  clean,
  setup,
  teardown 
)    CU_CI_add_suite(name, init, clean, setup, teardown)

Set the current suite including any setup/teardown functions.

Parameters
namethe suite name
initsuite setup function
cleansuite teardown function
setuptest setup function
teardowntest teardown function

◆ CUNIT_CI_TEST

#define CUNIT_CI_TEST (   test)    CU_CI_add_test(#test, test)

Add a new test to the current suite.

Parameters
testthe test function to call.

Function Documentation

◆ CU_CI_add_suite()

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.

Parameters
namesuite name
initoptional suite setup function
cleanoptional suite cleanup function
setupoptional per test setup function
teardownoptional per test cleanup function

References CU_add_suite_with_setup_and_teardown(), CU_initialize_registry(), CU_registry_initialized(), and CUE_SUCCESS.

◆ CU_CI_add_test()

CU_EXPORT void CU_CI_add_test ( const char *  name,
CU_TestFunc  test 
)

Add a test to the current CUnit CI suite.

Parameters
nametest name
testtest function

References CU_add_test().

◆ CU_CI_args()

CU_EXPORT void CU_CI_args ( int *  argc,
char ***  argv 
)

Obtain the command line arguments and count that was passed to CU_CI_main()

Parameters
argc
argv

◆ CU_CI_main()

CU_EXPORT int CU_CI_main ( int  argc,
char **  argv 
)

Main Entry point to CI mode of CUnit.

Parameters
argccommand line args count
argvvector of command line args
Returns
non-zero on test failure