Skip to content

Commit

Permalink
Closes #3586
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Apr 8, 2019
1 parent 79b9a79 commit c0f18fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog-8.2.md
Expand Up @@ -4,5 +4,9 @@ All notable changes of the PHPUnit 8.2 release series are documented in this fil

## [8.2.0] - 2019-06-07

### Added

* Implemented [#3586](https://github.com/sebastianbergmann/phpunit/issues/3586): Show time spent on code coverage report generation

[8.2.0]: https://github.com/sebastianbergmann/phpunit/compare/8.1...8.2.0

16 changes: 14 additions & 2 deletions src/TextUI/TestRunner.php
Expand Up @@ -58,6 +58,7 @@
use SebastianBergmann\Comparator\Comparator;
use SebastianBergmann\Environment\Runtime;
use SebastianBergmann\Invoker\Invoker;
use SebastianBergmann\Timer\Timer;

/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
Expand Down Expand Up @@ -1287,17 +1288,28 @@ private function codeCoverageGenerationStart(string $format): void
$format
)
);

Timer::start();
}

private function codeCoverageGenerationSucceeded(): void
{
$this->printer->write(" done\n");
$this->printer->write(
\sprintf(
" done [%s]\n",
Timer::secondsToTimeString(Timer::stop())
)
);
}

private function codeCoverageGenerationFailed(\Exception $e): void
{
$this->printer->write(
" failed\n" . $e->getMessage() . "\n"
\sprintf(
" failed [%s]\n%s\n",
Timer::secondsToTimeString(Timer::stop()),
$e->getMessage()
)
);
}
}

0 comments on commit c0f18fc

Please sign in to comment.