From 640682115ec32a3964362cc87ce660fe67de35cb Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Mon, 15 Mar 2021 11:20:17 +0200 Subject: [PATCH] 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 --- .gitlab-ci.yml | 3 + doc/style/lcov-style.css | 158 +++++++++++++++++++++++++++++++++++++++ doc/style/nottaken.png | Bin 0 -> 149 bytes doc/style/taken.png | Bin 0 -> 947 bytes 4 files changed, 161 insertions(+) create mode 100644 doc/style/lcov-style.css create mode 100644 doc/style/nottaken.png create mode 100644 doc/style/taken.png diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db2e42bf..c52dca96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/doc/style/lcov-style.css b/doc/style/lcov-style.css new file mode 100644 index 00000000..e5b35219 --- /dev/null +++ b/doc/style/lcov-style.css @@ -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; +} + diff --git a/doc/style/nottaken.png b/doc/style/nottaken.png new file mode 100644 index 0000000000000000000000000000000000000000..ebe34ec8adf7894e2a749f5a54ce2545fb6c9633 GIT binary patch literal 149 zcmeAS@N?(olHy`uVBq!ia0vp^96-#-!2~38k}5=i6lZ})WHAE+-w_aIoT|+y4HRTA z@$_|Nf66SvrL0tPL-Q6;NV3E=qQp5rH#aq}gu%HeHL)Z$MWH;iBtya7(>EZzkxv|` ph~Lx2F@)oK@*hdXqYb zaB^>EX>4U6ba`-PAZ2)IW&i+q+Rc?)lH4E+MgLhvmVhLL#Bwl?s_Y=k&&9?)J&#Py zRPqs14YVvIp@VQ3zkbf}0}m0$kkmYvoFkr8QsIh;$LpzQPcfbS_1y31wLCl&7&E~r zTR(64fSjSvTi&*v3b{TRDr3JmUcac@5c_s;JKTUQ+zf4Ef{G4T+Rh~8I(vVJ5L zV?s~xhJ8uFTrn=m-ZE%$h=zH&^ZNPoS>)jkePex%`kuW(&G9|ya3=ItkvD|$WBgD~ z`XUd{NKbB0o^#$ael4HrC8(QRxbe-|ea><1uBMDF=e?G8hs^u zwSwj-iH393amWs|Muiv{Cnf4sY0@~yMhzh*9t@7m+yJ))2pupAHy|Z|Mx)6F%v~G@ zpy4%voRayBG<01qIl^n#t289S%DJjm6CC3@6 zDwnI zHf5%%Gf$g7OPKXRZDW1czCn#PH9ko#MSD<#)a*7v>pIcJ48%AQfZHNK5||gW=#&yK za*J6kjH*yZkhTEsvw4Pu@2VD~~!gXDk1EdT`n3vywh`vST5+&-e#>-nLRlh7)| zmDDJxzLDUc9m{Yl;lf$-_0fDkhCjXd?)aY?LY7MS4g1{v*UUPcD*ylh24YJ`L;wH) z0002_L%V+f000SaNLh0L01m_e01m_fl`9S#00007bV*G`2jv721~Lr*G~(3&000?u zMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0000ENkl