mix fuzz (ExFuzz v0.1.0)

Copy Markdown View Source

Fuzzes one fuzz target, by the test's line or name:

$ mix fuzz test/jason_test.exs:6
$ mix fuzz test/jason_test.exs:"fuzz Jason never crashes"

Failing inputs are saved as seed corpus to test/fixtures/fuzz/ and replayed by mix test from then on. You can configure this with :corpus_dir under the :ex_fuzz key of your project config.

Options

  • --max-time - how long to fuzz, in milliseconds.
  • --max-runs - how many inputs to run.
  • --timeout - sets the timeout per input, in milliseconds.
  • --trace - fuzzes with detailed reporting, ignoring input timeouts.

Without --max-time or --max-runs, fuzzing runs until an input fails the test.