-
Notifications
You must be signed in to change notification settings - Fork 12
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
Code coverage isn't correct #16
Comments
For reference, this is the setup for creating the coverage file:
|
Yes that does seem wonky. The first thing I'd suggest looking into is whether any of the code you are executing uses the profiler. This can invalidate the overall numbers, where a call to the profiler (while you are profiling to gather coverage) can result in losing prior coverage. Do you know if any of your code or any code you are calling is using the profiler? |
@acampbel — no, pretty sure there's nothing like that. When I get a bit more time I'll try to break up the tests and see if I can reproduce the issue with a minimal example. |
I tried to create a truly minimal example and couldn't reproduce this behaviour... I wonder if it's because the test cases are held in a separate folder. Snowed under again right now so will have to come back to this again later. |
Maybe @ranford can help me here :)
For one test
I've added a
choice = 3;
option inruntestsuite.m
which runs the test suite on ONLYtestcuboidtorque03.m
and producescoverage-debug.xml
. Comparing the output here forprivate/cuboid_torque_z_z.m
, there are lines in the coverage XML like:which match up with the edge case calculations:
These are explicitly tested in this test, hence the
4
hits on such lines.For all tests
But if I change to
choice=2;
inruntestsuite.m
the test suite runs on all tests, and producecoverage.xml
— this is the file that is linked to CodeCov. After running all tests I receive:Clearly something is going wrong here; shouldn't the hits per line accumulate as the entire test suite is run? More importantly, my coverage for this file is less than it should be!
The text was updated successfully, but these errors were encountered: