20 std::string_view file_name;
21 std::uint_least32_t line;
22 std::uint_least32_t column;
24 auto operator<=>(
const GoalId&)
const =
default;
31 explicit GoalState(std::string_view message) : message{message} {}
34class ReachabilityTracker
39 const char*
enforce{std::getenv(
"FUZZ_ENFORCE_REACHABILITY")};
41 if (std::string_view{
enforce} ==
"1") {
45 std::fputs(
"FUZZ_ENFORCE_REACHABILITY must be 0 or 1.\n",
stderr);
54 std::cerr << (
goal.reached ?
"PASS" :
"FAIL") <<
" reachability goal \""
55 <<
goal.message <<
"\" at " <<
id.file_name <<
':' <<
id.line <<
':' <<
id.column <<
'\n';
67 .file_name =
goal.location.file_name(),
68 .line =
goal.location.line(),
69 .column =
goal.location.column(),
79 .file_name =
goal.location.file_name(),
80 .line =
goal.location.line(),
81 .column =
goal.location.column(),
84 const auto it{
m_goals.find(
id)};
86 it->second.reached |= reached;
92 bool m_enforce{
false};
#define Assert(val)
Identity function.
void ObserveReachabilityGoal(bool reached, const ReachabilityGoal &goal)
Record whether a registered goal is satisfied by at least one fuzz input.
void RegisterReachabilityGoal(const ReachabilityGoal &goal)
Register a goal before executing any fuzz inputs.
A reachability condition explicitly registered by a fuzz target.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.