libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
gimbal_test_scenario.h File Reference

Go to the source code of this file.

Data Structures

struct  GblTestScenarioClass
 
struct  GblTestScenario
 

Macros

Type System

Type UUID and cast operators.

#define GBL_TEST_SCENARIO_TYPE
 
#define GBL_TEST_SCENARIO(self)
 
#define GBL_TEST_SCENARIO_CLASS(klass)
 
#define GBL_TEST_SCENARIO_CLASSOF(self)
 

Functions

GblType GblTestScenario_type (void)
 
void GblTestScenario_expectError (const GblTestScenario *pSelf)
 
Lifetime Management

Creation and reference ownership methods.

GblTestScenarioGblTestScenario_create (const char *pName)
 
GblTestScenarioGblTestScenario_ref (GblTestScenario *pSelf)
 
GblRefCount GblTestScenario_unref (GblTestScenario *pSelf)
 
Suite Management

Routines for managing child test suites.

GBL_RESULT GblTestScenario_enqueueSuite (GblTestScenario *pSelf, const GblTestSuite *pSuite)
 
GblTestSuiteGblTestScenario_findSuite (const GblTestScenario *pSelf, const char *pName)
 
Current Tests

Routines for querying the active tests.

GblTestSuiteGblTestScenario_currentSuite (const GblTestScenario *pSelf)
 
size_t GblTestScenario_currentCase (const GblTestScenario *pSelf)
 
Execution

Routines for starting text execution.

GBL_RESULT GblTestScenario_run (GblTestScenario *pSelf, int argc, const char *argv[])
 
int GblTestScenario_exec (GblTestScenario *pSelf, int argc, const char *argv[])
 
Results

Routines for querying the overall results.

GblBool GblTestScenario_ran (const GblTestScenario *pSelf)
 
GblBool GblTestScenario_passed (const GblTestScenario *pSelf)
 

Detailed Description

GblTestScenario and related functions.

This file contains the type declaration for GblTestScenario and its related public API.

Author
2023, 2024, 2025 Falco Girgis
Todo
  • removing GblTestSuites
  • Complex/Extended constructor like GblBox
  • Uniform argument parsing/handling?
  • abort the scenario
  • option for dumping failed cases at the end
  • suite count public API
  • expecting error
  • emit property changed signals

Definition in file gimbal_test_scenario.h.

Macro Definition Documentation

◆ GBL_TEST_SCENARIO_TYPE

#define GBL_TEST_SCENARIO_TYPE

GblType UUID for GblTestScenario.

Definition at line 31 of file gimbal_test_scenario.h.

◆ GBL_TEST_SCENARIO

#define GBL_TEST_SCENARIO ( self)

Casts a GblInstance to a GblTestScenario.

Definition at line 32 of file gimbal_test_scenario.h.

◆ GBL_TEST_SCENARIO_CLASS

#define GBL_TEST_SCENARIO_CLASS ( klass)

Casts a GblClass to a GblTestScenarioClass.

Definition at line 33 of file gimbal_test_scenario.h.

◆ GBL_TEST_SCENARIO_CLASSOF

#define GBL_TEST_SCENARIO_CLASSOF ( self)

Retrieves a GblTestScenarioClass from a GblInstance.

Definition at line 34 of file gimbal_test_scenario.h.

Function Documentation

◆ GblTestScenario_type()

GblType GblTestScenario_type ( void )

Returns the GblType UUID associated with GblTestScenario.

◆ GblTestScenario_create()

GblTestScenario * GblTestScenario_create ( const char * pName)

Creates a GblTestScenario with the given name, optionally as an extended subtype with the given instance structure size and floating class.

◆ GblTestScenario_ref()

GblTestScenario * GblTestScenario_ref ( GblTestScenario * pSelf)

Returns a new reference to an existing GblTestScenario instance, incrementing its reference counter.

◆ GblTestScenario_unref()

GblRefCount GblTestScenario_unref ( GblTestScenario * pSelf)

Releases a reference to the given GblTestScenario, destroying it when the reference counter hits zero.

◆ GblTestScenario_enqueueSuite()

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.

◆ GblTestScenario_findSuite()

GblTestSuite * GblTestScenario_findSuite ( const GblTestScenario * pSelf,
const char * pName )

Finds a GblTestSuite by name which has been enqueued onto the given GblTestScenario.

◆ GblTestScenario_currentSuite()

GblTestSuite * GblTestScenario_currentSuite ( const GblTestScenario * pSelf)

Returns a pointer to the currently executing GblTestSuite within the given GblTestScenario, if there is an active one.

◆ GblTestScenario_currentCase()

size_t GblTestScenario_currentCase ( const GblTestScenario * pSelf)

Returns the index of the currently executing test case within the currently executing GblTestSuite within the given GblTestScenario, if there is an active one, or GBL_NPOS otherwise.

◆ GblTestScenario_run()

GBL_RESULT GblTestScenario_run ( GblTestScenario * pSelf,
int argc,
const char * argv[] )

Begins execution of the given GblTestScenario instance, running through all of its enqueued GblTestSuites, possibly processing the given command-line arguments.

◆ GblTestScenario_exec()

int GblTestScenario_exec ( GblTestScenario * pSelf,
int argc,
const char * argv[] )

Variant of GblTestScenario_run() which releases the GblTestScenario after execution and returns a status code which can be directly returned from main().

◆ GblTestScenario_ran()

GblBool GblTestScenario_ran ( const GblTestScenario * pSelf)

Returns whether or not the given GblTestScenario has run.

◆ GblTestScenario_passed()

GblBool GblTestScenario_passed ( const GblTestScenario * pSelf)

Returns whether or not the given GblTestScenario had any failing tests.

◆ GblTestScenario_expectError()

void GblTestScenario_expectError ( const GblTestScenario * pSelf)

Signals to an executing GblTestScenario that the next error raised by the active test case is expected and should not be considered a test failure.