forked from nats-io/nats.c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildOnTravis.sh
executable file
·52 lines (44 loc) · 910 Bytes
/
buildOnTravis.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
#!/bin/sh
# $1 is compiler (gcc, clang)
# $2 is "coverage" for coverage
# $3 is build options to pass to cmake
# $4 is test options to pass to ctest
echo "compiler = " $1
echo "coverage = " $2
echo "build opts = " $3
echo "test opts = " $4
if [ "$1" != "gcc" ]; then
if [ "$2" = "coverage" ]; then
# only coverage for gcc compiler
exit 0
fi
fi
cmake .. $3
res=$?
if [ $res -ne 0 ]; then
exit $res
fi
make rebuild_cache && make
res=$?
if [ $res -ne 0 ]; then
exit $res
fi
echo "Test app using dynamic library does not crash if no NATS call is made"
test/dylib/nonats
res=$?
if [ $res -ne 0 ]; then
exit $res
fi
export NATS_TEST_SERVER_VERSION="$(gnatsd -v)"
env NATS_TEST_TRAVIS=yes ctest --timeout 60 --output-on-failure $4
res=$?
if [ $res -ne 0 ]; then
exit $res
fi
if [ "$2" = "coverage" ]; then
ctest -T coverage
res=$?
if [ $res -ne 0 ]; then
exit $res
fi
fi