Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Alexander Afanasyev | 33ce4c3 | 2014-10-24 11:19:45 -0700 | [diff] [blame] | 2 | set -e |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 3 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 7 | set -x |
| 8 | |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 9 | # Prepare environment |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 10 | rm -Rf ~/.ndn |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 11 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 12 | if has OSX $NODE_LABELS; then |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 13 | security unlock-keychain -p named-data |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 14 | fi |
| 15 | |
| 16 | ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert - |
| 17 | |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame] | 18 | BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);") |
| 19 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 20 | ut_log_args() { |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 21 | if (( BOOST_VERSION >= 106200 )); then |
Davide Pesavento | 69ec454 | 2016-10-12 20:03:09 +0200 | [diff] [blame] | 22 | echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame] | 23 | else |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 24 | if [[ -n $XUNIT ]]; then |
| 25 | echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \ |
Davide Pesavento | 69ec454 | 2016-10-12 20:03:09 +0200 | [diff] [blame] | 26 | --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 27 | else |
| 28 | echo --log_level=test_suite |
| 29 | fi |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame] | 30 | fi |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 31 | } |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame] | 32 | |
Davide Pesavento | 50e2002 | 2016-09-17 18:50:27 +0200 | [diff] [blame] | 33 | ASAN_OPTIONS="color=always" |
Davide Pesavento | 50e2002 | 2016-09-17 18:50:27 +0200 | [diff] [blame] | 34 | ASAN_OPTIONS+=":detect_stack_use_after_return=true" |
| 35 | ASAN_OPTIONS+=":check_initialization_order=true" |
| 36 | ASAN_OPTIONS+=":strict_init_order=true" |
| 37 | ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1" |
| 38 | ASAN_OPTIONS+=":detect_container_overflow=false" |
| 39 | ASAN_OPTIONS+=":strict_string_checks=true" |
| 40 | ASAN_OPTIONS+=":strip_path_prefix=${PWD}/" |
| 41 | export ASAN_OPTIONS |
| 42 | |
Davide Pesavento | cdb5d8f | 2018-09-05 22:27:49 -0400 | [diff] [blame] | 43 | export BOOST_TEST_BUILD_INFO=1 |
| 44 | export BOOST_TEST_COLOR_OUTPUT=1 |
| 45 | |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame] | 46 | # Run unit tests |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 47 | ./build/unit-tests $(ut_log_args) |