|
16 | 16 | install:
|
17 | 17 | # rustfmt may not always be available in nightly
|
18 | 18 | - 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 |
20 | 28 |
|
21 | 29 | script:
|
22 | 30 | # We cannot run `cargo test` with the mp4parse_fallible feature enabled
|
23 | 31 | # (see comment where the feature is defined in mp4parse_capi/Cargo.toml),
|
24 | 32 | # but we can at least check for changes behind features that would break the
|
25 | 33 | # build.
|
26 | 34 | - cargo check --all --verbose $RELEASE --tests --all-features
|
27 |
| - - cargo test --all --verbose $RELEASE $TARGET |
| 35 | + - cargo test --all --verbose $RELEASE ${TARGET:+--target=$TARGET} |
28 | 36 | - cargo doc --package mp4parse_capi
|
29 | 37 | # 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