this makes coverage dumping work on windows; on windows the cwd is changed to the apache executable's path by the time the coverage end is reached, changing the coverage end function to a closure that gives back a function with the actual shimmie cwd stored fixes this
This commit is contained in:
parent
e9cabb30b3
commit
e5b3afb31c
@ -991,11 +991,15 @@ function _start_coverage() {
|
||||
|
||||
function _end_coverage() {
|
||||
if(function_exists("xdebug_get_code_coverage")) {
|
||||
if(!file_exists("data/coverage")) mkdir("data/coverage");
|
||||
$dir = getcwd();
|
||||
$end_cov = function() use ( $dir ) {
|
||||
if(!file_exists("$dir/data/coverage")) mkdir("$dir/data/coverage");
|
||||
$n = 0;
|
||||
$t = time();
|
||||
while(file_exists("data/coverage/$t.$n.log")) $n++;
|
||||
file_put_contents("data/coverage/$t.$n.log", serialize(xdebug_get_code_coverage()));
|
||||
while(file_exists("$dir/data/coverage/$t.$n.log")) $n++;
|
||||
file_put_contents("$dir/data/coverage/$t.$n.log", serialize(xdebug_get_code_coverage()));
|
||||
};
|
||||
return $end_cov;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user