5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TESTING_RUN_PROPERTY_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TESTING_RUN_PROPERTY_HPP_
11#include "arene/base/stdlib_choice/tuple.hpp"
13#include "arene/base/testing/detail/any_prng_ref.hpp"
14#include "arene/base/testing/detail/property_context.hpp"
20#include "arene/base/tuple/detail/tuple_transform.hpp"
30namespace run_property_detail {
35struct generate_argument {
43 constexpr auto operator()(type_identity<T>)
const -> T {
73template <
class Callable>
84 while ((summary.successes < config.required_successes) && (summary.discards <= config.max_discards)) {
85 auto& outcome = detail::property_context();
92 tuple_detail::tuple_transform(
94 run_property_detail::generate_argument<
decltype(prng)>{prng}
99 if (outcome.has_value()) {
101 switch (outcome->error) {
102 case error_code::failure: {
103 summary.failed =
true;
104 summary.first_failure = outcome;
107 case error_code::discard: {
117 summary.failed = summary.successes != config.required_successes;
pseudorandom number generator implementing the xoshiro256++ algorithm
Definition prng_xoshiro.hpp:33
Polyfill of std::type_identity added in C++20.
Definition type_identity.hpp:28
a heterogeneous, fixed-size collection of values
Definition tuple.hpp:695
Definition customization.hpp:31
auto run_property(Callable callable, property_config const config) -> property_summary
run a property callable against a battery of trials with generated arguments
Definition run_property.hpp:74
constexpr bitwise_uniform_distribution< T > default_distribution
Customization point selecting the default distribution used to generate values of type T.
typename apply_all< L0, Func >::type apply_all_t
Evaluate a template meta-function, passing the elements of the type-list L0 as the arguments.
Definition apply_all.hpp:55
typename apply_each< TypeList, ToApply >::type apply_each_t
Apply the given template individually to every element of the given type list.
Definition apply_each.hpp:35
typename drop< List, Count >::type drop_t
drops types from the front of a type list
Definition drop.hpp:91
Definition accumulate.hpp:37
function_arguments_t< typename member_pointer_traits< F >::pointee_type > member_function_arguments_t
Obtains the argument types of a member function pointer type.
Definition function_traits.hpp:507
Definition accumulate.hpp:36
configuration for property run
Definition property_config.hpp:29
error_code
Definition property_error.hpp:22
result of a property run
Definition property_summary.hpp:24