Skip to content

Commit 18e9c87

Browse files
committed
cmake: fix code coverage module
- Add `LUA_SOURCE_DIR` to BuildLuaJIT.cmake, becuase it is used in CodeCoverage.cmake. - Fix deprecated gcovr options: `--branches` [1] and `--sort-percentage` [2]. 1. https://gcovr.com/en/stable/manpage.html#cmdoption-gcovr-b 2. https://gcovr.com/en/stable/manpage.html#cmdoption-gcovr-p
1 parent d88281c commit 18e9c87

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmake/BuildLuaJIT.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ macro(build_luajit LJ_VERSION)
130130
set(LUA_LIBRARIES bundled-liblua)
131131
set(LUA_INCLUDE_DIR ${LJ_SOURCE_DIR}/src/)
132132
set(LUA_VERSION_STRING "LuaJIT ${LJ_VERSION}")
133+
set(LUA_SOURCE_DIR ${LJ_SOURCE_DIR})
133134

134135
unset(LJ_SOURCE_DIR)
135136
unset(LJ_BINARY_DIR)

cmake/CodeCoverage.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ endif()
1818

1919
# See https://gcovr.com/en/stable/manpage.html.
2020
set(GCOVR_OPTIONS
21-
--branches
21+
--txt-metric branch
2222
--cobertura ${COVERAGE_XML_REPORT}
2323
--decisions
2424
--gcov-executable "llvm-cov gcov"
@@ -29,7 +29,7 @@ set(GCOVR_OPTIONS
2929
--output ${COVERAGE_HTML_REPORT}
3030
--print-summary
3131
--root ${LUA_SOURCE_DIR}
32-
--sort-percentage
32+
--sort-key uncovered-percent
3333
)
3434

3535
if(USE_LUA)

0 commit comments

Comments
 (0)