1 appendToVar postPhases coverageReportPhase
3 coverageReportPhase
() {
4 lcov
--directory .
--capture --output-file app.info
6 lcov
--remove app.info
${lcovFilter:-"/nix/store/*"} > app2.info
10 mkdir
-p $out/coverage
11 genhtml app.info
$lcovExtraTraceFiles -o $out/coverage
> log
13 # Grab the overall coverage percentage so that Hydra can plot it over time.
14 mkdir
-p $out/nix-support
15 lineCoverage
="$(sed 's/.*lines\.*: \([0-9\.]\+\)%.*/\1/; t ; d' log)"
16 functionCoverage
="$(sed 's/.*functions\.*: \([0-9\.]\+\)%.*/\1/; t ; d' log)"
17 if [ -z "$lineCoverage" -o -z "$functionCoverage" ]; then
18 echo "failed to get coverage statistics"
21 echo "lineCoverage $lineCoverage %" >> $out/nix-support
/hydra-metrics
22 echo "functionCoverage $functionCoverage %" >> $out/nix-support
/hydra-metrics
24 echo "report coverage $out/coverage" >> $out/nix-support
/hydra-build-products