facebook / hhvm

A virtual machine for executing programs written in Hack.
https://hhvm.com
Other
18.2k stars 3k forks source link

Reported code coverage differs from what PHP/Xdebug reports #1589

Open sebastianbergmann opened 10 years ago

sebastianbergmann commented 10 years ago

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:

php

HHVM reports less than 100% code coverage:

hhvm-1

hhvm-2

hhvm-3

scannell commented 10 years ago

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.

goldenice commented 9 years ago

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

keradus commented 8 years ago

Wow! 2 years old and no fix!

GroovyCarrot commented 7 years ago

I find that await seems to knock code coverage out for the rest of the function, as well as the inconsistencies mentioned above

KazuakiM commented 7 years ago

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?