blob: ea1ec19e768cc3fdea5fef3808bf42814c9ad1e1 [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Davide Pesavento73e946e2022-08-06 16:44:54 -04002set -eo pipefail
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04003
Davide Pesavento2349e282020-03-24 14:28:03 -04004# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
Davide Pesavento50e20022016-09-17 18:50:27 +02005ASAN_OPTIONS="color=always"
Davide Pesavento2349e282020-03-24 14:28:03 -04006ASAN_OPTIONS+=":check_initialization_order=1"
7ASAN_OPTIONS+=":detect_stack_use_after_return=1"
8ASAN_OPTIONS+=":strict_init_order=1"
9ASAN_OPTIONS+=":strict_string_checks=1"
10ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
Davide Pesavento50e20022016-09-17 18:50:27 +020011ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
12export ASAN_OPTIONS
13
Davide Pesavento73e946e2022-08-06 16:44:54 -040014# https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/runtime_config/summary.html
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040015export BOOST_TEST_BUILD_INFO=1
16export BOOST_TEST_COLOR_OUTPUT=1
Davide Pesavento78338c52020-04-20 23:00:02 -040017export BOOST_TEST_DETECT_MEMORY_LEAK=0
18export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml
Davide Pesaventocdb5d8f2018-09-05 22:27:49 -040019
Davide Pesavento73e946e2022-08-06 16:44:54 -040020set -x
21
22# Prepare environment
23rm -rf ~/.ndn
24
25if [[ $ID == macos && ${VERSION_ID%%.*} -lt 11 ]]; then
26 security unlock-keychain -p named-data
27fi
28
Alexander Afanasyev667370f2016-08-24 11:54:53 -070029# Run unit tests
Davide Pesavento78338c52020-04-20 23:00:02 -040030./build/unit-tests