![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
Go to the source code of this file.
| #define ARENE_INTERNAL_PROPERTY2 | ( | TestSuite, | |
| TestCase ) |
two-argument form of ARENE_PROPERTY
| TestSuite | test suite name |
| TestCase | test case name |
Forwards to ARENE_INTERNAL_PROPERTY3 with an empty parameter list, producing a property whose body takes no generated arguments.
| #define ARENE_INTERNAL_PROPERTY3 | ( | TestSuite, | |
| TestCase, | |||
| Params ) |
three-argument form of ARENE_PROPERTY
| TestSuite | test suite name |
| TestCase | test case name |
| Params | parenthesized parameter list for the property body |
Generates the closure type, the GoogleTest/Minitest TEST registration, and the out-of-class definition stub of the property's operator(). The user's braced block that follows the macro invocation becomes the body of that operator().
| #define ARENE_INTERNAL_PROPERTY_CLOSURE_NAME | ( | TestSuite, | |
| TestCase ) |
unique closure type name for a property test
| TestSuite | test suite name |
| TestCase | test case name |
| #define ARENE_INTERNAL_PROPERTY_PICK | ( | _1, | |
| _2, | |||
| _3, | |||
| NAME, | |||
| ... ) |
helper macro to dispatch to the correct internal property macro
| _1 | first positional slot (unused) |
| _2 | second positional slot (unused) |
| _3 | third positional slot (unused) |
| NAME | the selected macro name to return |
| ... | any trailing tokens (ignored) |
Used as an argument-count dispatcher for ARENE_PROPERTY or ARENE_TYPED_PROPERTY. The positional arguments _1, _2, _3, NAME capture tokens from the caller, and the selected NAME is returned. The variadic tail (...) absorbs any additional tokens so that the dispatch works regardless of overall argument count.
| #define ARENE_INTERNAL_TYPED_PROPERTY2 | ( | TestSuite, | |
| TestCase ) |
two-argument form of ARENE_TYPED_PROPERTY
| TestSuite | typed test suite name |
| TestCase | test case name |
Forwards to ARENE_INTERNAL_TYPED_PROPERTY3 with an empty parameter list, producing a typed property whose body takes no generated arguments.
| #define ARENE_INTERNAL_TYPED_PROPERTY3 | ( | TestSuite, | |
| TestCase, | |||
| Params ) |
three-argument form of ARENE_TYPED_PROPERTY
| TestSuite | typed test suite name |
| TestCase | test case name |
| Params | parenthesized parameter list for the property body |
Generates the closure type template (parameterized by the GoogleTest TypeParam), the TYPED_TEST registration, and the out-of-class definition stub of the property's operator(). The user's braced block that follows the macro invocation becomes the body of that operator(). Inside the body, TypeParam refers to the current type from the type list bound to the typed test suite.
| #define ARENE_PROP_CHECK | ( | Description, | |
| Params, | |||
| ... ) |
run an inline property check
| Description | string literal describing the property. Currently unused by the expansion; reserved for future labeling and reporting. |
| Params | parenthesized parameter list for the property body, e.g. (int a, int b). Use () for a property that takes no generated arguments. |
| ... | braced block forming the body of the property's operator(). The block is passed through as variadic tokens so that it may contain commas (e.g. inside initializer lists or template arguments). |
proprety_summary of the runRuns the property body repeatedly with pseudorandom arguments drawn according to arene::base::testing::read_property_config, and yields the resulting property_summary.
Unlike ARENE_PROPERTY and ARENE_TYPED_PROPERTY, this macro does not register a test case. It is intended for use inside an existing test body or other context where the caller wants direct access to the summary, for example to inspect statistics or to assert custom conditions on the outcome.
Inside the body, the identifier prng refers to a type-erased PRNG, which may be used to manually produce additional random values if needed.
Example:
| #define ARENE_PROPERTY | ( | ... | ) |
define a property-based test Arguments: test suite name, test case name, and an optional parenthesized parameter list for the property body, e.g. (int a, int b). When omitted, the body takes no generated arguments.
Expands to a TEST case whose body is executed many times by arene::base::testing::run_property, with pseudorandom arguments drawn according to arene::base::testing::read_property_config.
The macro has two forms:
The first form declares a property with no generated arguments. The second form accepts a parenthesized parameter list Params that specifies the types (and optional names) of the values the framework should generate and pass into the body each iteration.
Inside the body, the identifier prng refers to a type-erased PRNG, which may be used to manually produce additional random values if needed.
Example:
| #define ARENE_TYPED_PROPERTY | ( | ... | ) |
define a typed property-based test Arguments: typed test suite name, test case name, and an optional parenthesized parameter list for the property body, e.g. (TypeParam a, TypeParam b). When omitted, the body takes no generated arguments.
Expands to a TYPED_TEST case whose body is executed many times by arene::base::testing::run_property, with pseudorandom arguments drawn according to arene::base::testing::read_property_config. The body is instantiated for each type in the type list bound to TestSuite.
The macro has two forms:
The first form declares a typed property with no generated arguments. The second form accepts a parenthesized parameter list Params that specifies the types (and optional names) of the values the framework should generate and pass into the body each iteration. The identifier TypeParam is available inside Params and the body, referring to the current type under test.
Inside the body, the identifier prng refers to a type-erased PRNG, which may be used to manually produce additional random values if needed.
Example: