blob: d4b96522cff123a5308ee761f97613c5ce98a1c2 [file] [log] [blame]
Alexander Afanasyev21034bf2014-09-02 18:31:53 -07001#!/usr/bin/env bash
Davide Pesaventofee7ee32020-04-15 02:45:07 -04002set -ex
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -08003
Shock Jiangcde28712014-10-19 21:17:20 -07004# Prepare environment
Davide Pesaventofee7ee32020-04-15 02:45:07 -04005rm -rf ~/.ndn
Shock Jiangcde28712014-10-19 21:17:20 -07006
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07007if has OSX $NODE_LABELS; then
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -08008 security unlock-keychain -p named-data
Shock Jiangcde28712014-10-19 21:17:20 -07009fi
10
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080011ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
12
Davide Pesaventofee7ee32020-04-15 02:45:07 -040013BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -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 Pesaventofee7ee32020-04-15 02:45:07 -040028# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080029ASAN_OPTIONS="color=always"
Davide Pesaventofee7ee32020-04-15 02:45:07 -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 Afanasyev984ca9d2016-12-19 13:09:14 -080035ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
36export ASAN_OPTIONS
37
Davide Pesavento4a315b32018-11-24 14:32:19 -050038export BOOST_TEST_BUILD_INFO=1
39export BOOST_TEST_COLOR_OUTPUT=1
40
41# Run unit tests
42./build/unit-tests $(ut_log_args)