Aller au contenu
Bienvenue sur la nouvelle documentation de CppUtils !

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.

ParamètreDescription
nameDescriptive test name.

Retourne : 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.

ParamètreDescription
nameTest identifier.
iterationsNumber of iterations to run.

Retourne : 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.

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