OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # This is to be executed by each individual OS test. It only |
| 3 # combines coverage files and reports locally to the given |
| 4 # TeamCity build configuration. |
| 5 set -e |
| 6 set -o pipefail |
| 7 [ -z ${TEMP} ] && TEMP=/tmp |
| 8 |
| 9 # combine all .coverage* files, |
| 10 coverage combine |
| 11 |
| 12 # create ascii report, |
| 13 report_file=$(mktemp $TEMP/coverage.XXXXX) |
| 14 coverage report --rcfile=`dirname $0`/../.coveragerc > "${report_file}" 2>/dev/n
ull |
| 15 |
| 16 # Report Code Coverage for TeamCity, using 'Service Messages', |
| 17 # https://confluence.jetbrains.com/display/TCD8/How+To...#HowTo...-Importcoverag
eresultsinTeamCity |
| 18 # https://confluence.jetbrains.com/display/TCD8/Custom+Chart#CustomChart-Default
StatisticsValuesProvidedbyTeamCity |
| 19 total_no_lines=$(awk '/TOTAL/{printf("%s",$2)}' < "${report_file}") |
| 20 total_no_misses=$(awk '/TOTAL/{printf("%s",$3)}' < "${report_file}") |
| 21 total_no_covered=$((${total_no_lines} - ${total_no_misses})) |
| 22 echo "##teamcity[buildStatisticValue key='CodeCoverageAbsLTotal' value='""${tota
l_no_lines}""']" |
| 23 echo "##teamcity[buildStatisticValue key='CodeCoverageAbsLCovered' value='""${to
tal_no_covered}""']" |
| 24 |
| 25 # Display for human consumption and remove ascii file. |
| 26 cat "${report_file}" |
| 27 rm "${report_file}" |
OLD | NEW |