Skip to content
Welcome to the new CppUtils documentation!

Core test suite execution context providing assertion methods, builders, and test registration.

Instances are passed to test suite definitions configured via testSuite("SuiteName") = [](TestSuite& suite) { ... };. Supports regular tests, compile-time tests, parameterized tests (types, values, ranges), fuzz tests, and benchmarks.

using CppUtils::UnitTest::TestSuite::Logger = Logger<"UnitTests">;
std::vector<TestCase> tests;
TestSuite::TestSuite() = default;
[[nodiscard]] auto TestSuite::test(std::string name) -> TestBuilder<false>;

Declares a test case with the specified name, returning a builder to configure and assign its body.

ParameterDescription
nameDescriptive test name.

Returns: TestBuilder instance.

[[nodiscard]] auto TestSuite::fuzzTest(std::string name, std::size_t iterations) -> FuzzTestBuilder<false>;

Registers a fuzz test executed for a specified number of randomized iterations.

ParameterDescription
nameTest identifier.
iterationsNumber of iterations to run.

Returns: FuzzTestBuilder for assigning the test body callback.

[[nodiscard]] auto TestSuite::testCases() const noexcept -> const std::vector<TestCase>&;

Returns the collection of registered test cases in this suite.

Returns: Read-only reference to the list of test cases.