blob: 216e89f9ebd30f066eca299e35e2ef5b69ae28cd [file] [log] [blame]
Davide Pesavento956ac312016-09-20 19:11:30 +02001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9# Prepare environment
10rm -Rf ~/.ndn
11
12BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
13
14ut_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
28ASAN_OPTIONS="color=always"
29ASAN_OPTIONS+=":detect_leaks=false"
30ASAN_OPTIONS+=":detect_stack_use_after_return=true"
31ASAN_OPTIONS+=":check_initialization_order=true"
32ASAN_OPTIONS+=":strict_init_order=true"
33ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
34ASAN_OPTIONS+=":detect_container_overflow=false"
35ASAN_OPTIONS+=":strict_string_checks=true"
36ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
37export ASAN_OPTIONS
38
39# Run unit tests
40./build/unit-tests $(ut_log_args)
41
42unset ut_count