Skip to content

Commit

Permalink
Use pcov for code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Feb 23, 2020
1 parent e7c043f commit 8c9bfae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ matrix:
- php: nightly

install:
- phpenv config-rm xdebug.ini
- pecl install pcov
- composer install

script:
Expand Down
18 changes: 9 additions & 9 deletions tests/DeferredTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public function getPromiseTestAdapter(callable $canceller = null)
/** @test */
public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerRejectsWithException()
{
if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) {
$this->markTestSkipped('This test has memory leaks when code coverage is collected');
}
// if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) {
// $this->markTestSkipped('This test has memory leaks when code coverage is collected');
// }

gc_collect_cycles();
$deferred = new Deferred(function ($resolve, $reject) {
Expand All @@ -40,9 +40,9 @@ public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerRejectsWithEx
/** @test */
public function shouldRejectWithoutCreatingGarbageCyclesIfParentCancellerRejectsWithException()
{
if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) {
$this->markTestSkipped('This test has memory leaks when code coverage is collected');
}
// if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) {
// $this->markTestSkipped('This test has memory leaks when code coverage is collected');
// }

gc_collect_cycles();
$deferred = new Deferred(function ($resolve, $reject) {
Expand All @@ -57,9 +57,9 @@ public function shouldRejectWithoutCreatingGarbageCyclesIfParentCancellerRejects
/** @test */
public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerHoldsReferenceAndExplicitlyRejectWithException()
{
if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) {
$this->markTestSkipped('This test has memory leaks when code coverage is collected');
}
// if ($this->getTestResultObject()->getCollectCodeCoverageInformation() === true) {
// $this->markTestSkipped('This test has memory leaks when code coverage is collected');
// }

gc_collect_cycles();
$deferred = new Deferred(function () use (&$deferred) { });
Expand Down

0 comments on commit 8c9bfae

Please sign in to comment.