Hegel 0.13.1
Property-based testing for C++
Loading...
Searching...
No Matches
hegel::Settings Struct Reference

Configuration options for hegel::test(). More...

#include <settings.h>

Public Attributes

std::optional< uint64_t > test_cases
Verbosity verbosity = Verbosity::Normal
 Verbosity level. Defaults to Verbosity::Normal.
std::optional< uint64_t > seed
 Explicit seed for the test.
bool derandomize = internal::in_ci()
bool report_multiple_failures = false
bool print_blob = true
Database database
std::optional< std::string > database_key
std::vector< HealthCheck > suppress_health_check
std::vector< Phase > phases = all_phases()
Backend backend = Backend::Auto
int64_t stateful_step_count = 50

Detailed Description

Configuration options for hegel::test().

A field left at its default takes the value of the engine's settings profile: the engine resolves its default profile from hegel_set_default_profile, the HEGEL_DEFAULT_PROFILE environment variable, and a hegel.toml in the working directory or an ancestor, else from the detected environment (workload inside Antithesis, ci on a CI server, development otherwise).

Member Data Documentation

◆ backend

Backend hegel::Settings::backend = Backend::Auto

Randomness backend. Defaults to Backend::Auto; picking an explicit backend overrides the engine profile's choice.

◆ database

Database hegel::Settings::database
Initial value:
=
internal::in_ci() ? Database::disabled() : Database::unset()
Configure the Hegel database.
Definition settings.h:112
static Database disabled()
Definition settings.h:128

Configure the Hegel database. See Database. Defaults to a database at .hegel, or disabled when a CI environment is detected.

◆ database_key

std::optional<std::string> hegel::Settings::database_key

Key scoping the examples stored in and replayed from the database. Unset (the default) disables persistence and Reuse-phase replay.

◆ derandomize

bool hegel::Settings::derandomize = internal::in_ci()

If true, use a deterministic RNG, making the test deterministic across executions. Defaults to true when a CI environment is detected, false otherwise.

◆ phases

std::vector<Phase> hegel::Settings::phases = all_phases()

Phases to run. Defaults to all phases; phases left out are disabled (e.g. drop Phase::Shrink to keep failing examples unshrunk). An empty vector produces a run that does nothing.

◆ print_blob

bool hegel::Settings::print_blob = true

If true (the default), a failure report ends with a rerun with: line holding the base64 blob that replays the failure.

◆ report_multiple_failures

bool hegel::Settings::report_multiple_failures = false

If true, keep generating after the first failure to surface additional distinct bugs, and report all of them. If false (the default), stop the run at the first failing example.

◆ stateful_step_count

int64_t hegel::Settings::stateful_step_count = 50

The maximum number of steps a stateful test case attempts. Each case runs at least one step and at most this many. Must be at least 1; hegel::test() rejects other values with std::invalid_argument.

◆ suppress_health_check

std::vector<HealthCheck> hegel::Settings::suppress_health_check

Health checks to suppress for this test. Empty (the default) uses the engine profile's set: none locally, TooSlow on a CI server.

◆ test_cases

std::optional<uint64_t> hegel::Settings::test_cases

Number of test cases to run. Unset (the default) uses the engine profile's value, which is 100 unless a hegel.toml changes it.


The documentation for this struct was generated from the following file: