blob: d4b96522cff123a5308ee761f97613c5ce98a1c2 [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Davide Pesavento2349e282020-03-24 14:28:03 -04002set -ex
Davide Pesavento09348882016-09-17 02:39:44 +02003
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04004# Prepare environment
Davide Pesavento2349e282020-03-24 14:28:03 -04005rm -rf ~/.ndn
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04006
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04007if has OSX $NODE_LABELS; then
Davide Pesavento09348882016-09-17 02:39:44 +02008 security unlock-keychain -p named-data
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04009fi
10
11ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
12
Davide Pesaventod776a932020-03-20 18:42:36 -040013BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
Alexander Afanasyev667370f2016-08-24 11:54:53 -070014
Davide Pesavento09348882016-09-17 02:39:44 +020015ut_log_args() {
Davide Pesavento09348882016-09-17 02:39:44 +020016 if (( BOOST_VERSION >= 106200 )); then
Davide Pesavento69ec4542016-10-12 20:03:09 +020017 echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml
Alexander Afanasyev667370f2016-08-24 11:54:53 -070018 else
Davide Pesavento09348882016-09-17 02:39:44 +020019 if [[ -n $XUNIT ]]; then
20 echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \
Davide Pesavento69ec4542016-10-12 20:03:09 +020021 --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml
Davide Pesavento09348882016-09-17 02:39:44 +020022 else
23 echo --log_level=test_suite
24 fi
Alexander Afanasyev667370f2016-08-24 11:54:53 -070025 fi
Davide Pesavento09348882016-09-17 02:39:44 +020026}
Alexander Afanasyev667370f2016-08-24 11:54:53 -070027
Davide Pesavento2349e282020-03-24 14:28:03 -040028# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
Davide Pesavento50e20022016-09-17 18:50:27 +020029ASAN_OPTIONS="color=always"
Davide Pesavento2349e282020-03-24 14:28:03 -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"
Davide Pesavento50e20022016-09-17 18:50:27 +020035ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
36export ASAN_OPTIONS
37
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040038export BOOST_TEST_BUILD_INFO=1
39export BOOST_TEST_COLOR_OUTPUT=1
40
Alexander Afanasyev667370f2016-08-24 11:54:53 -070041# Run unit tests
Davide Pesavento09348882016-09-17 02:39:44 +020042./build/unit-tests $(ut_log_args)