|
libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
Go to the source code of this file.
Data Structures | |
| struct | GblTestCase |
| struct | GblTestSuiteVTable |
| struct | GblTestSuiteClass |
| struct | GblTestSuite |
Macros | |
| #define | GBL_TEST_CASE_LAST |
Type System | |
Type UUID and cast operators | |
| #define | GBL_TEST_SUITE_TYPE |
| #define | GBL_TEST_SUITE(self) |
| #define | GBL_TEST_SUITE_CLASS(klass) |
| #define | GBL_TEST_SUITE_GET_CLASS(self) |
Typedefs | |
| typedef GBL_RESULT(* | GblTestCaseFn) (GblTestSuite *pSelf, GblContext *pCtx) |
Functions | |
| GblType | GblTestSuite_type (void) |
| GblType | GblTestSuite_register (const char *pName, const GblTestSuiteVTable *pVTable, size_t instanceSize, size_t instancePrivateSize, GblFlags typeFlags) |
Test Suite Creation | |
Methods for managing test suite lifetimes. | |
| GblTestSuite * | GblTestSuite_create (GblType type, const char *pName, const GblTestSuiteVTable *pVTable, size_t size, GblTestSuiteClass *pClass) |
| GblTestSuite * | GblTestSuite_ref (GblTestSuite *pSelf) |
| GblRefCount | GblTestSuite_unref (GblTestSuite *pSelf) |
Test Suite Properties | |
Methods providing accessors for test suite properties. | |
| const char * | GblTestSuite_name (const GblTestSuite *pSelf) |
| GblBool | GblTestSuite_ran (const GblTestSuite *pSelf) |
| GblBool | GblTestSuite_passed (const GblTestSuite *pSelf) |
| GblTestScenario * | GblTestSuite_scenario (const GblTestSuite *pSelf) |
| GBL_RESULT | GblTestSuite_result (const GblTestSuite *pSelf) |
Test Case Registration | |
Methods for adding test cases to the suite. | |
| GBL_RESULT | GblTestSuite_addCase (GblTestSuite *pSelf, const char *pName, GblTestCaseFn pFnTest) |
| GBL_RESULT | GblTestSuite_addCases (GblTestSuite *pSelf, const GblTestCase *pCases) |
Test Case Accessors | |
Methods for accessing test-case properties. | |
| GblBool | GblTestSuite_caseRan (const GblTestSuite *pSelf, const char *pCaseName) |
| GblBool | GblTestSuite_casePassed (const GblTestSuite *pSelf, const char *pCaseName) |
| size_t | GblTestSuite_caseCount (const GblTestSuite *pSelf) |
| const char * | GblTestSuite_caseName (const GblTestSuite *pSelf, size_t index) |
| size_t | GblTestSuite_caseIndex (const GblTestSuite *pSelf, const char *pCaseName) |
| GBL_RESULT | GblTestSuite_caseResult (const GblTestSuite *pSelf, size_t index) |
Test Execution | |
Methods for executing the test suite. | |
| GBL_RESULT | GblTestSuite_initSuite (GblTestSuite *pSelf, GblContext *pCtx) |
| GBL_RESULT | GblTestSuite_finalSuite (GblTestSuite *pSelf, GblContext *pCtx) |
| GBL_RESULT | GblTestSuite_initCase (GblTestSuite *pSelf, GblContext *pCtx) |
| GBL_RESULT | GblTestSuite_finalCase (GblTestSuite *pSelf, GblContext *pCtx) |
| GBL_RESULT | GblTestSuite_runCase (GblTestSuite *pSelf, GblContext *pCtx, size_t index) |
| GBL_RESULT | GblTestSuite_skipCase (GblTestSuite *pSelf, GblContext *pCtx, size_t index) |
GblTestSuite structure and related functions.
Definition in file gimbal_test_suite.h.
| #define GBL_TEST_SUITE_TYPE |
GblType UUID.
Definition at line 19 of file gimbal_test_suite.h.
| #define GBL_TEST_SUITE | ( | self | ) |
GblInstance cast operator.
Definition at line 20 of file gimbal_test_suite.h.
| #define GBL_TEST_SUITE_CLASS | ( | klass | ) |
GblClass cast operator.
Definition at line 21 of file gimbal_test_suite.h.
| #define GBL_TEST_SUITE_GET_CLASS | ( | self | ) |
GblInstance to GblClass operator.
Definition at line 22 of file gimbal_test_suite.h.
| #define GBL_TEST_CASE_LAST |
Convenience macro for NULL-terminating the test case list.
Definition at line 26 of file gimbal_test_suite.h.
| typedef GBL_RESULT(* GblTestCaseFn) (GblTestSuite *pSelf, GblContext *pCtx) |
Function signature for a single test case.
| pSelf | The owning GblTestSuite object pointer. |
| pCtx | The GblContext object for the test suite. |
Definition at line 43 of file gimbal_test_suite.h.
| GblType GblTestSuite_type | ( | void | ) |
Returns the GblType UUID associated with GblTestSuite.
| GblType GblTestSuite_register | ( | const char * | pName, |
| const GblTestSuiteVTable * | pVTable, | ||
| size_t | instanceSize, | ||
| size_t | instancePrivateSize, | ||
| GblFlags | typeFlags ) |
Registers a new GblType deriving from GBL_TEST_SUITE_TYPE.
| GblTestSuite * GblTestSuite_create | ( | GblType | type, |
| const char * | pName, | ||
| const GblTestSuiteVTable * | pVTable, | ||
| size_t | size, | ||
| GblTestSuiteClass * | pClass ) |
Creates a new GblTestSuite instance with the given properties (or defaults if not specified).
| GblTestSuite * GblTestSuite_ref | ( | GblTestSuite * | pSelf | ) |
Returns a new reference to the GblTestSuite, incrementing its reference count by 1.
| GblRefCount GblTestSuite_unref | ( | GblTestSuite * | pSelf | ) |
Decrements the refcount of the given GblTestSuite by 1, destroying it if it reaches 0.
| const char * GblTestSuite_name | ( | const GblTestSuite * | pSelf | ) |
Returns the string name of the test suite.
| GblBool GblTestSuite_ran | ( | const GblTestSuite * | pSelf | ) |
Returns GBL_TRUE if the test suite has been run and GBL_FALSE otherwise.
| GblBool GblTestSuite_passed | ( | const GblTestSuite * | pSelf | ) |
Returns GBL_TRUE if the test suite passed and GBL_FALSE otherwise.
| GblTestScenario * GblTestSuite_scenario | ( | const GblTestSuite * | pSelf | ) |
Returns the parent test scenario object or NULL if there isn't one.
| GBL_RESULT GblTestSuite_result | ( | const GblTestSuite * | pSelf | ) |
Returns the top-level aggregate result for the overall test suite.
| GBL_RESULT GblTestSuite_addCase | ( | GblTestSuite * | pSelf, |
| const char * | pName, | ||
| GblTestCaseFn | pFnTest ) |
Enqueues a single test case into the given test suite.
| GBL_RESULT GblTestSuite_addCases | ( | GblTestSuite * | pSelf, |
| const GblTestCase * | pCases ) |
Enqueues an array of cases, terminated by a final entry of all NULL values.
| GblBool GblTestSuite_caseRan | ( | const GblTestSuite * | pSelf, |
| const char * | pCaseName ) |
Returns whether the test case with the given name has run.
| GblBool GblTestSuite_casePassed | ( | const GblTestSuite * | pSelf, |
| const char * | pCaseName ) |
Returns whether the test case with the given name has passed.
| size_t GblTestSuite_caseCount | ( | const GblTestSuite * | pSelf | ) |
Returns the number of test cases within the given test suite.
| const char * GblTestSuite_caseName | ( | const GblTestSuite * | pSelf, |
| size_t | index ) |
Returns the name of the test case at the given index within the test suite.
| size_t GblTestSuite_caseIndex | ( | const GblTestSuite * | pSelf, |
| const char * | pCaseName ) |
Returns the index of the test case with the given name within the test suite.
| GBL_RESULT GblTestSuite_caseResult | ( | const GblTestSuite * | pSelf, |
| size_t | index ) |
Returns the result of the test case at the given index within the test suite.
| GBL_RESULT GblTestSuite_initSuite | ( | GblTestSuite * | pSelf, |
| GblContext * | pCtx ) |
Calls the top-level initialization function for the entire suite.
| GBL_RESULT GblTestSuite_finalSuite | ( | GblTestSuite * | pSelf, |
| GblContext * | pCtx ) |
Calls the top-level finalization function for the entire suite.
| GBL_RESULT GblTestSuite_initCase | ( | GblTestSuite * | pSelf, |
| GblContext * | pCtx ) |
Calls the case-level initialization function for the next test case.
| GBL_RESULT GblTestSuite_finalCase | ( | GblTestSuite * | pSelf, |
| GblContext * | pCtx ) |
Calls the case-level finalization function for the previous test case.
| GBL_RESULT GblTestSuite_runCase | ( | GblTestSuite * | pSelf, |
| GblContext * | pCtx, | ||
| size_t | index ) |
Runs the test case at index within the given suite, returning its result code.
| GBL_RESULT GblTestSuite_skipCase | ( | GblTestSuite * | pSelf, |
| GblContext * | pCtx, | ||
| size_t | index ) |
Skips the test case at index within the given suite.