Yingdi Yu | 906c2ea | 2014-10-31 11:24:50 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame^] | 2 | set -ex |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 3 | |
| 4 | # Prepare environment |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame^] | 5 | rm -rf ~/.ndn |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 6 | |
| 7 | if has OSX $NODE_LABELS; then |
| 8 | security unlock-keychain -p named-data |
| 9 | fi |
| 10 | |
| 11 | ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert - |
| 12 | |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame^] | 13 | BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);") |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 14 | |
| 15 | ut_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 Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame^] | 28 | # https://github.com/google/sanitizers/wiki/AddressSanitizerFlags |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 29 | ASAN_OPTIONS="color=always" |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame^] | 30 | ASAN_OPTIONS+=":check_initialization_order=1" |
| 31 | ASAN_OPTIONS+=":detect_stack_use_after_return=1" |
| 32 | ASAN_OPTIONS+=":strict_init_order=1" |
| 33 | ASAN_OPTIONS+=":strict_string_checks=1" |
| 34 | ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2" |
Alexander Afanasyev | f3192eb | 2016-12-19 17:11:20 -0800 | [diff] [blame] | 35 | ASAN_OPTIONS+=":strip_path_prefix=${PWD}/" |
| 36 | export ASAN_OPTIONS |
| 37 | |
Davide Pesavento | 5188f31 | 2019-03-18 18:38:45 -0400 | [diff] [blame] | 38 | export BOOST_TEST_BUILD_INFO=1 |
| 39 | export BOOST_TEST_COLOR_OUTPUT=1 |
Davide Pesavento | c2489b4 | 2017-10-28 17:19:08 -0400 | [diff] [blame] | 40 | |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 41 | # Run unit tests |
| 42 | ./build/unit-tests $(ut_log_args) |