Skip to content
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

fix xdebug coverage (part1): xdebug_get_code_coverage return value format for executed line #7888

Closed
wants to merge 1 commit into from

Conversation

xKerman
Copy link
Contributor

@xKerman xKerman commented Jun 18, 2017

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 .

see: 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
@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@hhvm-bot
Copy link
Contributor

@mofarrell has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@xKerman
Copy link
Contributor Author

xKerman commented Jun 29, 2017

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants