Skip to content
Welcome to the new CppUtils documentation!

Builder for configuring and registering an individual test case.

Template parameterDescription
IsSkippedIndicates whether the test execution is bypassed.
using CppUtils::UnitTest::TestSuite::TestBuilder<IsSkipped>::Base = TestBuilderBase<TestBuilder<IsSkipped>, IsSkipped>;
template <bool Condition>
[[nodiscard]] auto TestBuilder::rebind(std::string message) -> TestBuilder<Condition>;
template <class... Types>
[[nodiscard]] auto TestBuilder::forTypes() -> TypedTestBuilder<IsSkipped, 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 <auto... Values>
[[nodiscard]] auto TestBuilder::forValues() -> ConstexprValuesTestBuilder<IsSkipped, Values...>;

Converts this test into a compile-time value-parameterized test across non-type template values.

Template parameterDescription
ValuesNon-type values to instantiate the compile-time test with.

Returns: ConstexprValuesTestBuilder 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.

template <auto Predicate>
auto TestBuilder::constexprTest() -> void;

Evaluates a test predicate at compile time via static_assert and registers it as a test.

Template parameterDescription
PredicateConstexpr invocable returning a boolean or performing static assertions.
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).