tests+ci: Customize unit test running for different versions of Boost

Change-Id: I1619c84653f82c2b0c00c379b8cb61bc43546d87
Refs: #3750
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index bb1cf63..ec0f855 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -9,15 +9,30 @@
 rm -Rf ~/.ndn
 
 if has OSX $NODE_LABELS; then
-  echo "Unlocking OSX Keychain"
-  security unlock-keychain -p "named-data"
+    echo "Unlocking OSX Keychain"
+    security unlock-keychain -p "named-data"
 fi
 
 ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
 
-# Run unit tests
-if [[ -n "$XUNIT" ]]; then
-    ./build/unit-tests --log_level=all -- --log_format2=XML --log_sink2=build/xunit-report.xml
+BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
+
+if (( BOOST_VERSION < 106200 )); then
+    if [[ -n "$XUNIT" ]]; then
+        UNIT_TEST_PARAMS1="--log_level=all"
+        UNIT_TEST_PARAMS2="--log_format2=XML --log_sink2=build/xunit-report.xml"
+        if (( BOOST_VERSION < 106000 )); then
+            UNIT_TEST_PARAMS="$UNIT_TEST_PARAMS1 $UNIT_TEST_PARAMS2"
+        else
+            UNIT_TEST_PARAMS="$UNIT_TEST_PARAMS1 -- $UNIT_TEST_PARAMS2"
+        fi
+    else
+        UNIT_TEST_PARAMS="--log_level=test_suite"
+    fi
 else
-    ./build/unit-tests -l test_suite
+    UNIT_TEST_PARAMS="--logger=HRF,test_suite,stdout:XML,all,build/xunit-report.xml"
 fi
+
+
+# Run unit tests
+./build/unit-tests $UNIT_TEST_PARAMS