Alexander Afanasyev | 21034bf | 2014-09-02 18:31:53 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Shock Jiang | 2d8483c | 2014-10-30 10:15:37 -0700 | [diff] [blame] | 2 | set -e |
Alexander Afanasyev | 21034bf | 2014-09-02 18:31:53 -0700 | [diff] [blame] | 3 | |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame] | 7 | set -x |
| 8 | |
Shock Jiang | cde2871 | 2014-10-19 21:17:20 -0700 | [diff] [blame] | 9 | # Prepare environment |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 10 | rm -Rf ~/.ndn |
Shock Jiang | cde2871 | 2014-10-19 21:17:20 -0700 | [diff] [blame] | 11 | |
Alexander Afanasyev | c7c9900 | 2015-10-09 17:27:30 -0700 | [diff] [blame] | 12 | if has OSX $NODE_LABELS; then |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame] | 13 | security unlock-keychain -p named-data |
Shock Jiang | cde2871 | 2014-10-19 21:17:20 -0700 | [diff] [blame] | 14 | fi |
| 15 | |
Alexander Afanasyev | 984ca9d | 2016-12-19 13:09:14 -0800 | [diff] [blame] | 16 | ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert - |
| 17 | |
| 18 | BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);") |
| 19 | |
| 20 | ut_log_args() { |
| 21 | if (( BOOST_VERSION >= 106200 )); then |
| 22 | echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml |
| 23 | else |
| 24 | if [[ -n $XUNIT ]]; then |
| 25 | echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \ |
| 26 | --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml |
| 27 | else |
| 28 | echo --log_level=test_suite |
| 29 | fi |
| 30 | fi |
| 31 | } |
| 32 | |
| 33 | ASAN_OPTIONS="color=always" |
| 34 | ASAN_OPTIONS+=":detect_leaks=false" |
| 35 | ASAN_OPTIONS+=":detect_stack_use_after_return=true" |
| 36 | ASAN_OPTIONS+=":check_initialization_order=true" |
| 37 | ASAN_OPTIONS+=":strict_init_order=true" |
| 38 | ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1" |
| 39 | ASAN_OPTIONS+=":detect_container_overflow=false" |
| 40 | ASAN_OPTIONS+=":strict_string_checks=true" |
| 41 | ASAN_OPTIONS+=":strip_path_prefix=${PWD}/" |
| 42 | export ASAN_OPTIONS |
| 43 | |
| 44 | ./build/unit-tests $(ut_log_args ndns) |