summaryrefslogtreecommitdiff
path: root/ci/script.sh
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-12-08 08:21:15 -0800
committerBryant Mairs <bryantmairs@google.com>2017-12-08 17:55:13 -0800
commit112dca300c2e4a15c99b8d92963c370d0ac0c693 (patch)
treeb04d1d57470f3fc59b64535f90e7bab5592fb00f /ci/script.sh
parent7eaa20810a656158e4d57b792c58481f10987788 (diff)
downloadnix-112dca300c2e4a15c99b8d92963c370d0ac0c693.zip
Support building and testing multiple targets at once
Specifying multiple targets can be done by setting the environment variable to a semi-colon delimited list of targets.
Diffstat (limited to 'ci/script.sh')
-rw-r--r--ci/script.sh22
1 files changed, 13 insertions, 9 deletions
diff --git a/ci/script.sh b/ci/script.sh
index df61c35a..e1d1ab7e 100644
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
# This script takes care of testing your crate
set -ex
@@ -8,17 +9,20 @@ main() {
export RUSTFLAGS=--cfg=travis
fi
- # Build debug and release targets
- cross build --target $TARGET
- cross build --target $TARGET --release
+ IFS=';' read -ra TARGET_ARRAY <<< "$TARGET"
+ for t in "${TARGET_ARRAY[@]}"; do
+ # Build debug and release targets
+ cross build --target $t
+ cross build --target $t --release
- if [ ! -z $DISABLE_TESTS ]; then
- return
- fi
+ if [ ! -z $DISABLE_TESTS ]; then
+ continue
+ fi
- # Run tests on debug and release targets.
- cross test --target $TARGET
- cross test --target $TARGET --release
+ # Run tests on debug and release targets.
+ cross test --target $t
+ cross test --target $t --release
+ done
}
# we don't run the "test phase" when doing deploys