-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
Lines with 0 executions should be marked as "Non covered" #1060
Comments
You need to separate the code that uses this library from the code you want code coverage for. |
Please do not use Xdebug's API directly, but only use |
Awesome, that was the issue, thank you! I updated the code in the repo, now the report properly shows 50% of the methods/code is tested. |
Hello its me again! You can find the minimal repository to see the issue here: https://github.com/gufoe/php-debug This happens in 3 cases:
Here is the screenshots of the report results, after the first run, and after the second run: |
I am new to this library which seems fantastic, but I have found a weird behaviour.
Files that have some lines tested are shown as 100% tested, even if they contain some functions that have never been executed.
I have made a very minimal and self contained example here, you can just run it with
php -d xdebug.mode=coverage index.php
and you'll find the report inreport/index.html
.The report will show the file as 100% coverage (3/3 lines).
But the file does not have 3 lines: it has 41 lines, so i was expecting 3/41 tested (~7% coverage).
Am I getting something wrong or is there a bug in the library?
Thank you very much for the effort you put into this library, it really helps.
The text was updated successfully, but these errors were encountered: