Home
Base module

FunctionTest

Test wrapper for standalone test functions.

FunctionTest

#include <icy/test.h>
class FunctionTest

Defined in src/base/include/icy/test.h:115

Inherits: Test

Test wrapper for standalone test functions.

List of all members

NameKindOwner
targetvariableDeclared here
FunctionTestfunctionDeclared here
~FunctionTestfunctionDeclared here
runfunctionDeclared here
TestRunnerfriendInherited from Test
namevariableInherited from Test
errorsvariableInherited from Test
durationvariableInherited from Test
TestfunctionInherited from Test
~TestfunctionInherited from Test
runfunctionInherited from Test
passedfunctionInherited from Test
TestfunctionInherited from Test
operator=functionInherited from Test

Inherited from Test

KindNameDescription
friendTestRunnerTests belong to a TestRunner instance.
variablenameThe name of the test.
variableerrorsA list of test errors.
variabledurationThe test run duration for benchmarking.
functionTest
function~Test virtualShould remain protected.
functionrun virtualCalled by the TestRunner to run the test.
functionpassedReturn true when the test passed without errors.
functionTestDeleted constructor.
functionoperator=Deleted assignment operator.

Public Attributes

ReturnNameDescription
std::function< void()>target

target

std::function< void()> target

Defined in src/base/include/icy/test.h:118

Public Methods

ReturnNameDescription
FunctionTest inline

FunctionTest

inline

inline FunctionTest(std::function< void()> target, const std::string & name = "Unnamed Test")

Defined in src/base/include/icy/test.h:122

Parameters

  • target Lambda or function to execute as the test body.

  • name Human-readable test name.

Protected Methods

ReturnNameDescription
voidrun virtual inline overrideCalled by the TestRunner to run the test.

run

virtual inline override

virtual inline void run() override

Defined in src/base/include/icy/test.h:132

Called by the TestRunner to run the test.

Reimplements