f600c3ace39acb3db11090fee9c33d3e3de325c8
[mono.git] / scripts / ci / collect-coverage.sh
1 #!/bin/bash -x
2
3 # This script is meant to be executed on all "slave" machines that run coverage collection.
4
5 COV_DIR=coverage
6 COV_INFO="$COV_DIR/$JOB_NAME.info"
7
8 # Build Mono and collect coverage on the test suite.
9 CI_TAGS=collect-coverage,monolite scripts/ci/run-jenkins.sh
10
11 # Place the coverage info file into the coverage directory.
12 # Multiple such files can be assembled to create a unified coverage report that spans multiple architectures and operating systems.
13 mkdir "$COV_DIR"
14 scripts/ci/run-step.sh --label=coverage-lcov --timeout=20m lcov --no-external -c -d mono -d support -d tools -o "$COV_INFO"
15
16 # Generate HTML coverage report in the lcov directory at the root of the project.
17 scripts/ci/run-step.sh --label=coverage-genhtml --timeout=20m genhtml "$COV_INFO" -o lcov
18
19 # Make the paths relative so that they could be assembled from different Jenkins workspaces.
20 sed -Eie "s#^SF:$WORKSPACE/?#SF:#" "$COV_INFO"