pr: ["master"]

jobs:
  - job: fuzz_two_way
    displayName: "Fuzz (two way)"
    pool:
      vmImage: 'ubuntu-16.04'
    steps:
      - template: ci/install-rust.yml
        parameters:
          rust_version: nightly
      - template: ci/install-cargo-fuzz.yml
      - bash: |
          set -ex
          export RUST_BACKTRACE=1
          cargo +nightly fuzz run two_way -- -max_total_time=300 -rss_limit_mb=4096
  - job: fuzz_four_way
    displayName: "Fuzz (four way)"
    pool:
      vmImage: 'ubuntu-16.04'
    steps:
      - template: ci/install-rust.yml
        parameters:
          rust_version: nightly
      - template: ci/install-cargo-fuzz.yml
      - bash: |
          set -ex
          export RUST_BACKTRACE=1
          cargo +nightly fuzz run four_way -- -max_total_time=300 -rss_limit_mb=4096
  - job: tests_all_features
    displayName: "Tests (all features)"
    pool:
      vmImage: 'ubuntu-16.04'
    steps:
      - template: ci/install-rust.yml
        parameters:
          rust_version: stable
      - bash: |
          set -ex
          export RUST_BACKTRACE=1
          cargo test --all --all-features
        displayName: "Run `cargo test`"
  - job: tests_no_default_features
    displayName: "Tests (no default features)"
    pool:
      vmImage: 'ubuntu-16.04'
    steps:
      - template: ci/install-rust.yml
        parameters:
          rust_version: stable
      - bash: |
          set -ex
          export RUST_BACKTRACE=1
          cargo test --all --no-default-features
        displayName: "Run `cargo test`"
  - job: check_benches
    displayName: "Check that benches build"
    steps:
      - template: ci/install-rust.yml
        parameters:
          rust_version: stable
      - bash: |
          set -ex
          cargo check --all --benches
        displayName: "Run cargo check"
