Skip to content

Add a tiny fuzz test framework#9050

Merged
alexreinking merged 15 commits intomainfrom
alexreinking/better-fuzzing
Mar 17, 2026
Merged

Add a tiny fuzz test framework#9050
alexreinking merged 15 commits intomainfrom
alexreinking/better-fuzzing

Conversation

@alexreinking
Copy link
Member

This PR enables writing fuzz tests that are compatible with libFuzzer, but do not require it. When building without libFuzzer globally enabled, the build will fall back to a simple command line runner and a std::mt19937_64 randomness source.

We also add a toolchain for macOS with Homebrew and a preset that uses it to build with libFuzzer. I have tested this locally to work both ways. The buildbots should immediate start building and testing with the stdlib backend.

@alexreinking alexreinking requested a review from abadams March 16, 2026 20:45
Copy link
Contributor

@mcourteaux mcourteaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I few questions, but LGTM.

debug(0) << arg;
};
(dump(args), ...);
debug(0) << "\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious... why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the order backwards?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C++17 fold didn't work with the way debug changed, but we didn't notice because it was ifdef'd-out debugging code.

@alexreinking alexreinking merged commit c581761 into main Mar 17, 2026
25 of 26 checks passed
@alexreinking alexreinking deleted the alexreinking/better-fuzzing branch March 17, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants