Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
Alexander Afanasyev | 33ce4c3 | 2014-10-24 11:19:45 -0700 | [diff] [blame] | 3 | set -e |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 4 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
| 7 | |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 8 | # Prepare environment |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 9 | rm -Rf ~/.ndn |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 10 | |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 11 | if has OSX $NODE_LABELS; then |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame^] | 12 | echo "Unlocking OSX Keychain" |
| 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 | |
| 20 | if (( BOOST_VERSION < 106200 )); then |
| 21 | if [[ -n "$XUNIT" ]]; then |
| 22 | UNIT_TEST_PARAMS1="--log_level=all" |
| 23 | UNIT_TEST_PARAMS2="--log_format2=XML --log_sink2=build/xunit-report.xml" |
| 24 | if (( BOOST_VERSION < 106000 )); then |
| 25 | UNIT_TEST_PARAMS="$UNIT_TEST_PARAMS1 $UNIT_TEST_PARAMS2" |
| 26 | else |
| 27 | UNIT_TEST_PARAMS="$UNIT_TEST_PARAMS1 -- $UNIT_TEST_PARAMS2" |
| 28 | fi |
| 29 | else |
| 30 | UNIT_TEST_PARAMS="--log_level=test_suite" |
| 31 | fi |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 32 | else |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame^] | 33 | UNIT_TEST_PARAMS="--logger=HRF,test_suite,stdout:XML,all,build/xunit-report.xml" |
Alexander Afanasyev | 8b88160 | 2014-11-20 19:58:07 -0800 | [diff] [blame] | 34 | fi |
Alexander Afanasyev | 667370f | 2016-08-24 11:54:53 -0700 | [diff] [blame^] | 35 | |
| 36 | |
| 37 | # Run unit tests |
| 38 | ./build/unit-tests $UNIT_TEST_PARAMS |