CUnit Programmers Reference
3.0
|
CUnit suite data type. More...
#include <TestDB.h>
Data Fields | |
char * | pName |
Suite name. | |
CU_BOOL | fActive |
Flag for whether suite is executed during a run. | |
CU_pTest | pTest |
Pointer to the 1st test in the suite. | |
CU_InitializeFunc | pInitializeFunc |
Pointer to the suite initialization function. | |
CU_CleanupFunc | pCleanupFunc |
Pointer to the suite cleanup function. | |
CU_SetUpFunc | pSetUpFunc |
Pointer to the test SetUp function. | |
CU_TearDownFunc | pTearDownFunc |
Pointer to the test TearDown function. | |
CU_pTest | pInitializeFuncTest |
Pointer to the "test" entry representing suite setup. | |
CU_pTest | pCleanupFuncTest |
Pointer to the "test" entry representing suite cleanup. | |
unsigned int | uiNumberOfTests |
Number of tests in the suite. | |
struct CU_Suite * | pNext |
Pointer to the next suite in linked list. | |
struct CU_Suite * | pPrev |
Pointer to the previous suite in linked list. | |
unsigned int | uiNumberOfTestsFailed |
Number of failed tests in the suite. | |
unsigned int | uiNumberOfTestsSuccess |
Number of success tests in the suite. | |
CU_BOOL | fSetUpError |
Flag set if the suite setup function failed a CU_ASSERT. | |
CU_BOOL | fCleanupError |
Flag set if the suite cleanup function failed a CU_ASSERT. | |
CU_BOOL | fInSetUp |
Flag set if we are running the suite setup function. | |
CU_BOOL | fInClean |
Flag set if we are running the suite cleanup function. | |
CU_BOOL | fSkipped |
Flag for whether the suite was skipped during a run. | |
CU_BOOL | fInTestSetup |
Flag set if we are running a test setup function. | |
CU_BOOL | fInTestClean |
Flag set if we are running a test teardown function. | |
double | dEnded |
clock time suite started | |
CUnit suite data type.
CU_Suite is a linked list of CU_Test containers. Each suite has a name, a count of registered unit tests, and a flag for whether the suite is active during test runs. It also holds pointers to optional initialization and cleanup functions. If non-NULL, these are called before and after running the suite's tests, respectively. In addition, the suite holds a pointer to the head of the linked list of associated CU_Test objects. Finally, pointers to the next and previous suites in the linked list are maintained.
Generally, the linked list includes suites which are associated with each other in a CU_TestRegistry. As a result, suites are run in the order in which they are registered (see CU_add_suite()).
It is recommended that name of each CU_Suite in a test registry have a unique name. Otherwise, only the first-registered suite having a given name will be accessible by name. There are no restrictions on the contained tests. This means that the same CU_Test could, in principle, be run more than once fron different suites.