Skip to content

Commit

Permalink
Merge #92
Browse files Browse the repository at this point in the history
92: Travis test r=frewsxcv
This is #79, with some tweaks to make it work
  • Loading branch information
bors[bot] committed Mar 30, 2017
2 parents cf8cdd6 + 15dc24a commit 53612ad
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .travis.yml
@@ -1,12 +1,24 @@
language: rust
rust:
- stable
- beta
- nightly

cache: cargo

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5

rust: nightly

os:
- linux

matrix:
fast_finish: true

notifications:
email: false

script: scripts/run.sh
3 changes: 3 additions & 0 deletions Cargo.toml
Expand Up @@ -11,3 +11,6 @@ toml = "0.3"
term = "0.4"
clap = "2.21.1"
error-chain = "0.10"

[workspace]
members = ["."]
16 changes: 16 additions & 0 deletions scripts/run.sh
@@ -0,0 +1,16 @@
cargo install
PATH=$PATH:/home/travis/.cargo/bin
cd testcrate
cargo build
cargo-fuzz init
sed -i 's/\/\/.*/testcrate\:\:test_func\(data\)\;/g' fuzz/fuzzers/fuzzer_script_1.rs

if CC=gcc-5 CXX=g++-5 cargo-fuzz run fuzzer_script_1 -- -runs=1000; then
exit 100; # Should not succeed!
else
:;
fi

# should be something there!
ls fuzz/artifacts/fuzzer_script_1/crash-*

2 changes: 2 additions & 0 deletions testcrate/.gitignore
@@ -0,0 +1,2 @@
target
Cargo.lock
10 changes: 10 additions & 0 deletions testcrate/Cargo.toml
@@ -0,0 +1,10 @@
[package]
name = "testcrate"
version = "0.1.0"
authors = ["The rust-fuzz Project Developers"]
publish = false

[dependencies]

[workspace]
members = ["."]
6 changes: 6 additions & 0 deletions testcrate/src/lib.rs
@@ -0,0 +1,6 @@
pub fn test_func(slice: &[u8]) {
if slice.len() == 7 {
panic!("I'm afraid of number 7");
}
}

0 comments on commit 53612ad

Please sign in to comment.