Hegel 0.11.4
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
 Number of test cases to run. Defaults to 100.
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< HealthChecksuppress_health_check
 Health checks to suppress for this test.
std::vector< Phasephases = all_phases()
Mode mode = Mode::TestRun
 How much of a run to perform. Defaults to Mode::TestRun.
Backend backend = Backend::Auto
int64_t stateful_step_count = 50

Detailed Description

Configuration options for hegel::test().

Member Data Documentation

◆ backend

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

Randomness backend. Defaults to Backend::Auto; picking an explicit backend overrides the automatic detection.

◆ database

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

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.


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