blob: 18d1c911f11c88236a2d715a8c4ffc810388e82b [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
10
11ut_log_args() {
12 if (( BOOST_VERSION >= 106200 )); then
13 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
14 else
15 if [[ -n $XUNIT ]]; then
16 echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
17 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
18 else
19 echo --log_level=test_suite
20 fi
21 fi
22}
23
24ASAN_OPTIONS="color=always"
25ASAN_OPTIONS+=":detect_leaks=false"
26ASAN_OPTIONS+=":detect_stack_use_after_return=true"
27ASAN_OPTIONS+=":check_initialization_order=true"
28ASAN_OPTIONS+=":strict_init_order=true"
29ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
30ASAN_OPTIONS+=":detect_container_overflow=false"
31ASAN_OPTIONS+=":strict_string_checks=true"
32ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
33export ASAN_OPTIONS
34
35# First run all tests as unprivileged user
36./build/unit-tests $(ut_log_args)