Modern unit testing framework.
| Name | Description |
|---|---|
FunctionTest | Test wrapper for standalone test functions. |
Test | Test wrapper class. |
TestRunner | Test manager queue. |
| Return | Name | Description |
|---|---|---|
std::list< Test * > | TestList | |
std::list< std::string > | SErrorist | |
std::map< Test *, SErrorist > | ErrorMap |
std::list< Test * > TestList()std::list< std::string > SErrorist()std::map< Test *, SErrorist > ErrorMap()| Return | Name | Description |
|---|---|---|
void | init | Initialize the test environment. |
int | finalize | Finalize the test environment. |
void | runAll | Run all tests. |
void | describe | Describe a test environment implemented by the given lambda function. |
void | describe | Describe a test environment implemented by the given test instance. |
void | expectImpl | Expect asserts that a condition is true (use expect() as defined below). |
bool | waitFor | Run the event loop until a condition is met or timeout expires. Returns true if the condition was satisfied, false on timeout. Useful for testing async operations that complete via libuv callbacks. |
void init()Initialize the test environment.
int finalize()Finalize the test environment.
Destroy the TestRunner singleton instance and return the exit code.
void runAll()Run all tests.
void describe(const std::string & name, std::function< void()> target)Describe a test environment implemented by the given lambda function.
void describe(const std::string & name, Test * test)Describe a test environment implemented by the given test instance.
void expectImpl(bool passed, const char * assert, const char * file, long line)Expect asserts that a condition is true (use expect() as defined below).
bool waitFor(std::function< bool()> condition, int timeoutMs)Run the event loop until a condition is met or timeout expires. Returns true if the condition was satisfied, false on timeout. Useful for testing async operations that complete via libuv callbacks.