-
Notifications
You must be signed in to change notification settings - Fork 99
build: migrate CoverageReport to cmake-extras & fix its usage #358
base: xenial
Are you sure you want to change the base?
build: migrate CoverageReport to cmake-extras & fix its usage #358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also remove the coverage related files from the cmake/modules/
directory.
Oh, Unity8 includes its own copy of So, this turns out to be migrating from the vendored copy to the copy in cmake-extras. And look like the copy in this package has not been updated since the project was first committed, so I'm not sure if the usage is still compatible. Given that the motivation of this PR is to make it possible to bring the newest cmake-extras into xenial so that mir-android-platform can use its GTest versioning, and my ultimate decision to not use that facility in the end, I'm not sure if it's worth it to check that. |
Yes, there's a local copy left over from when various projects simply included their own copies of things, and we didn't have |
This allows this package to receive updates to CoverageReport in the future. Also B-D on new enough cmake-extras (which is ancient at this point, but just in case).
Both ${SHELL_APP} variable and the target with that name is defined later in the CMakeLists.txt, so the coverage enabling code has to move down.
f30b293
to
43b3018
Compare
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" ) | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" ) | ||
ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, only the ENABLE_COVERAGE_REPORT
call needs to remain. The cmake-extras
module will automatically add the --coverage
arguments. So we can get rid of the extra stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like ENABLE_COVERAGE_REPORT
also has the TESTS
parameter. Am I supposed to put anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. It should list the tests targets. I guess we should refactor it a lot more to bubble up all the targets in a couple variables, from all the subdirs.
Uses CoverageReport from cmake-extras and moves its usage to the correct place. This should allow the coverage-reporting build to be built. At least in theory; I tested only the configure phase and didn't actually compile or generate the actual report out of it.