class
TestSuite
Primary class for unit testing.
Override and register unit tests in constructor then run the tests using the desired method of output.
Public
Methods
~TestSuite
Run
Runs all the tests in the suite (and sub-suites).
Tests results are reported to the provided output class.
Add
Adds a new child suite to this suite.
This method allows you to group suites and execute them all at once.
Internal
Methods
Assertment
Reports success or failure depending on the result of an expression.
- success
- If true success is reported, otherwise failure.
- desc
- Message describing the nature of the failure.
- file
- Name of the source code file the assert originates from.
- line
- Line number at which the assert was triggered at.
Protected
Constructors
TestSuite
Methods
StartUp
Called right before any tests are ran.
ShutDown
Called after all tests and child suite's tests are ran.
GetLogMode
Override to specify log handling mode for this suite.
Default is Strict (fail on unexpected warnings/errors).
AddTest
Register a new unit test.
- test
- Function to call in order to execute the test.
- name
- Name of the test we can use for referencing it later.
Private
Methods
OnLogEntry
Log callback handler.
VerifyUnhandledLogs
Verify any unhandled warnings/errors at end of test.
RegisterLogScope
Register/unregister log scopes (called by LoggingScope).
UnregisterLogScope
Fields
mSuiteName
mTests
mSuites
mOutput
mActiveTestName
mFailureCount
mActiveLogScopes
Active log scopes (stack - most recent first).
mLogCaptureActive
True if log capture is currently active.