CppUtils::UnitTest::TestSuite
STRUCTCore test suite execution context providing assertion methods, builders, and test registration.
Description
Section intitulée « Description »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.
Types publics
Section intitulée « Types publics »using CppUtils::UnitTest::TestSuite::Logger = Logger<"UnitTests">;ValueTestBuilder
Section intitulée « ValueTestBuilder »using CppUtils::UnitTest::TestSuite::ValueTestBuilder = ParameterizedTestBuilder<std::tuple<Values...>>;RangeTestBuilder
Section intitulée « RangeTestBuilder »using CppUtils::UnitTest::TestSuite::RangeTestBuilder = ParameterizedTestBuilder<Range>;Attributs publics
Section intitulée « Attributs publics »Méthodes publiques
Section intitulée « Méthodes publiques »Declares a test case with the specified name, returning a builder to configure and assign its body.
| Paramètre | Description |
|---|---|
name | Descriptive test name. |
Retourne : TestBuilder instance.
Evaluates a test predicate at compile time via static_assert and registers it as a passed test.
The template predicate is evaluated at compile time: any assertion failure immediately breaks the build before the test executable is even run.
At runtime, this method registers an empty test body in the test runner so that the test appears in reports and metrics while avoiding the process isolation fork() overhead of runtime test cases. Prefer this overload when verifying constexpr functions, concepts, type traits, or template metaprogramming.
| Paramètre template | Description |
|---|---|
Predicate | Constexpr invocable returning a boolean or performing static assertions. |
| Paramètre | Description |
|---|---|
name | Descriptive test name. |
[[nodiscard]] auto TestSuite::fuzzTest(std::string name, std::size_t iterations) -> FuzzTestBuilder;Registers a fuzz test executed for a specified number of randomized iterations.
| Paramètre | Description |
|---|---|
name | Test identifier. |
iterations | Number of iterations to run. |
Retourne : FuzzTestBuilder for assigning the test body callback.