Make new coverage build flag behaveBRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: SeanTags: compile, gcc, windows, linux, macosx, bsd, unix, lcov, gcov

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.

 

Uploaded Work
File name/URLFile sizeDate submitted
coverage-gcc.patch1.2 KBDecember 12 2013 15:12 UTC
coverage-check.patch1.3 KBDecember 14 2013 00:55 UTC
Comments
Jacob Burroughson December 10 2013 13:05 UTCTask Claimed

I would like to work on this task.

Gauravjeet Singh on December 10 2013 15:38 UTCTask Assigned

This task has been assigned to Jacob B. You have 72 hours to complete this task, good luck!

Jacob Burroughson December 12 2013 15:12 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 13 2013 06:40 UTCTask Needs More Work

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.

Sean on December 13 2013 06:40 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Sean on December 13 2013 06:46 UTCwrong approach

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.


 

Jacob Burroughson December 14 2013 00:56 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 14 2013 02:46 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on December 14 2013 02:52 UTCgood but still incomplete

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