Skip to content
Welcome to the new CppUtils documentation!

Builder for configuring and registering an individual test case.

TestSuite& parentSuite;

Reference to the enclosing test suite registering the test.

std::string testName;

Identifier of the test case.

TestBuilder::TestBuilder(std::chrono::seconds timeout, TestSuite& suite, std::string name);
template <class... Types>
[[nodiscard]] auto TestBuilder::forTypes() -> TypedTestBuilder<Types...>;

Converts this test into a type-parameterized test across the specified types.

Template parameterDescription
TypesType parameters to instantiate the test with.

Returns: TypedTestBuilder instance.

template <class... Values>
[[nodiscard]] auto TestBuilder::forValues(Values&&... values);

Converts this test into a value-parameterized test across discrete values or a range.

Template parameterDescription
ValuesValue types or single range type.
ParameterDescription
valuesValues or range to iterate over.

Returns: ParameterizedTestBuilder instance.

auto TestBuilder::operator=(auto&& function) -> void;

Assigns the test body callback and registers the test into the parent suite.

ParameterDescription
functionInvocable containing test logic (accepts optional std::stop_token).