]> git.ipfire.org Git - thirdparty/lldpd.git/blob - tests/ci/run.sh
tests: be verbose when running make on CI when an error happens
[thirdparty/lldpd.git] / tests / ci / run.sh
1 #!/bin/sh
2
3 set -e
4
5 [ $CC != gcc ] || CC=gcc-5
6 LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS --enable-pie"
7 case "$(uname -s)" in
8 Linux)
9 LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS --localstatedir=/var --sysconfdir=/etc --prefix=/usr"
10 LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS --enable-sanitizers"
11 LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS LDFLAGS=-fuse-ld=gold"
12 ;;
13 Darwin)
14 LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS CFLAGS=-mmacosx-version-min=10.9"
15 LLDPD_CONFIG_ARGS="$LLDPD_CONFIG_ARGS LDFLAGS=-mmacosx-version-min=10.9"
16 ;;
17 esac
18
19 ./autogen.sh
20 ./configure $LLDPD_CONFIG_ARGS || {
21 cat config.log
22 exit 1
23 }
24 make all ${MAKE_ARGS-CFLAGS=-Werror} || make all ${MAKE_ARGS-CFLAGS=-Werror} V=1
25 make check ${MAKE_ARGS-CFLAGS=-Werror}
26 make distcheck
27
28 case "$(uname -s)" in
29 Darwin)
30 # Create a package
31 make -C osx pkg
32 otool -l osx/lldpd*/usr/local/sbin/lldpd
33 mkdir upload
34 mv *.pkg upload
35 ;;
36 Linux)
37 # Integration tests
38 cd tests/integration
39 sudo $(which python3) -m pytest -n 5 -vv --boxed || \
40 sudo $(which python3) -m pytest -vvv --last-failed --maxfail=5
41 ;;
42 esac