-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Reported code coverage differs from what PHP/Xdebug reports #1589
Comments
Thanks for reporting this. I don't know if anyone has looked at the code coverage code in a long time -- that I couldn't get an answer about it easily tells me that's probably the case. It looks like the last non-cleanup commit in the code was about 22 months ago, so if anyone wants to take a look at it before we get back it, it would be appreciated. |
I have noticed this too. As I test over the commandline, I do not have fancy graphics, but I have prepared a pastebin file with the PHPUnit outputs of runs on both HHVM and PHP 5.6: http://pastebin.com/VZvxC6TL |
Wow! 2 years old and no fix! |
I find that |
I am maintaining the "Coveralls" PHP library. Therefore, I would like to improve the HHVM Coverage acquisition problem. Is this problem likely to be solved? |
…format for executed line Summary: This pull request is related to #1589 . (I will submit another pull request for supporting `XDEBUG_CC_UNUSED` and `XDEBUG_CC_DEAD_CODE` later) `xdebug_get_code_coverage()` return value format is described in https://xdebug.org/docs/code_coverage : > The returned values for each line are: > * 1: this line was executed > * -1: this line was not executed > * -2: this line did not have executable code on it According to this description, `xdebug_get_code_coverage()` should return value like: ``` [ "/path/to/foo.php" => [ 3 => 1, // executed line 3 5 => 1, // executed line 5 ] ] ``` However, hhvm's `xdebug_get_code_coverage()` currently returns value like: ``` [ "/path/to/foo.php" => [ 3 => 2, // executed line 3 (2 times) 5 => 3, // executed line 5 (3 times) ] ] ``` In this pull request, hhvm's `xdebug_get_code_coverage()` return value format for executed line is changed to follow description in https://xdebug.org/docs/code_coverage . Closes #7888 Differential Revision: D5294692 Pulled By: mofarrell fbshipit-source-id: c394e7b7b7c352edf66b2d6fa4895413b2005a35
While working on code coverage support for PHPUnit on HHVM, I discovered that the reported code coverage differs from what Xdebug reports. This will probably not be the only difference between HHVM's and Xdebug's code coverage but it's the first I found.
To reproduce, simply run PHPUnit's
master
on the test suite of https://github.com/sebastianbergmann/money (phpunit -c build
).PHP and Xdebug report 100% code coverage:
HHVM reports less than 100% code coverage:
The text was updated successfully, but these errors were encountered: