Am 2017-08-07 09:57, schrieb Clément Gregoire:
Hi,
I'm a bit stuck when trying to add coverage reports to Cmake (gcov +
lcov)
as I can't figure out what is the best (idiomatic) way to do it.
So far here are the ways I know of :
- setting the CMAKE_LANG_FLAGS based on a boolean + scan all files /
run
gcov on it : would like to avoid this
- same but adding a new build type : seems to be way better but running
gcov would still be a pain
- same with a tool chain file for the flags : doesn't sound a good idea
since coverage should only be ran in debug
- some library to link with that propagates the flags : not possible
because link flags are not transient
- macro that adds the flags / does magic on a per target basis : many
scripts do this but seems to be a pain to maintain. Also I would rather
have all my test targets be set up automatically
- any of the above for flags and Ctest ctest_coverage but all I need
are
the gcov/lcov reports, not the coverage.xml for the dashboard
- using the command parameter of add_test
- something I missed?
I want the setup to be easy and compatible with codecov.io, sadly all
the
script I found are bad, undocumented, or old and using bad practices.
What's wrong with this one:
https://github.com/codecov/example-cpp11-cmake ?
I use it for both Codecov.io and CDash at the same time, see
https://github.com/osm2go/osm2go/blob/master/.travis.yml
Eike
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake