Skip to content

Commit

Permalink
Count syntax errors caused by a mutatan as a failure of a mutant (#1571)
Browse files Browse the repository at this point in the history
Fixes #1569, related to #1555
  • Loading branch information
sanmai committed Sep 11, 2021
1 parent 5c18760 commit 86e423c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Metrics/Calculator.php
Expand Up @@ -77,7 +77,7 @@ public static function fromMetrics(MetricsCalculator $calculator): self
return new self(
$calculator->getRoundingPrecision(),
$calculator->getKilledCount(),
$calculator->getErrorCount(),
$calculator->getErrorCount() + $calculator->getSyntaxErrorCount(),
$calculator->getTimedOutCount(),
$calculator->getNotTestedCount(),
$calculator->getTestedMutantsCount()
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/Logger/JsonLoggerTest.php
Expand Up @@ -112,9 +112,9 @@ public function metricsProvider(): iterable
'syntaxErrorCount' => 2,
'skippedCount' => 2,
'timeOutCount' => 2,
'msi' => 50,
'msi' => 66.67,
'mutationCodeCoverage' => 83.33,
'coveredCodeMsi' => 60,
'coveredCodeMsi' => 80,
],
'escaped' => [
[
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/Logger/PerMutatorLoggerTest.php
Expand Up @@ -80,8 +80,8 @@ public function metricsProvider(): iterable
| Mutator | Mutations | Killed | Escaped | Errors | Syntax Errors | Timed Out | Skipped | MSI (%s) | Covered MSI (%s) |
| --------- | --------- | ------ | ------- | ------ | ------------- | --------- | ------- | -------- | ---------------- |
| For_ | 7 | 1 | 1 | 1 | 1 | 1 | 1 | 50.00 | 60.00 |
| PregQuote | 7 | 1 | 1 | 1 | 1 | 1 | 1 | 50.00 | 60.00 |
| For_ | 7 | 1 | 1 | 1 | 1 | 1 | 1 | 66.67 | 80.00 |
| PregQuote | 7 | 1 | 1 | 1 | 1 | 1 | 1 | 66.67 | 80.00 |
TXT
];
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/Metrics/CalculatorTest.php
Expand Up @@ -174,9 +174,9 @@ public function metricsCalculatorProvider(): iterable

yield 'nominal' => [
$this->createCompleteMetricsCalculator(),
50., // 14 total mutations; 2 skipped; 6 of 12 are killed => 50%
66.67, // 14 total mutations; 2 skipped; 8 of 12 are killed => 66.67%
83.33, // 14 total mutations; 2 skipped & 2 not covered; => 10 of 12 => 83.33%
60.0, // 14 total mutations; 2 skipped & 2 not covered; 6 of 10 are killed => 60%
80.0, // 14 total mutations; 2 skipped & 2 not covered; 8 of 10 are killed => 80%
];
}
}

0 comments on commit 86e423c

Please sign in to comment.