Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Kargov <kargov@gmail.com>2017-09-02 03:06:46 +0300
committervkargov <kargov@gmail.com>2017-09-05 02:34:30 +0300
commit90450cc1480d4b76732fd725da06d75da40665c6 (patch)
tree11af8f342cfccbf88d49522ebbff4ed11c03053d /scripts
parent6a95fac6d39e7afdd54999b3cbecdb10ae187470 (diff)
[ci] Add the coverage collection script.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ci/collect-coverage.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/ci/collect-coverage.sh b/scripts/ci/collect-coverage.sh
new file mode 100755
index 00000000000..f600c3ace39
--- /dev/null
+++ b/scripts/ci/collect-coverage.sh
@@ -0,0 +1,20 @@
+#!/bin/bash -x
+
+# This script is meant to be executed on all "slave" machines that run coverage collection.
+
+COV_DIR=coverage
+COV_INFO="$COV_DIR/$JOB_NAME.info"
+
+# Build Mono and collect coverage on the test suite.
+CI_TAGS=collect-coverage,monolite scripts/ci/run-jenkins.sh
+
+# Place the coverage info file into the coverage directory.
+# Multiple such files can be assembled to create a unified coverage report that spans multiple architectures and operating systems.
+mkdir "$COV_DIR"
+scripts/ci/run-step.sh --label=coverage-lcov --timeout=20m lcov --no-external -c -d mono -d support -d tools -o "$COV_INFO"
+
+# Generate HTML coverage report in the lcov directory at the root of the project.
+scripts/ci/run-step.sh --label=coverage-genhtml --timeout=20m genhtml "$COV_INFO" -o lcov
+
+# Make the paths relative so that they could be assembled from different Jenkins workspaces.
+sed -Eie "s#^SF:$WORKSPACE/?#SF:#" "$COV_INFO"