blob: e9c1c85877cde03533859c741d34f39f6a86e81b [file] [log] [blame]
Alexander Afanasyev21034bf2014-09-02 18:31:53 -07001#!/usr/bin/env bash
Shock Jiang2d8483c2014-10-30 10:15:37 -07002set -e
Alexander Afanasyev21034bf2014-09-02 18:31:53 -07003
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -08007set -x
8
Shock Jiangcde28712014-10-19 21:17:20 -07009# Prepare environment
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070010rm -Rf ~/.ndn
Shock Jiangcde28712014-10-19 21:17:20 -070011
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070012if has OSX $NODE_LABELS; then
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080013 security unlock-keychain -p named-data
Shock Jiangcde28712014-10-19 21:17:20 -070014fi
15
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080016ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
17
18BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
19
20ut_log_args() {
21 if (( BOOST_VERSION >= 106200 )); then
22 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
23 else
24 if [[ -n $XUNIT ]]; then
25 echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
26 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
27 else
28 echo --log_level=test_suite
29 fi
30 fi
31}
32
33ASAN_OPTIONS="color=always"
34ASAN_OPTIONS+=":detect_leaks=false"
35ASAN_OPTIONS+=":detect_stack_use_after_return=true"
36ASAN_OPTIONS+=":check_initialization_order=true"
37ASAN_OPTIONS+=":strict_init_order=true"
38ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
39ASAN_OPTIONS+=":detect_container_overflow=false"
40ASAN_OPTIONS+=":strict_string_checks=true"
41ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
42export ASAN_OPTIONS
43
Davide Pesavento4a315b32018-11-24 14:32:19 -050044export BOOST_TEST_BUILD_INFO=1
45export BOOST_TEST_COLOR_OUTPUT=1
46
47# Run unit tests
48./build/unit-tests $(ut_log_args)