blob: d4b96522cff123a5308ee761f97613c5ce98a1c2 [file] [log] [blame]
Yingdi Yu906c2ea2014-10-31 11:24:50 -07001#!/usr/bin/env bash
Davide Pesaventoa0546db2020-04-01 19:18:04 -04002set -ex
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -08003
4# Prepare environment
Davide Pesaventoa0546db2020-04-01 19:18:04 -04005rm -rf ~/.ndn
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -08006
7if has OSX $NODE_LABELS; then
8 security unlock-keychain -p named-data
9fi
10
11ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
12
Davide Pesaventoa0546db2020-04-01 19:18:04 -040013BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080014
15ut_log_args() {
16 if (( BOOST_VERSION >= 106200 )); then
17 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.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-${1:-report}.xml
22 else
23 echo --log_level=test_suite
24 fi
25 fi
26}
27
Davide Pesaventoa0546db2020-04-01 19:18:04 -040028# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080029ASAN_OPTIONS="color=always"
Davide Pesaventoa0546db2020-04-01 19:18:04 -040030ASAN_OPTIONS+=":check_initialization_order=1"
31ASAN_OPTIONS+=":detect_stack_use_after_return=1"
32ASAN_OPTIONS+=":strict_init_order=1"
33ASAN_OPTIONS+=":strict_string_checks=1"
34ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
Alexander Afanasyevf3192eb2016-12-19 17:11:20 -080035ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
36export ASAN_OPTIONS
37
Davide Pesavento5188f312019-03-18 18:38:45 -040038export BOOST_TEST_BUILD_INFO=1
39export BOOST_TEST_COLOR_OUTPUT=1
Davide Pesaventoc2489b42017-10-28 17:19:08 -040040
Davide Pesavento7ef57e22017-10-28 16:58:43 -040041# Run unit tests
42./build/unit-tests $(ut_log_args)