blob: 75c66dc62defd758ef136a7cdccbc0d50fe4bb3c [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento4a160042020-04-13 16:50:02 -04002set -ex
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
4# Prepare environment
Davide Pesavento4a160042020-04-13 16:50:02 -04005rm -rf ~/.ndn
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04006
7if has OSX $NODE_LABELS; then
8 security unlock-keychain -p named-data
9fi
10
11ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
12
Davide Pesavento4a160042020-04-13 16:50:02 -040013BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040014
15ut_log_args() {
16 if (( BOOST_VERSION >= 106200 )); then
17 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
18 else
19 if [[ -n $XUNIT ]]; then
20 echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
21 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
22 else
23 echo --log_level=test_suite
24 fi
25 fi
26}
27
Davide Pesavento4a160042020-04-13 16:50:02 -040028# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040029ASAN_OPTIONS="color=always"
Davide Pesavento4a160042020-04-13 16:50:02 -040030ASAN_OPTIONS+=":check_initialization_order=1"
31ASAN_OPTIONS+=":detect_stack_use_after_return=1"
32ASAN_OPTIONS+=":strict_init_order=1"
33ASAN_OPTIONS+=":strict_string_checks=1"
34ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
35ASAN_OPTIONS+=":detect_container_overflow=0"
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040036ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
37export ASAN_OPTIONS
38
Davide Pesavento4b76cb42019-03-18 18:46:09 -040039export BOOST_TEST_BUILD_INFO=1
40export BOOST_TEST_COLOR_OUTPUT=1
41
42# Run unit tests
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040043./build/unit-tests $(ut_log_args)