Skip to content

Commit

Permalink
Build doc tests in build script
Browse files Browse the repository at this point in the history
Close #192
  • Loading branch information
hannobraun committed Apr 3, 2020
1 parent e6b9193 commit 8a6b9d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/usr/bin/env bash
set -e

# Target triple of the host machine. Set to x86-64 Linux by default, as that's
# the correct value for the CI server.
#
# Unfotunately there doesn't seem to be a way to tell Cargo to just use the
# target of the host machine, and since we override the default target in
# `.cargo/config` for convenience, this variable is required.
HOST_TARGET=${HOST_TARGET:-x86_64-unknown-linux-gnu}

# Fail build, if there are any warnings.
export RUSTFLAGS="-D warnings"

Expand All @@ -10,6 +18,7 @@ if [ "$TRAVIS_RUST_VERSION" != beta ] && [ "$TRAVIS_RUST_VERSION" != nightly ];
fi

function build() {
cargo test --verbose --features=$1,no-target-warning --target=$HOST_TARGET
cargo build --verbose --features=$1-rt,no-target-warning --examples
}

Expand Down

0 comments on commit 8a6b9d4

Please sign in to comment.