-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gcov only reports coverage results for modules which have a test file #329
Comments
Can you provide a minimal example repo to reproduce this issue? I know with the filters off, the gcov utility will show any file touched by the tests even unity. |
Let's say I've the following project: Gcov results will only give the coverage for module_a.c because module_b.c isn't touched by any test. This also means that the overall code coverage number is misleading. Wouldn't it be a better practice if ceedling would take the untested modules into account automatically based on the defined source path in the project.yml file? |
Ceedling could do this, but the current ceedling gcov implementation is tied closely to how gcov works which will only give you data on what you compile. A simple work around for this is to have a test file for every module to make sure they are all compiled. I do think this would be something we could eventually tackle, but I'm not sure how much complexity it adds. I may do some simple investigation today to see if it's feasible. |
Just FYI: I am currently working on a solution where if any files without coverage are detected, the command aborts with an error status (if enabled in the project.yml), with an optional list of files to exclude from this behaviour. I'll try to remember to drop a note here once the PR gets accepted. (It is actually implemented at the moment, but we're having some other issues with the latest changes which need addressing first.) |
@tobyjwebb I saw that this feature was merged to master, but I still have a question. On the optional list of files to exclude, is it possible to add an entire folder and subfolder, like I do in :path_test: for exaemple: - src/**. I'm asking this, because on the :path_test: of my ceedling project, I informed an entire source project folder with many source and header files. Then I create a test module for a specific source file with mocks for that. However, when I perform the coverage analysis with gcov, I'm getting the error "Could not find coverage results for ..." for all the other source files on the folder. I'm not understanding why. I need some kind of configuration where the gcov should analyze only the file under testing. Is there any configuration for that? Or is there any other better solution in my case? good practice that I'm not following? thank you! |
Hi @beckerzito
... Nope, sorry. What I'm doing at the moment is just commenting the line in the What would be nice to have is that this setting should only apply when |
Hi, Is there any way (after few years) how to generate empty coverage results for missing files? Something like: for every source file stated in Creating empty test files for 100+ sources is...the last option :( |
How hard can it be for lcov to simply generate an empty info file with zero counters for all C files in a directory? |
Gcov only reports coverage results for modules which have a test file.
Ceedling currently ignores the modules which don't have a test file, hence the overall code coverage reported by gcov is meaningless.
A workaround is to create empty test files for modules which don't have tests yet...
The text was updated successfully, but these errors were encountered: