Browse Source

Support Xdebug 3.x for coverage

rpm
J. King 3 years ago
parent
commit
b12f87e231
  1. 4
      RoboFile.php
  2. 6
      tests/bootstrap.php

4
RoboFile.php

@ -96,11 +96,11 @@ class RoboFile extends \Robo\Tasks {
if (extension_loaded("pcov")) { if (extension_loaded("pcov")) {
return "$php -d pcov.enabled=1 -d pcov.directory=$code"; return "$php -d pcov.enabled=1 -d pcov.directory=$code";
} elseif (extension_loaded("xdebug")) { } elseif (extension_loaded("xdebug")) {
return $php; return "$php -d xdebug.mode=coverage";
} elseif (file_exists($dir."pcov.$ext")) { } elseif (file_exists($dir."pcov.$ext")) {
return "$php -d extension=pcov.$ext -d pcov.enabled=1 -d pcov.directory=$code"; return "$php -d extension=pcov.$ext -d pcov.enabled=1 -d pcov.directory=$code";
} elseif (file_exists($dir."xdebug.$ext")) { } elseif (file_exists($dir."xdebug.$ext")) {
return "$php -d zend_extension=xdebug.$ext"; return "$php -d zend_extension=xdebug.$ext -d xdebug.mode=coverage";
} else { } else {
if (IS_WIN) { if (IS_WIN) {
$dbg = dirname(\PHP_BINARY)."\\phpdbg.exe"; $dbg = dirname(\PHP_BINARY)."\\phpdbg.exe";

6
tests/bootstrap.php

@ -16,5 +16,9 @@ error_reporting(\E_ALL);
require_once BASE."vendor".DIRECTORY_SEPARATOR."autoload.php"; require_once BASE."vendor".DIRECTORY_SEPARATOR."autoload.php";
if (function_exists("xdebug_set_filter")) { if (function_exists("xdebug_set_filter")) {
xdebug_set_filter(\XDEBUG_FILTER_CODE_COVERAGE, \XDEBUG_PATH_WHITELIST, [BASE."lib/"]); if (defined("XDEBUG_PATH_INCLUDE")) {
xdebug_set_filter(\XDEBUG_FILTER_CODE_COVERAGE, XDEBUG_PATH_INCLUDE, [BASE."lib/"]);
} else {
xdebug_set_filter(\XDEBUG_FILTER_CODE_COVERAGE, XDEBUG_PATH_WHITELIST, [BASE."lib/"]);
}
} }

Loading…
Cancel
Save