diff options
Diffstat (limited to '.private/ci-build.sh')
-rwxr-xr-x | .private/ci-build.sh | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/.private/ci-build.sh b/.private/ci-build.sh index 8a0da6b..33dfb3b 100755 --- a/.private/ci-build.sh +++ b/.private/ci-build.sh @@ -3,7 +3,10 @@ set -e builddir= +scriptdir=$(dirname $(readlink -f "$0")) install=no +test=yes +asan=yes while [ $# -gt 0 ]; do case "$1" in @@ -19,6 +22,14 @@ while [ $# -gt 0 ]; do install=yes shift ;; + --no-test) + test=no + shift + ;; + --no-asan) + asan=no + shift + ;; --) shift break; @@ -52,14 +63,28 @@ cflags+=" -Wpointer-arith" cflags+=" -Wredundant-decls" cflags+=" -Wswitch-enum" +# enable address sanitizer +if [ "${asan}" = "yes" ]; then + cflags+=" -fsanitize=address" +fi + echo "" echo "Configuring ..." -CFLAGS="${cflags}" ../configure --enable-examples-build --enable-tests-build "$@" +CFLAGS="${cflags}" CXXFLAGS="${cflags}" ../configure --enable-examples-build --enable-tests-build "$@" echo "" echo "Building ..." make -j4 -k +if [ "${test}" = "yes" ]; then + # Load custom shim for WebUSB tests that simulates Web environment. + export NODE_OPTIONS="--require ${scriptdir}/../tests/webusb-test-shim/" + if ! make check ; then + cat tests/test-suite.log + exit 1 + fi +fi + if [ "${install}" = "yes" ]; then echo "" echo "Installing ..." |