ci: Enable coverage report and allow unit test output in XML format
Change-Id: I952654aa25d2bdfb5ba1885d1c7570cfdb7e3edf
diff --git a/.jenkins.d/40-coverage.sh b/.jenkins.d/40-coverage.sh
new file mode 100755
index 0000000..ccbb62e
--- /dev/null
+++ b/.jenkins.d/40-coverage.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+set -x
+set -e
+
+IS_COVR=$( python -c "print 'yes' if 'code-coverage' in '$JOB_NAME' else 'no'" )
+
+if [[ $IS_COVR == "yes" ]]; then
+ BASE="`pwd | sed -e 's|/|\\\/|g'`\\"
+ (cd build && gcovr -x -f $BASE/src -r ../ -o coverage.xml -b ./)
+fi