From 02a37e0ee98c21f0915cc9b036c44697d88545b2 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 8 Mar 2016 08:57:35 -0500 Subject: [PATCH] disable doc tests when crossing --- ci/script.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ci/script.sh b/ci/script.sh index ba49c854..8e9e0c3b 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -2,5 +2,23 @@ set -ex +case "$TRAVIS_OS_NAME" in + linux) + host=x86_64-unknown-linux-gnu + ;; + osx) + host=x86_64-apple-darwin + ;; +esac + +# NOTE Workaround for rust-lang/rust#31907 - disable doc tests when crossing +if [ "$host" != "$TARGET" ]; then + if [ "$TRAVIS_OS_NAME" = "osx" ]; then + brew install gnu-sed --default-names + fi + + find src -name '*.rs' -type f | xargs sed -i -e 's:\(//.\s*```\):\1 ignore,:g' +fi + cargo build --target $TARGET --verbose cargo test --target $TARGET --verbose