class
CompositeTestOutput
Inherits:
TestOutput
Broadcasts test events to multiple TestOutput instances.
Can be used to output test results both to console and log it in a file for example.
Public
Methods
Add
void Add(TestOutput &output)
Adds an output to receive test events.
Output must remain valid for the lifetime of this object.
DoOnSuiteStart
void DoOnSuiteStart(const String &suiteName) override
Triggered when a test suite starts executing.
- suiteName
- Name of the test suite being executed.
DoOnSuiteEnd
void DoOnSuiteEnd(const String &suiteName, u32 totalTestCount, u32 passedTestCount, u32 failedTestCount, u64 durationUs) override
Triggered when a test suite finishes executing.
- suiteName
- Name of the test suite that finished.
- totalTestCount
- Total number of tests in the suite.
- passedTestCount
- Number of tests that passed.
- failedTestCount
- Number of tests that failed.
- durationUs
- Total execution time in microseconds.
DoOnTestStart
void DoOnTestStart(const String &testName) override
Triggered when an individual test starts executing.
- testName
- Name of the test being executed.
DoOnTestEnd
void DoOnTestEnd(const String &testName, bool passed, u64 durationUs) override
Triggered when an individual test finishes executing.
- testName
- Name of the test that finished.
- passed
- True if the test passed, false if it failed.
- durationUs
- Execution time in microseconds.
DoOnOutputFail
void DoOnOutputFail(const String &description, const String &function, const String &file, long line) override
Triggered when a unit test fails.
- description
- Reason why the unit test failed.
- function
- Name of the function the test failed in.
- file
- File the unit test failed in.
- line
- Line of code the unit test failed on.
DoOnOutputSuccess
void DoOnOutputSuccess(const String &testName) override
Triggered when a unit test succeeds (optional to implement).
- testName
- Name of the test that succeeded.
Private
Fields
mOutputs
Vector<TestOutput *> mOutputs