- Notifications
You must be signed in to change notification settings - Fork20
property testing and verification front-end for Rust
License
NotificationsYou must be signed in to change notification settings
camshaft/bolero
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
fuzz and property testing front-end for Rust
A copy of the Bolero Book can be found here:http://camshaft.github.io/bolero
Install subcommand and add a dependency
$cargo add --dev bolero$cargo install -f cargo-bolero
Write a test using
bolero::check!
macro:pubfnbuggy_add(x:u32,y:u32) ->u32{if x ==12976 && y ==14867{return x.wrapping_sub(y);}return x.wrapping_add(y);}#[test]fnfuzz_add(){ bolero::check!().with_type().cloned().for_each(|(a, b)|buggy_add(a, b) == a.wrapping_add(b));}
Run the test with
cargo bolero
$cargo bolerotest fuzz_add#... some moments later ...======================== Test Failure ========================Input:( 12976, 14867,)Error:test returned `false`==============================================================
cargo-bolero
needs a couple of libraries installed to compile. If these libraries aren'tavailable the requirement can be relaxed by executingcargo install cargo-bolero --no-default-features -f
$ sudo apt install binutils-dev libunwind-dev
About
property testing and verification front-end for Rust
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published