-
Notifications
You must be signed in to change notification settings - Fork 27
/
run-tests.sh
executable file
·64 lines (51 loc) · 1.99 KB
/
run-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -o errexit -o pipefail -o nounset -o xtrace
${PIP} install . --user
export PATH=$HOME/.local/bin:$PATH
dir=test-$TRAVIS_RUST_VERSION-$PIP
echo "Running in $dir"
cp -r test "$dir"
cd "$dir"
# an invalid rust version does nothing
travis-cargo --only xx$TRAVIS_RUST_VERSION build
test ! -d target
# a skipped version does nothing
travis-cargo --skip $TRAVIS_RUST_VERSION build
test ! -d target
# noisy builds by default
travis-cargo build | grep Running
cargo clean
# a quiet build doesn't print anything
! travis-cargo -q build | grep Running
# arguments
travis-cargo test -- --features 'remove-failing'
if [ "$TRAVIS_RUST_VERSION" = nightly ]; then
travis-cargo test -- --features 'remove-failing' | grep default_unstable_test
travis-cargo test -- --features='remove-failing' | grep default_unstable_test
TRAVIS_CARGO_NIGHTLY_FEATURE="custom-unstable" \
travis-cargo test -- --features 'remove-failing' | grep custom_unstable_test
travis-cargo bench -- --features 'remove-failing' | grep unstable_benchmark
# issue #14: can't use -p on nightly since the --feature was
# unconditionally passed, even when empty
TRAVIS_CARGO_NIGHTLY_FEATURE='' travis-cargo build -- -p travis-cargo-test
else
travis-cargo bench -- --features 'remove-failing' | grep skipping
fi
# run documentation build
travis-cargo doc
travis-cargo doc-upload
travis-cargo coverage -m target/coverage --verify -- --features 'remove-failing'
# the two source file names should appear somewhere in the coverage
# output
for pattern in "$dir/tests/foo.rs" "$dir/src/lib.rs"; do
grep "$pattern" target/coverage/kcov-merged/index.json
done
rm -rf target/coverage kcov
travis-cargo coverage -m target/coverage -- --features 'remove-failing'
# the two source file names should appear somewhere in the coverage
# output
for pattern in "$dir/tests/foo.rs" "$dir/src/lib.rs"; do
grep "$pattern" target/coverage/kcov-merged/index.json
done
rm -rf kcov
travis-cargo coveralls -- --features 'remove-failing'