Skip to content

Commit a65fa39

Browse files
committed
CliTester: hint message when coverage file is empty
1 parent a3a8569 commit a65fa39

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Runner/CliTester.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ private function finishCodeCoverage(string $file): void
236236
if (!in_array($this->options['-o'], ['none', 'tap', 'junit'], true)) {
237237
echo 'Generating code coverage report... ';
238238
}
239+
if (filesize($file) === 0) {
240+
echo 'failed. Coverage file is empty. Do you call Tester\Environment::setup() in tests?';
241+
return;
242+
}
239243
if (pathinfo($file, PATHINFO_EXTENSION) === 'xml') {
240244
$generator = new CodeCoverage\Generators\CloverXMLGenerator($file, $this->options['--coverage-src']);
241245
} else {

0 commit comments

Comments
 (0)