forked from sonos/dinghy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.sh
70 lines (63 loc) · 1.53 KB
/
.travis.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
65
66
67
68
69
70
#!/bin/sh
set -e
set -x
export CARGO_DINGHY="`pwd`/target/debug/cargo-dinghy"
export RUST_BACKTRACE=1
if [ `uname` = Darwin ]
then
export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
fi
cargo build --verbose
cargo test --verbose
# Test original cargo build
( \
cd test-ws/test-app \
&& export NOT_BUILT_WITH_DINGHY=1 \
&& cargo test pass \
&& ! NOT_BUILT_WITH_DINGHY=1 cargo test fails \
)
# Test cargo from workspace dir
( \
cd test-ws \
&& cargo clean \
&& $CARGO_DINGHY test pass \
&& ! $CARGO_DINGHY test fails \
)
echo "##"
echo "## latest failure was expected ##"
echo "##"
# Test in project subdir
( \
cd test-ws/test-app \
&& cargo clean \
&& $CARGO_DINGHY test pass \
&& ! $CARGO_DINGHY test fails \
)
echo "##"
echo "## latest failure was expected ##"
echo "##"
# Test from workspace root with project filter
( \
cd test-ws \
&& cargo clean \
&& $CARGO_DINGHY test -p test-app pass \
&& ! $CARGO_DINGHY test -p test-app fails \
)
echo "##"
echo "## latest failure was expected ##"
echo "##"
if [ -n "$DEPLOY" ]
then
if [ `uname` = Linux ]
then
export OPENSSL_STATIC=yes
export OPENSSL_INCLUDE_DIR=/usr/include
export OPENSSL_LIB_DIR=$(dirname `find /usr -name libssl.a`)
cargo clean
fi
cargo build --release -p cargo-dinghy
mkdir -p cargo-dinghy-$DEPLOY
cp target/release/cargo-dinghy cargo-dinghy-$DEPLOY
tar vczf cargo-dinghy-$DEPLOY.tgz cargo-dinghy-$DEPLOY
fi