Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 3 | |
| 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Alexander Afanasyev | e0ab3f9 | 2016-10-20 13:29:39 -0700 | [diff] [blame] | 7 | set -e |
| 8 | |
Alexander Afanasyev | d6453cd | 2015-08-20 21:45:36 -0700 | [diff] [blame] | 9 | pushd ns-3 >/dev/null |
| 10 | |
Alexander Afanasyev | e0ab3f9 | 2016-10-20 13:29:39 -0700 | [diff] [blame] | 11 | BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; v = _cache.BOOST_VERSION.split('_'); print int(v[0]) * 100000 + int(v[1]) * 100;") |
| 12 | |
| 13 | ut_log_args() { |
| 14 | if (( BOOST_VERSION >= 106200 )); then |
| 15 | echo --logger=HRF,test_suite,stdout:XML,all,build/xunit-${1:-report}.xml |
| 16 | else |
| 17 | if [[ -n $XUNIT ]]; then |
| 18 | echo --log_level=all $( (( BOOST_VERSION >= 106000 )) && echo -- ) \ |
| 19 | --log_format2=XML --log_sink2=build/xunit-${1:-report}.xml |
| 20 | else |
| 21 | echo --log_level=test_suite |
| 22 | fi |
| 23 | fi |
| 24 | } |
| 25 | |
| 26 | ASAN_OPTIONS="color=always" |
| 27 | ASAN_OPTIONS+=":detect_leaks=false" |
| 28 | ASAN_OPTIONS+=":detect_stack_use_after_return=true" |
| 29 | ASAN_OPTIONS+=":check_initialization_order=true" |
| 30 | ASAN_OPTIONS+=":strict_init_order=true" |
| 31 | ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1" |
| 32 | ASAN_OPTIONS+=":detect_container_overflow=false" |
| 33 | ASAN_OPTIONS+=":strict_string_checks=true" |
| 34 | ASAN_OPTIONS+=":strip_path_prefix=${PWD}/" |
| 35 | export ASAN_OPTIONS |
| 36 | |
Yuanzhi Gao | dd516fe | 2015-04-23 04:18:24 -0700 | [diff] [blame] | 37 | # Run unit tests |
Alexander Afanasyev | e0ab3f9 | 2016-10-20 13:29:39 -0700 | [diff] [blame] | 38 | ./waf --run "ndnSIM-unit-tests $(ut_log_args)" |
Alexander Afanasyev | d6453cd | 2015-08-20 21:45:36 -0700 | [diff] [blame] | 39 | |
| 40 | popd >/dev/null |