Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame^] | 2 | set -eo pipefail |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 4 | # https://github.com/google/sanitizers/wiki/AddressSanitizerFlags |
Davide Pesavento | 50e2002 | 2016-09-17 18:50:27 +0200 | [diff] [blame] | 5 | ASAN_OPTIONS="color=always" |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 6 | ASAN_OPTIONS+=":check_initialization_order=1" |
| 7 | ASAN_OPTIONS+=":detect_stack_use_after_return=1" |
| 8 | ASAN_OPTIONS+=":strict_init_order=1" |
| 9 | ASAN_OPTIONS+=":strict_string_checks=1" |
| 10 | ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2" |
Davide Pesavento | 50e2002 | 2016-09-17 18:50:27 +0200 | [diff] [blame] | 11 | ASAN_OPTIONS+=":strip_path_prefix=${PWD}/" |
| 12 | export ASAN_OPTIONS |
| 13 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame^] | 14 | # https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/runtime_config/summary.html |
Davide Pesavento | cdb5d8f | 2018-09-05 22:27:49 -0400 | [diff] [blame] | 15 | export BOOST_TEST_BUILD_INFO=1 |
| 16 | export BOOST_TEST_COLOR_OUTPUT=1 |
Davide Pesavento | 78338c5 | 2020-04-20 23:00:02 -0400 | [diff] [blame] | 17 | export BOOST_TEST_DETECT_MEMORY_LEAK=0 |
| 18 | export BOOST_TEST_LOGGER=HRF,test_suite,stdout:XML,all,build/xunit-log.xml |
Davide Pesavento | cdb5d8f | 2018-09-05 22:27:49 -0400 | [diff] [blame] | 19 | |
Davide Pesavento | 73e946e | 2022-08-06 16:44:54 -0400 | [diff] [blame^] | 20 | set -x |
| 21 | |
| 22 | # Prepare environment |
| 23 | rm -rf ~/.ndn |
| 24 | |
| 25 | if [[ $ID == macos && ${VERSION_ID%%.*} -lt 11 ]]; then |
| 26 | security unlock-keychain -p named-data |
| 27 | fi |
| 28 | |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame] | 29 | # Run unit tests |
Davide Pesavento | 78338c5 | 2020-04-20 23:00:02 -0400 | [diff] [blame] | 30 | ./build/unit-tests |