CI: a new style for LCOV reports

The standard style of LCOV HTML reports is a bit harsh to look at. This
commit replaces it with a new one.

The new CSS was written from scratch by looking at the HTML source code
of a generated LCOV report. The original gcov.css file was not used.

The color scheme is neutral, trying to avoid a Christmas tree effect.
The colors are intended to be calm while also distinguishable, and not
hamper text readability.

The font lists were taken from Gitlab with the hope that it will blend
in a little better when viewing from MR artifacts.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2021-03-15 11:20:17 +02:00 committed by Pekka Paalanen
parent 0db9176cbd
commit 640682115e
4 changed files with 161 additions and 0 deletions

View File

@ -139,6 +139,9 @@ docs-and-coverage:
script:
- mv prefix-weston-build-docs/share/doc/weston Documentation
- mv build-weston-build-native-meson-default-options/meson-logs/coveragereport Test_Coverage
- rm Test_Coverage/gcov.css
- cp doc/style/lcov-style.css Test_Coverage/gcov.css
- cp doc/style/*.png Test_Coverage/
- rm -rf build-* prefix-*
dependencies:
- build-docs

158
doc/style/lcov-style.css Normal file
View File

@ -0,0 +1,158 @@
/*
* Copyright 2021 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
body {
background-color: #f2f2f2;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
}
.sourceHeading, .source, .coverFn,
.testName, .testPer, .testNum,
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo,
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed,
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi,
.coverFile {
font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono",
"Consolas", "Ubuntu Mono", "Courier New", "andale mono",
"lucida console", monospace;
}
pre {
font-size: 0.7875rem;
}
.headerCovTableEntry, .testPer, .testNum, .testName,
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo,
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed,
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi {
text-align: right;
white-space: nowrap;
}
.coverPerLo, .coverPerMed, .coverPerHi, .testPer {
/* font-weight: bold;*/
}
.coverNumLo, .coverNumMed, .coverNumHi, .testNum {
font-style: italic;
font-size: 90%;
padding-left: 1em;
}
.title {
font-size: 200%;
}
.tableHead {
text-align: center;
font-weight: bold;
background-color: #bfbfbf;
}
.coverFile, .coverBar, .coverFn {
background-color: #d9d9d9;
}
.headerCovTableHead {
font-weight: bold;
text-align: right;
}
.headerCovTableEntry {
background-color: #d9d9d9;
}
.coverFnLo,
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo {
background-color: #f2dada;
}
.coverFnHi,
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed {
background-color: #add9ad;
}
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi {
background-color: #59b359;
}
.coverBarOutline {
border-style: solid;
border-width: 1px;
border-color: black;
padding: 0px;
}
.coverFnLo, .coverFnHi {
text-align: right;
}
.lineNum {
background-color: #d9d9d9;
}
.coverLegendCov, .lineCov, .branchCov {
background-image: url("taken.png");
background-repeat: repeat-y;
background-position: left top;
background-color: #c6ffb8;
}
.coverLegendNoCov, .lineNoCov, .branchNoCov, .branchNoExec {
background-image: url("nottaken.png");
background-repeat: repeat-y;
background-position: left top;
background-color: #ffcfbb;
}
.coverLegendCov, .coverLegendNoCov {
padding: 0em 1em 0em 1em;
}
.headerItem, .headerValue, .headerValueLeg {
white-space: nowrap;
}
.headerItem {
text-align: right;
font-weight: bold;
}
.ruler {
background-color: #d9d9d9;
}
.detail {
font-size: 80%;
}
.versionInfo {
font-size: 80%;
text-align: right;
}

BIN
doc/style/nottaken.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

BIN
doc/style/taken.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 947 B