CMakePP / CMakeTest

A unit-testing framework for CMake functions
https://cmakepp.github.io/CMakeTest/
Apache License 2.0
10 stars 6 forks source link

Code Coverage Feature #88

Open Xyphenore opened 1 year ago

Xyphenore commented 1 year ago

Is your feature request related to a problem? Please describe.

I am attempting to utilize the cmake-unit framework for creating unit tests and code coverage for my project. However, I have encountered an issue where the framework is outdated and not functioning properly.

It is crucial for me to have code coverage in order to identify which lines are not being tested by our test cases. Currently, I am using the CMakeTest framework, but it does not provide any code coverage information.

Describe the solution you'd like

Include a code coverage feature that highlights the lines of code that are not being tested.

ryanmrichard commented 1 year ago

@Xyphenore, I did not realize that there was another CMake unit testing framework out there. Thanks for bringing this to our attention!

I also really want code coverage. Unfortunately code coverage is not going to make the 1.0 cut (which we're in the process of preparing). Once we have the 1.0 out, I think adding code coverage will be the top of our priority list. However, at the moment, @AutonomicPerfectionist is the only member of our team actively working on CMakeTest, and he's a student with limited time. So while code coverage will be coming, I have no idea what the time frame for adding it will be.

AutonomicPerfectionist commented 1 year ago

@Xyphenore thanks for the enhancement request and the info on CMakeUnit! As Ryan said we are currently preparing for a 1.0 release, but once that is complete I will look into coverage reporting. I'll also check out CMakeUnit and see if we can port over their implementation. I took a quick look at their repo but as I'm currently out of town it was difficult to read on my phone.

I do recall having a conversation with @ryanmrichard awhile ago about line coverage, I think we were considering using the CMake --trace command-line option and parsing the output. Maybe you could try doing that manually until we can add support ourselves?