travis: Run the "all" test case with leak detective enabled
[strongswan.git] / scripts / test.sh
1 #!/bin/sh
2 # Build script for Travis CI
3
4 if test -z $TRAVIS_BUILD_DIR; then
5 TRAVIS_BUILD_DIR=$PWD
6 fi
7
8 cd $TRAVIS_BUILD_DIR
9
10 TARGET=check
11
12 DEPS="libgmp-dev"
13
14 case "$TEST" in
15 default)
16 # should be the default, but lets make sure
17 CONFIG="--with-printf-hooks=glibc"
18 ;;
19 openssl)
20 CONFIG="--disable-defaults --enable-tools --enable-openssl"
21 DEPS="libssl-dev"
22 ;;
23 gcrypt)
24 CONFIG="--disable-defaults --enable-tools --enable-gcrypt --enable-pkcs1"
25 DEPS="libgcrypt11-dev"
26 ;;
27 printf-builtin)
28 CONFIG="--with-printf-hooks=builtin"
29 ;;
30 all)
31 CONFIG="--enable-all --disable-android-dns --disable-android-log
32 --disable-dumm --disable-kernel-pfroute --disable-keychain
33 --disable-lock-profiler --disable-maemo --disable-padlock
34 --disable-osx-attr --disable-tkm --disable-uci"
35 if test "$LEAK_DETECTIVE" = "yes"; then
36 # libgcrypt can't be deinitialized
37 CONFIG="$CONFIG --disable-gcrypt"
38 # libunwind causes threads to be cleaned up after LD is disabled
39 CONFIG="$CONFIG --disable-unwind-backtraces"
40 fi
41 # not enabled on the build server
42 CONFIG="$CONFIG --disable-af-alg"
43 # TODO: enable? perhaps via coveralls.io (cpp-coveralls)?
44 CONFIG="$CONFIG --disable-coverage"
45 DEPS="$DEPS libcurl4-gnutls-dev libsoup2.4-dev libunbound-dev libldns-dev
46 libmysqlclient-dev libsqlite3-dev clearsilver-dev libfcgi-dev
47 libnm-glib-dev libnm-glib-vpn-dev libpcsclite-dev libpam0g-dev
48 binutils-dev libunwind7-dev"
49 ;;
50 dist)
51 TARGET=distcheck
52 ;;
53 *)
54 echo "$0: unknown test $TEST" >&2
55 exit 1
56 ;;
57 esac
58
59 if test "$1" = "deps"; then
60 sudo apt-get install -qq $DEPS
61 exit $?
62 fi
63
64 CONFIG="$CONFIG
65 --enable-silent-rules
66 --enable-test-vectors
67 --enable-monolithic=${MONOLITHIC-no}
68 --enable-leak-detective=${LEAK_DETECTIVE-no}"
69
70 echo "$ ./configure $CONFIG && make $TARGET"
71 ./configure $CONFIG && make -j4 $TARGET