Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | set -e |
| 3 | |
| 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
| 7 | set -x |
| 8 | |
| 9 | # Prepare environment |
| 10 | rm -Rf ~/.ndn |
| 11 | |
| 12 | BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);") |
| 13 | |
| 14 | ut_log_args() { |
| 15 | ((ut_count+=1)) |
| 16 | if (( BOOST_VERSION >= 106200 )); then |
| 17 | echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-report-${ut_count}.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-report-${ut_count}.xml |
| 22 | else |
| 23 | echo --log_level=test_suite |
| 24 | fi |
| 25 | fi |
| 26 | } |
| 27 | |
| 28 | ASAN_OPTIONS="color=always" |
| 29 | ASAN_OPTIONS+=":detect_leaks=false" |
| 30 | ASAN_OPTIONS+=":detect_stack_use_after_return=true" |
| 31 | ASAN_OPTIONS+=":check_initialization_order=true" |
| 32 | ASAN_OPTIONS+=":strict_init_order=true" |
| 33 | ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1" |
| 34 | ASAN_OPTIONS+=":detect_container_overflow=false" |
| 35 | ASAN_OPTIONS+=":strict_string_checks=true" |
| 36 | ASAN_OPTIONS+=":strip_path_prefix=${PWD}/" |
| 37 | export ASAN_OPTIONS |
| 38 | |
| 39 | # Run unit tests |
| 40 | ./build/unit-tests $(ut_log_args) |
| 41 | |
| 42 | unset ut_count |