Skip to content

Commit e8d8d2a

Browse files
committed
Test that fuzzing works
1 parent be08fa0 commit e8d8d2a

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ env:
1010
- ARCH=x86_64
1111
notifications:
1212
email: false
13-
script: cargo build --verbose
13+
script:
14+
- cd example
15+
- cargo rustc -- -C passes='sancov' -C llvm-args='-sanitizer-coverage-level=3' -Z sanitizer=address
16+
- (! ./target/debug/example)

example/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "example"
3+
version = "0.1.0"
4+
authors = ["Simonas Kazlauskas <[email protected]>"]
5+
6+
[workspace]
7+
members = ["."]
8+
9+
[dependencies]
10+
fuzzer-sys = { path = ".." }

example/src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![no_main]
2+
3+
#[macro_use]
4+
extern crate fuzzer_sys;
5+
6+
fuzz_target!(|data| {
7+
if data == b"banana" {
8+
panic!("success!");
9+
}
10+
});

0 commit comments

Comments
 (0)