travis-ci: test that configure fails without jansson

Update the no-jansson test to fail out if configure
passes.

The script needed to be converted into a single list item
for the early exit to work on Travis.
pull/3801/head
Jason Ish 7 years ago committed by Victor Julien
parent e49c40428e
commit 832270c1d3

@ -29,7 +29,6 @@ addons:
- libnfnetlink-dev - libnfnetlink-dev
- libnfnetlink0 - libnfnetlink0
- libhiredis-dev - libhiredis-dev
- libjansson-dev
- libevent-dev - libevent-dev
- libevent-pthreads-2.0-5 - libevent-pthreads-2.0-5
# Now define the default set of packages which is those above, and # Now define the default set of packages which is those above, and
@ -166,8 +165,9 @@ matrix:
- os: linux - os: linux
compiler: gcc compiler: gcc
env: env:
- NAME="linux,gcc,no-json" - NAME="linux,gcc,no-jansson"
- *default-cflags - *default-cflags
- CONFIGURE_SHOULD_FAIL="yes"
addons: addons:
apt: apt:
packages: packages:
@ -182,14 +182,22 @@ matrix:
- *default-cflags - *default-cflags
script: script:
- sh ./autogen.sh
- | - |
sh ./autogen.sh
if [[ "${NO_UNITTESTS}" != "yes" ]]; then if [[ "${NO_UNITTESTS}" != "yes" ]]; then
ARGS="${ARGS} --enable-unittests" ARGS="${ARGS} --enable-unittests"
fi fi
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}" export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
./configure --enable-nfqueue --enable-hiredis ${ARGS} if ! ./configure --enable-nfqueue --enable-hiredis ${ARGS}; then
if [[ "${CONFIGURE_SHOULD_FAIL}" = "yes" ]]; then
EXIT_CODE=0
else
EXIT_CODE=1
fi
fi
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}" export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
./configure --enable-hiredis --enable-ipfw \ ./configure --enable-hiredis --enable-ipfw \
@ -201,13 +209,17 @@ script:
--with-libnspr-includes=/usr/local/opt/nspr/include/nspr \ --with-libnspr-includes=/usr/local/opt/nspr/include/nspr \
--with-libnspr-libraries=/usr/local/opt/nspr/lib ${ARGS} --with-libnspr-libraries=/usr/local/opt/nspr/lib ${ARGS}
fi fi
- |
if [[ "${EXIT_CODE}" ]]; then
exit "${EXIT_CODE}"
fi
# Linux container builds have 2 cores, make use of them. # Linux container builds have 2 cores, make use of them.
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
j="-j 2" j="-j 2"
fi fi
make ${j} make ${j}
- |
# Like "make check", but fail on first error. We redirect the output # Like "make check", but fail on first error. We redirect the output
# so Travis doesn't fail the build with a too much output error. # so Travis doesn't fail the build with a too much output error.
if [[ "${NO_UNITTESTS}" != "yes" ]]; then if [[ "${NO_UNITTESTS}" != "yes" ]]; then
@ -219,16 +231,17 @@ script:
exit 1 exit 1
fi fi
fi fi
(cd qa/coccinelle && make check) (cd qa/coccinelle && make check)
- |
if [[ "$DO_DISTCHECK" == "yes" ]]; then if [[ "$DO_DISTCHECK" == "yes" ]]; then
make distcheck DISTCHECK_CONFIGURE_FLAGS="${ARGS}" make distcheck DISTCHECK_CONFIGURE_FLAGS="${ARGS}"
fi fi
- |
if [[ "$DO_CHECK_SETUP_SCRIPTS" == "yes" ]]; then if [[ "$DO_CHECK_SETUP_SCRIPTS" == "yes" ]]; then
(cd scripts && ./check-setup.sh) (cd scripts && ./check-setup.sh)
fi fi
- |
git clone https://github.com/OISF/suricata-verify.git verify git clone https://github.com/OISF/suricata-verify.git verify
python ./verify/run.py python ./verify/run.py

Loading…
Cancel
Save