This is a follow-on task to http://www.google-melange.com/gci/task/view/google/gci2013/5849379982278656
This task involves making the new build system option robust. Basically, the build system needs to behave reasonably if code coverage is enabled, but the proper tools (e.g., lcov) do not exist. Instead of letting the user encounter some obscure error when they run "make", cause cmake to fail with an informative message.
The build system should test for the coverage flag(s) being used to make sure the compiler being used understands them (e.g., what happens if we turn on coverage when compiling under MSVC on Windows?). It should complete the request if what the user requested is technically possible, otherwise it should report the issue and halt with an informative message.
File name/URL | File size | Date submitted | |
---|---|---|---|
coverage-gcc.patch | 1.2 KB | December 12 2013 15:12 UTC | |
coverage-check.patch | 1.3 KB | December 14 2013 00:55 UTC |
I would like to work on this task.
This task has been assigned to Jacob B. You have 72 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.
The deadline of the task has been extended with 2 days and 0 hours.
Jacob,
Your method, testing for CMAKE_COMPILER_IS_GNUCC, isn't a good way. It's nearly always a bad idea to test for a platform or compiler "type" when you write build system code because their definitions are *constantly* changing. For example, using CMAKE_COMPILER_IS_GNUCC will not work when compiling with LLVM/clang if you have cmake 2.8.2+ (they fixed a bug where it reported GNU). Also, I'm sure I can find versions of gcc where those flags won't work too.
The fix isn't to start throwing in version numbers. Simply try compiling with that flag and see if it works. We do this for many other build flags (see CompilerFlags.cmake and BRLCAD_CompilerFlags.cmake), so you should be able to find some examples.
The work on this task is ready to be reviewed.
Congratulations, this task has been completed successfully.
Jacob, this is better but so you know, it's still lacking. You've tied understanding of --coverage and -fprofile-arcs with the -ftest-coverage flag, which may be reasonable but seems peculiar given it wasn't a flag you were previously using. Did CHECK_C_FLAG(-coverage) or CHECK_C_FLAG(coverage) not work? If both didn't, did you look at the cmake test output error log to see why it failed?
Moreover, what's the difference between -ftest-coverage and --coverage? This page only uses the new one you added: http://www.cmake.org/Wiki/CTest/Coverage