Files
libcoap/scripts/build.sh
T
Jon Shallow 96d8877606 Fix reported issues #212, #214 and refix #199, add in valgrind to do the testing
build-env/Dockerfile.build-env
scripts/build.sh

Add in valgrind testing of the tests

src/option.c

Issue #199 Better fix of ADVANCE_OPT_CHECK()

src/pdu.c

Issue #214 Validate token length in coap_pdu_parse_header()

src/uri.c

Issue #212 Check not reading off end of buffer in dots()

tests/test_pdu.c
tests/test_uri.c

Tests updated to include tests for #212 & #214
2018-07-12 15:30:17 +01:00

46 lines
1.4 KiB
Bash
Executable File

#! /bin/sh
if test "x$TESTS" = "xyes" -o "x$TESTS" = "xtrue" ; then
WITH_TESTS="`scripts/fix-cunit.sh` --enable-tests"
test -f `pwd`/cunit.pc && echo cat `pwd`/cunit.pc
fi
case "x${TLS}" in
xno) WITH_TLS="--disable-dtls"
;;
xopenssl) WITH_TLS="--with-openssl"
;;
xtinydtls) WITH_TLS="--with-tinydtls --disable-shared"
;;
*) WITH_TLS="--with-gnutls"
;;
esac
config() {
echo "./configure $*"
./configure $* || cat config.log
}
case "${PLATFORM}" in
contiki) config "--disable-tests --disable-documentation --disable-examples $WITH_TLS" && \
make -C examples/contiki
;;
lwip) config "--disable-tests --disable-documentation --disable-examples $WITH_TLS" && \
make -C examples/lwip lwip lwip-contrib
make -C examples/lwip LDLIBS=`grep ac_cv_search_clock_gettime=- config.log|cut -d= -f2`
;;
posix|*) config "$WITH_TESTS --disable-documentation --enable-examples $WITH_TLS" && \
make
;;
esac
err=$?
if test $err = 0 -a -n "$WITH_TESTS" ; then
EXEC_FILE=tests/testdriver
# then run valgrind on the actual executable
libtool --mode=execute valgrind --track-origins=yes --leak-check=yes --show-reachable=yes --error-exitcode=123 --quiet $EXEC_FILE
err=$?
fi
exit $err