test
Classes
| Name | Description |
|---|---|
FunctionTest | Test wrapper for standalone test functions. |
Test | Test wrapper class. |
TestRunner | Test manager queue. |
Typedefs
| Return | Name | Description |
|---|---|---|
std::list< Test * > | TestList | |
std::list< std::string > | SErrorist | |
std::map< Test *, SErrorist > | ErrorMap |
TestList
using TestList = std::list< Test * >Type: std::list< Test * >
Defined in src/base/include/icy/test.h:34
SErrorist
using SErrorist = std::list< std::string >Defined in src/base/include/icy/test.h:35
ErrorMap
using ErrorMap = std::map< Test *, SErrorist >Type: std::map< Test *, SErrorist >
Defined in src/base/include/icy/test.h:36
Functions
| 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. |
init
void init()Defined in src/base/include/icy/test.h:39
Initialize the test environment.
finalize
int finalize()Defined in src/base/include/icy/test.h:44
Finalize the test environment.
Destroy the TestRunner singleton instance and return the exit code.
runAll
void runAll()Defined in src/base/include/icy/test.h:47
Run all tests.
describe
void describe(const std::string & name, std::function< void()> target)Defined in src/base/include/icy/test.h:50
Describe a test environment implemented by the given lambda function.
describe
void describe(const std::string & name, Test * test)Defined in src/base/include/icy/test.h:53
Describe a test environment implemented by the given test instance.
expectImpl
void expectImpl(bool passed, const char * assert, const char * file, long line)Defined in src/base/include/icy/test.h:56
Expect asserts that a condition is true (use expect() as defined below).
waitFor
bool waitFor(std::function< bool()> condition, int timeoutMs = 3000)Defined in src/base/include/icy/test.h:61
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.
