Skip to content

Commit ce3019e

Browse files
committed
Update tests to behave correctly on travis
1 parent 615e5e0 commit ce3019e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

bin/test

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,27 @@ set -x
44

55
RUST_VERSION=${RUST_VERSION:-stable}
66

7+
run_cargo() {
8+
if [ -z $TRAVIS ]; then
9+
# Not running on travis
10+
cargo +${RUST_VERSION} $*
11+
else
12+
# Running on travis
13+
cargo $*
14+
fi
15+
}
16+
717
export CARGO_TARGET_DIR=target
818

919
for toml in $(find . -maxdepth 2 -name "Cargo.toml"); do
10-
cargo +${RUST_VERSION} test --manifest-path $toml
20+
run_cargo test --manifest-path $toml
1121
done
1222

1323
# Test the bindgen feature
14-
cargo +${RUST_VERSION} test --manifest-path fitsio/Cargo.toml --features bindgen --no-default-features
24+
run_cargo test --manifest-path fitsio/Cargo.toml --features bindgen --no-default-features
1525

1626
# Test the full example
17-
cargo +${RUST_VERSION} run --manifest-path fitsio/Cargo.toml --example full_example
27+
run_cargo run --manifest-path fitsio/Cargo.toml --example full_example
1828

1929
# Test the array feature
20-
cargo +${RUST_VERSION} test --manifest-path fitsio/Cargo.toml --features array
30+
run_cargo test --manifest-path fitsio/Cargo.toml --features array

0 commit comments

Comments
 (0)