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

CodeCoverage: better support for Xdebug 3 #424

Merged
merged 1 commit into from
Dec 3, 2020
Merged

Conversation

jiripudil
Copy link
Contributor

  • bug fix
  • BC break? no
  • doc PR: not necessary

Xdebug 3 requires xdebug.mode to include coverage for coverage to work, otherwise coverage-related symbols are not defined and tests fail with Error: Undefined constant "Tester\CodeCoverage\XDEBUG_CC_UNUSED".

Users can make it work by running tester with -d xdebug.mode=coverage, but I thought tester could setup this automatically, so that it works out of the box as with Xdebug 2. Therefore, this PR adds version number to code coverage engine info and uses that to automatically setup coverage mode for test processes when Xdebug >= 3.0.0 is used.

extension_loaded('xdebug') ? self::ENGINE_XDEBUG : null,
extension_loaded('pcov') ? [self::ENGINE_PCOV, phpversion('pcov')] : null,
defined('PHPDBG_VERSION') ? [self::ENGINE_PHPDBG, PHPDBG_VERSION] : null,
extension_loaded('xdebug') ? [self::ENGINE_XDEBUG, phpversion('xdebug')] : null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe [self::ENGINE_XDEBUG => phpversion('xdebug')]?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be harder to work with.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought it would be easier xd

@dg dg merged commit f01625a into nette:master Dec 3, 2020
dg pushed a commit that referenced this pull request Dec 3, 2020
@jiripudil jiripudil deleted the xdebug-3 branch December 3, 2020 11:29
dg pushed a commit that referenced this pull request Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants