blob: bf142362e3682fb1b86ea1e3ede9bdf04a1840b3 [file] [log] [blame]
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -07001#!/usr/bin/env bash
2set -x
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -07003
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
Alexander Afanasyeve0ab3f92016-10-20 13:29:39 -07007set -e
8
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -07009pushd ns-3 >/dev/null
10
Alexander Afanasyeve0ab3f92016-10-20 13:29:39 -070011BOOST_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
13ut_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
26ASAN_OPTIONS="color=always"
27ASAN_OPTIONS+=":detect_leaks=false"
28ASAN_OPTIONS+=":detect_stack_use_after_return=true"
29ASAN_OPTIONS+=":check_initialization_order=true"
30ASAN_OPTIONS+=":strict_init_order=true"
31ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
32ASAN_OPTIONS+=":detect_container_overflow=false"
33ASAN_OPTIONS+=":strict_string_checks=true"
34ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
35export ASAN_OPTIONS
36
Yuanzhi Gaodd516fe2015-04-23 04:18:24 -070037# Run unit tests
Alexander Afanasyeve0ab3f92016-10-20 13:29:39 -070038./waf --run "ndnSIM-unit-tests $(ut_log_args)"
Alexander Afanasyevd6453cd2015-08-20 21:45:36 -070039
40popd >/dev/null