Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Vince Lehman | 0a7da61 | 2014-10-29 14:39:29 -0500 | [diff] [blame] | 2 | set -e |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame^] | 3 | |
| 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 7 | set -x |
Alexander Afanasyev | bc98fcf | 2014-08-16 23:18:50 -0700 | [diff] [blame] | 8 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 9 | # Prepare environment |
Vince Lehman | b45eed2 | 2015-01-13 14:58:07 -0600 | [diff] [blame] | 10 | rm -Rf ~/.ndn |
| 11 | |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame^] | 12 | BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);") |
| 13 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 14 | ut_log_args() { |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame^] | 15 | 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 Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 25 | } |
| 26 | |
Davide Pesavento | c58cc7f | 2017-08-08 16:51:28 -0500 | [diff] [blame] | 27 | ASAN_OPTIONS="color=always" |
| 28 | ASAN_OPTIONS+=":detect_stack_use_after_return=true" |
| 29 | ASAN_OPTIONS+=":check_initialization_order=true" |
| 30 | ASAN_OPTIONS+=":strict_init_order=true" |
| 31 | ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1" |
| 32 | ASAN_OPTIONS+=":detect_container_overflow=false" |
| 33 | ASAN_OPTIONS+=":strict_string_checks=true" |
| 34 | ASAN_OPTIONS+=":strip_path_prefix=${PWD}/" |
| 35 | export ASAN_OPTIONS |
| 36 | |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame^] | 37 | export BOOST_TEST_BUILD_INFO=1 |
| 38 | export BOOST_TEST_COLOR_OUTPUT=1 |
| 39 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 40 | # Run unit tests |
| 41 | ./build/unit-tests-nlsr $(ut_log_args) |