Skip to content

Commit 1607f3c

Browse files
committed
Build fuzz targets on CI.
1 parent 63ca8c6 commit 1607f3c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.travis.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,30 @@ env:
1616
install:
1717
# rustfmt may not always be available in nightly
1818
- if [[ "$TRAVIS_RUST_VERSION" != *nightly* ]]; then rustup component add rustfmt; fi
19-
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then T=x86_64-pc-windows-msvc; rustup target add $T; TARGET=--target=$T; fi
19+
# cargo-fuzz supports x86-64 Linux and x86-64 macOS, but macOS currently fails, see:
20+
# https://github.com/mozilla/mp4parse-rust/pull/210#issuecomment-597420191
21+
- if [[ "$TRAVIS_RUST_VERSION" == *nightly* ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
22+
cargo install cargo-fuzz;
23+
fi
24+
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
25+
TARGET=x86_64-pc-windows-msvc;
26+
rustup target add $TARGET;
27+
fi
2028

2129
script:
2230
# We cannot run `cargo test` with the mp4parse_fallible feature enabled
2331
# (see comment where the feature is defined in mp4parse_capi/Cargo.toml),
2432
# but we can at least check for changes behind features that would break the
2533
# build.
2634
- cargo check --all --verbose $RELEASE --tests --all-features
27-
- cargo test --all --verbose $RELEASE $TARGET
35+
- cargo test --all --verbose $RELEASE ${TARGET:+--target=$TARGET}
2836
- cargo doc --package mp4parse_capi
2937
# The `false` after `echo` is necessary to avoid false negatives due to `echo` returning success
30-
- if [[ "$TRAVIS_RUST_VERSION" != *nightly* ]]; then cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt -- --version))"; false); fi
38+
- if [[ "$TRAVIS_RUST_VERSION" != *nightly* ]]; then
39+
cargo fmt -- --check || (echo "Please reformat your code with 'cargo fmt' (version $(cargo fmt -- --version))"; false);
40+
fi
41+
- if [[ "$TRAVIS_RUST_VERSION" == nightly ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
42+
cd mp4parse_capi;
43+
cargo fuzz build;
44+
fi
45+

0 commit comments

Comments
 (0)