blob: b4d8ec94eedfda8cfa00b9cdce6547ca1b58f619 [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() {
Davide Pesavento956ac312016-09-20 19:11:30 +020015 if (( BOOST_VERSION >= 106200 )); then
Davide Pesavento6a2b3da2016-10-15 04:10:37 +000016 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
Davide Pesavento956ac312016-09-20 19:11:30 +020017 else
18 if [[ -n $XUNIT ]]; then
19 echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
Davide Pesavento6a2b3da2016-10-15 04:10:37 +000020 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
Davide Pesavento956ac312016-09-20 19:11:30 +020021 else
22 echo --log_level=test_suite
23 fi
24 fi
25}
26
27ASAN_OPTIONS="color=always"
28ASAN_OPTIONS+=":detect_leaks=false"
29ASAN_OPTIONS+=":detect_stack_use_after_return=true"
30ASAN_OPTIONS+=":check_initialization_order=true"
31ASAN_OPTIONS+=":strict_init_order=true"
32ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
33ASAN_OPTIONS+=":detect_container_overflow=false"
34ASAN_OPTIONS+=":strict_string_checks=true"
35ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
36export ASAN_OPTIONS
37
Davide Pesavento3f2f4862018-09-11 17:56:55 -040038export BOOST_TEST_BUILD_INFO=1
39export BOOST_TEST_COLOR_OUTPUT=1
40
Davide Pesavento956ac312016-09-20 19:11:30 +020041# Run unit tests
42./build/unit-tests $(ut_log_args)