Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

property testing and verification front-end for Rust

License

NotificationsYou must be signed in to change notification settings

camshaft/bolero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusLatest versionDocumentationLicense

fuzz and property testing front-end for Rust

Book

A copy of the Bolero Book can be found here:http://camshaft.github.io/bolero

Quick Start

  1. Install subcommand and add a dependency

    $cargo add --dev bolero$cargo install -f cargo-bolero
  2. Write a test usingbolero::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));}
  3. Run the test withcargo bolero

    $cargo bolerotest fuzz_add#... some moments later ...======================== Test Failure ========================Input:(    12976,    14867,)Error:test returned `false`==============================================================

Linux Installation

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

Debian/Ubuntu

$ sudo apt install binutils-dev libunwind-dev

[8]ページ先頭

©2009-2025 Movatter.jp