Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Count syntax errors caused by a mutatan as a failure of a mutant #1571

Merged
merged 1 commit into from Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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%
];
}
}