#include <base/UnitTest.h>
Inherits ReferenceCountedObject.
|
enum | { HERE_MARKER = 0x21564836,
DEFAULT_PRIORITY = 0,
DEFAULT_TIMEOUT = 15 * 60 * 1000
} |
|
enum | Impact {
PRIVACY,
SECURITY,
CRITICAL,
IMPORTANT,
NORMAL,
LOW,
IGNORE
} |
|
enum | ResultEvent { FAILED,
PASSED,
PRINT
} |
|
◆ Impact
Potential impact of test. Lower is worse.
◆ ResultEvent
◆ UnitTest()
◆ addDependency()
void UnitTest::addDependency |
( |
const String & |
id | ) |
|
|
inline |
◆ getAllowConcurrentRun()
virtual bool UnitTest::getAllowConcurrentRun |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_ALLOW_CONCURRENT to allow concurrent test runs.
◆ getDependencies()
const Array<String>& UnitTest::getDependencies |
( |
| ) |
const |
|
inlinenoexcept |
◆ getDescription()
const String& UnitTest::getDescription |
( |
| ) |
const |
|
inlinenoexcept |
Returns the description of the test.
◆ getId()
String UnitTest::getId |
( |
| ) |
const |
Returns the ID of the test (project/name).
◆ getImpact()
virtual Impact UnitTest::getImpact |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_IMPACT to set priority for test.
◆ getJUnit()
String UnitTest::getJUnit |
( |
| ) |
const |
Returns the JUnit fragment.
◆ getLastRun()
◆ getLimitIO()
virtual uint64 UnitTest::getLimitIO |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_LIMIT_IO to set IO limit.
◆ getLimitMemory()
virtual uint64 UnitTest::getLimitMemory |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_LIMIT_MEMORY to set processing time limit.
◆ getLimitProcessingTime()
virtual uint64 UnitTest::getLimitProcessingTime |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_LIMIT_TIME_MS to set processing time limit.
◆ getLine()
unsigned int UnitTest::getLine |
( |
| ) |
const |
|
inlinenoexcept |
Returns the source line of the test.
◆ getName()
const String& UnitTest::getName |
( |
| ) |
const |
|
inlinenoexcept |
Returns the name/id of the test.
◆ getOwner()
virtual String UnitTest::getOwner |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_OWNER to set owner for test.
◆ getPriority()
virtual int UnitTest::getPriority |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_PRIORITY to set priority for test.
◆ getProject()
virtual String UnitTest::getProject |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_PROJECT to set project for test.
◆ getRepeats()
virtual unsigned int UnitTest::getRepeats |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_REPEATS to set number of repeats.
◆ getSource()
const String& UnitTest::getSource |
( |
| ) |
const |
|
inlinenoexcept |
Returns the source of the test.
◆ getState()
Returns the global state. Allows tests to share state. But keep tests deterministic.
◆ getTimeout()
virtual unsigned int UnitTest::getTimeout |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_TIMEOUT_MS to set priority for test.
◆ getType()
const Type& UnitTest::getType |
( |
| ) |
const |
|
inlinenoexcept |
Returns the type (from class) of the test.
◆ hasExternalDependency()
virtual bool UnitTest::hasExternalDependency |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_EXTERNAL to tag test as having external dependencies.
◆ isInDevelopment()
virtual bool UnitTest::isInDevelopment |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Use TEST_IN_DEVELOPMENT to tag test as being in development.
◆ makeFolder()
String UnitTest::makeFolder |
( |
| ) |
|
Creates a folder for the test and returns the path.
◆ onAssert()
void UnitTest::onAssert |
( |
bool |
passed, |
|
|
const String & |
what, |
|
|
unsigned int |
line = 0 |
|
) |
| |
|
protected |
Called when subtest failed.
◆ onException()
void UnitTest::onException |
( |
const Exception * |
exception | ) |
|
◆ onFailed()
void UnitTest::onFailed |
( |
const String & |
what, |
|
|
unsigned int |
line = 0 |
|
) |
| |
|
protected |
Called when subtest failed.
◆ onHere()
void UnitTest::onHere |
( |
const Here * |
here | ) |
|
|
protected |
Called when here point is reached.
◆ onNotHere()
void UnitTest::onNotHere |
( |
const NotHere * |
here | ) |
|
|
protected |
Called when nothere point is reached but shouldn't be reached.
◆ onPassed()
void UnitTest::onPassed |
( |
const String & |
what, |
|
|
unsigned int |
line = 0 |
|
) |
| |
|
protected |
Called when subtest passed.
◆ onPrint()
void UnitTest::onPrint |
( |
const String & |
what, |
|
|
unsigned int |
line = 0 |
|
) |
| |
|
protected |
Called on explicit print request.
◆ onPrintIssue()
void UnitTest::onPrintIssue |
( |
const String & |
what, |
|
|
unsigned int |
line = 0 |
|
) |
| |
|
protected |
Called on explicit print request.
◆ registerHere()
void UnitTest::registerHere |
( |
const Here * |
here, |
|
|
const char * |
description |
|
) |
| |
|
protected |
Called when here point is declared.
◆ registerNotHere()
void UnitTest::registerNotHere |
( |
const NotHere * |
here, |
|
|
const char * |
description |
|
) |
| |
|
protected |
Called when not-here point is declared.
◆ run()
virtual void UnitTest::run |
( |
| ) |
|
|
virtual |
◆ runImpl()
◆ setDescription()
void UnitTest::setDescription |
( |
const String & |
description | ) |
|
Sets the description of the test.
◆ setName()
void UnitTest::setName |
( |
const String & |
name | ) |
|
Sets the name/id of the test.
◆ setSource()
void UnitTest::setSource |
( |
const String & |
source, |
|
|
unsigned int |
line = 0 |
|
) |
| |
Sets the source file of the test.
◆ setState()
Sets the global state. Allows tests to share state. But keep tests deterministic.
◆ setType()
void UnitTest::setType |
( |
const Type & |
type | ) |
|
Sets the type (from class) of the test.