blob: 2657aa9b8d0dc3e357dd678fefdfafd8db9f837f [file] [log] [blame]
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07001#!/usr/bin/env bash
Vince Lehman0a7da612014-10-29 14:39:29 -05002set -e
Davide Pesavento0b0eddd2019-03-19 14:42:15 -04003
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Davide Pesavento813df802017-08-20 20:53:54 -04007set -x
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07008
Davide Pesavento813df802017-08-20 20:53:54 -04009# Prepare environment
Vince Lehmanb45eed22015-01-13 14:58:07 -060010rm -Rf ~/.ndn
11
Davide Pesavento0b0eddd2019-03-19 14:42:15 -040012BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
13
Davide Pesavento813df802017-08-20 20:53:54 -040014ut_log_args() {
Davide Pesavento0b0eddd2019-03-19 14:42:15 -040015 if (( BOOST_VERSION >= 106200 )); then
16 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
17 else
18 if [[ -n $XUNIT ]]; then
19 echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
20 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
21 else
22 echo --log_level=test_suite
23 fi
24 fi
Davide Pesavento813df802017-08-20 20:53:54 -040025}
26
Davide Pesaventoc58cc7f2017-08-08 16:51:28 -050027ASAN_OPTIONS="color=always"
28ASAN_OPTIONS+=":detect_stack_use_after_return=true"
29ASAN_OPTIONS+=":check_initialization_order=true"
30ASAN_OPTIONS+=":strict_init_order=true"
31ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
32ASAN_OPTIONS+=":detect_container_overflow=false"
33ASAN_OPTIONS+=":strict_string_checks=true"
34ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
35export ASAN_OPTIONS
36
Davide Pesavento0b0eddd2019-03-19 14:42:15 -040037export BOOST_TEST_BUILD_INFO=1
38export BOOST_TEST_COLOR_OUTPUT=1
39
Davide Pesavento813df802017-08-20 20:53:54 -040040# Run unit tests
41./build/unit-tests-nlsr $(ut_log_args)