2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#ifndef GIMBAL_TEST_SCENARIO_H
22#define GIMBAL_TEST_SCENARIO_H
24#include "../meta/instances/gimbal_context.h"
25#include "../meta/signals/gimbal_signal.h"
28
29
30
31#define GBL_TEST_SCENARIO_TYPE GBL_TYPEID(GblTestScenario)
32#define GBL_TEST_SCENARIO(self) GBL_CAST
(GblTestScenario, self)
33#define GBL_TEST_SCENARIO_CLASS(klass) GBL_CLASS_CAST
(GblTestScenario, klass)
34#define GBL_TEST_SCENARIO_CLASSOF(self) GBL_CLASSOF
(GblTestScenario, self)
37#define GBL_SELF_TYPE GblTestScenario
45
46
47
48
49
50
51
52
53
54
55
56
63 GBL_RESULT (*pFnRun) (
GBL_SELF,
int argc,
const char* argv[]);
65 GBL_RESULT (*pFnSuiteBegin)(
GBL_SELF,
const GblTestSuite* pSuite);
67 GBL_RESULT (*pFnSuiteEnd) (
GBL_SELF,
const GblTestSuite* pSuite);
71
72
73
74
75
76
77
78
79
80
81
114 (suiteBegan, (GBL_INSTANCE_TYPE, pSuite)),
115 (suiteEnded, (GBL_INSTANCE_TYPE, pSuite)),
116 (caseBegan, (GBL_INSTANCE_TYPE, pSuite), (GBL_SIZE_TYPE, caseIndex)),
117 (caseEnded, (GBL_INSTANCE_TYPE, pSuite), (GBL_SIZE_TYPE, caseIndex))
125
126
127
144
145
146
156
157
158
166
167
168
176
177
178
#define GBL_FORWARD_DECLARE_STRUCT(S)
#define GBL_TYPEID(instanceStruct)
#define GBL_INSTANCE_DERIVE(derivedInstance, baseInstance)
#define GBL_CLASS_DERIVE(...)
#define GBL_UINT32_TYPE
Builtin ID for uint32_t GblVariant type.
#define GBL_PROPERTIES(object,...)
Declares a list of properties for the given object/instance structure.
#define GBL_SIGNALS(instanceStruct,...)
Declares a list of signals to be associated with the given instanceStruct.
void GblTestScenario_expectError(const GblTestScenario *pSelf)
Signals to an executing GblTestScenario that the next error raised by the active test case is expecte...
GBL_RESULT GblTestScenario_run(GblTestScenario *pSelf, int argc, const char *argv[])
Begins execution of the given GblTestScenario instance, running through all of its enqueued GblTestSu...
int GblTestScenario_exec(GblTestScenario *pSelf, int argc, const char *argv[])
Variant of GblTestScenario_run() which releases the GblTestScenario after execution and returns a sta...
GblTestSuite * GblTestScenario_currentSuite(const GblTestScenario *pSelf)
Returns a pointer to the currently executing GblTestSuite within the given GblTestScenario,...
GblTestSuite * GblTestScenario_findSuite(const GblTestScenario *pSelf, const char *pName)
Finds a GblTestSuite by name which has been enqueued onto the given GblTestScenario.
GblTestScenario * GblTestScenario_create(const char *pName)
Creates a GblTestScenario with the given name, optionally as an extended subtype with the given insta...
GblTestScenario * GblTestScenario_ref(GblTestScenario *pSelf)
Returns a new reference to an existing GblTestScenario instance, incrementing its reference counter.
GblBool GblTestScenario_passed(const GblTestScenario *pSelf)
Returns whether or not the given GblTestScenario had any failing tests.
GblType GblTestScenario_type(void)
Returns the GblType UUID associated with GblTestScenario.
size_t GblTestScenario_currentCase(const GblTestScenario *pSelf)
Returns the index of the currently executing test case within the currently executing GblTestSuite wi...
GblBool GblTestScenario_ran(const GblTestScenario *pSelf)
Returns whether or not the given GblTestScenario has run.
GblRefCount GblTestScenario_unref(GblTestScenario *pSelf)
Releases a reference to the given GblTestScenario, destroying it when the reference counter hits zero...
GBL_RESULT GblTestScenario_enqueueSuite(GblTestScenario *pSelf, const GblTestSuite *pSuite)
Enqueues the given GblTestSuite instance to be run as part of the given GblTestScenario's test plan.
uint8_t GblBool
Basic boolean type, standardized to sizeof(char)
uint16_t GblRefCount
Type able to hold a reference counter across the codebase.
Represents a single top-level test object.
size_t caseCount
Total number of test cases contained within all test suites contained within the test scenario.
size_t casesPassed
Total number of test cases which have passed.
size_t casesRun
Total numer of test cases which have run.
double totalTime
Total time spent executing tests, in milliseconds.
GBL_RESULT result
Current overall result code from test scenario run.
size_t casesSkipped
Total number of test cases which have been skipped.
size_t suitesFailed
Total number of test suites which have failed during run.
size_t suitesSkipped
Total number of test suites which have been skipped during run.
size_t suitesRun
Total number of test suites which have run.
size_t casesFailed
Total number of test cases which have failed.
size_t suitesPassed
Total number of test suites which have passed during run.