Fix build with current ndn-cxx and update CI scripts

Change-Id: I766c4679456561d6d7335889b8b9974dc7b94aa6
diff --git a/.jenkins.d/30-coverage.sh b/.jenkins.d/30-coverage.sh
new file mode 100755
index 0000000..9990760
--- /dev/null
+++ b/.jenkins.d/30-coverage.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+set -e
+
+JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+source "$JDIR"/util.sh
+
+set -x
+
+if [[ $JOB_NAME == *"code-coverage" ]]; then
+    gcovr --object-directory=build \
+          --output=build/coverage.xml \
+          --exclude="$PWD/tests" \
+          --root=. \
+          --xml
+
+    # Generate also a detailed HTML output, but using lcov (better results)
+    lcov --quiet \
+         --capture \
+         --directory . \
+         --no-external \
+         --rc lcov_branch_coverage=1 \
+         --output-file build/coverage-with-tests.info
+
+    lcov --quiet \
+         --remove build/coverage-with-tests.info "$PWD/tests/*" \
+         --rc lcov_branch_coverage=1 \
+         --output-file build/coverage.info
+
+    genhtml --branch-coverage \
+            --demangle-cpp \
+            --frames \
+            --legend \
+            --output-directory build/coverage \
+            --title "NDNS unit tests" \
+            build/coverage.info
+fi