Skip to content

Commit b71b968

Browse files
committed
remove ENV overrides, shorten opt name, only allow setting via cmake option (not envvar), update doc ref
1 parent e2d638f commit b71b968

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

cmake/script/CoverageInclude.cmake.in

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
# Distributed under the MIT software license, see the accompanying
33
# file COPYING or https://opensource.org/license/mit/.
44

5-
if(NOT DEFINED LCOV_OPTS)
6-
set(LCOV_OPTS "$ENV{LCOV_OPTS}")
7-
endif()
8-
if(NOT DEFINED GENHTML_OPTS)
9-
set(GENHTML_OPTS "$ENV{GENHTML_OPTS}")
10-
endif()
11-
125
if("@CMAKE_CXX_COMPILER_ID@" STREQUAL "Clang")
136
find_program(LLVM_COV_EXECUTABLE llvm-cov REQUIRED)
147
set(COV_TOOL "${LLVM_COV_EXECUTABLE} gcov")
@@ -31,8 +24,8 @@ separate_arguments(LCOV_OPTS)
3124
set(LCOV_COMMAND ${LCOV_EXECUTABLE} --gcov-tool ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh ${LCOV_OPTS})
3225

3326
find_program(GENHTML_EXECUTABLE genhtml REQUIRED)
34-
separate_arguments(GENHTML_OPTS)
35-
set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${GENHTML_OPTS})
27+
separate_arguments(HTML_OPTS)
28+
set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${HTML_OPTS})
3629

3730
find_program(GREP_EXECUTABLE grep REQUIRED)
3831
find_program(AWK_EXECUTABLE awk REQUIRED)

doc/developer-notes.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,12 @@ enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`:
508508
cmake -DLCOV_OPTS="--rc branch_coverage=1" -P build/Coverage.cmake
509509
```
510510

511-
GENHTML_OPTS can be specified to provide options to genhtml, the program that generates the
512-
html report from lcov: `GENHTML_OPTS="--exclude boost"`.
511+
HTML_OPTS can be specified to provide options to genhtml, the program that generates the
512+
html report from lcov: `HTML_OPTS="--exclude boost"`.
513+
514+
```
515+
cmake -DHTML_OPTS="--exclude boost" -P build/Coverage.cmake
516+
```
513517

514518
To enable test parallelism:
515519
```

0 commit comments

Comments
 (0)