sapling/eden/scm/lib/dag/fuzz/README
Jun Wu d7cbb641ff dag: fix fuzz tests
Summary:
The fuzz tests need `TestContext::id_dag()`, which was removed by D20471712 (1fb5acf242).
Restore it so fuzz tests can run. This is mainly to check the new `range`
function.

The `range` fuzz test does find an issue caused by `>` written as `>=`
relatively quickly.

Reviewed By: sfilipco

Differential Revision: D23106176

fbshipit-source-id: e9540cc932503a9d54246d24c70bac829fcb13df
2020-08-21 13:00:45 -07:00

15 lines
604 B
Plaintext

Steps to run the fuzz tests with OSS toolchain:
1. Install rustup.
2. `rustup install nightly` to install nightly toolchain.
3. From `eden/scm`, run `rustup override set nightly && make local` to use the nightly toolchain.
4. From `dag` (parent directory of `fuzz`), run `cargo fuzz run $TEST_NAME`. For example, `$TEST_NAME` can be `range_medium`.
`cargo fuzz` supports some options. For example:
cargo fuzz run --release -j 16 gca -- -max_len=20
will build in release mode, fork into 16 processes, and generate at most 20-byte input.
See also https://rust-fuzz.github.io/book/cargo-fuzz.html.