blob: 01bf0703878525246ba9413aafa13c379d675dc8 [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Alexander Afanasyev33ce4c32014-10-24 11:19:45 -07002set -e
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04003
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Davide Pesavento09348882016-09-17 02:39:44 +02007set -x
8
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04009# Prepare environment
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040010rm -Rf ~/.ndn
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040011
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040012if has OSX $NODE_LABELS; then
Davide Pesavento09348882016-09-17 02:39:44 +020013 security unlock-keychain -p named-data
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040014fi
15
16ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
17
Alexander Afanasyev667370f2016-08-24 11:54:53 -070018BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
19
Davide Pesavento09348882016-09-17 02:39:44 +020020ut_log_args() {
Davide Pesavento09348882016-09-17 02:39:44 +020021 if (( BOOST_VERSION >= 106200 )); then
Davide Pesavento69ec4542016-10-12 20:03:09 +020022 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
Alexander Afanasyev667370f2016-08-24 11:54:53 -070023 else
Davide Pesavento09348882016-09-17 02:39:44 +020024 if [[ -n $XUNIT ]]; then
25 echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
Davide Pesavento69ec4542016-10-12 20:03:09 +020026 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
Davide Pesavento09348882016-09-17 02:39:44 +020027 else
28 echo --log_level=test_suite
29 fi
Alexander Afanasyev667370f2016-08-24 11:54:53 -070030 fi
Davide Pesavento09348882016-09-17 02:39:44 +020031}
Alexander Afanasyev667370f2016-08-24 11:54:53 -070032
Davide Pesavento50e20022016-09-17 18:50:27 +020033ASAN_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
Alexander Afanasyev667370f2016-08-24 11:54:53 -070044# Run unit tests
Davide Pesavento09348882016-09-17 02:39:44 +020045./build/unit-tests $(ut_log_args)