blob: ec0f855722c9b15329099e678b0082d19fd26d31 [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
2set -x
Alexander Afanasyev33ce4c32014-10-24 11:19:45 -07003set -e
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04004
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
7
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04008# Prepare environment
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04009rm -Rf ~/.ndn
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040010
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -040011if has OSX $NODE_LABELS; then
Alexander Afanasyev667370f2016-08-24 11:54:53 -070012 echo "Unlocking OSX Keychain"
13 security unlock-keychain -p "named-data"
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040014fi
15
16ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
17
Alexander Afanasyev667370f2016-08-24 11:54:53 -070018BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
19
20if (( 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 Afanasyev8b881602014-11-20 19:58:07 -080032else
Alexander Afanasyev667370f2016-08-24 11:54:53 -070033 UNIT_TEST_PARAMS="--logger=HRF,test_suite,stdout:XML,all,build/xunit-report.xml"
Alexander Afanasyev8b881602014-11-20 19:58:07 -080034fi
Alexander Afanasyev667370f2016-08-24 11:54:53 -070035
36
37# Run unit tests
38./build/unit-tests $UNIT_TEST_PARAMS