Skip to content

Commit 1a4db89

Browse files
Merge pull request #14969 from dotty-staging/fix-14968
Use filter in coverage tests
2 parents 3d4af20 + 318f610 commit 1a4db89

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/test/dotty/tools/dotc/coverage/CoverageTests.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ class CoverageTests:
4141
lines
4242
end fixWindowsPaths
4343

44-
Files.walk(dir).filter(scalaFile.matches).forEach(p => {
45-
val path = p
44+
def runOnFile(p: Path): Boolean =
45+
scalaFile.matches(p) &&
46+
(Properties.testsFilter.isEmpty || Properties.testsFilter.exists(p.toString.contains))
47+
48+
Files.walk(dir).filter(runOnFile).forEach(path => {
4649
val fileName = path.getFileName.toString.stripSuffix(".scala")
4750
val targetDir = computeCoverageInTmp(path, dir, run)
4851
val targetFile = targetDir.resolve(s"scoverage.coverage")
49-
val expectFile = p.resolveSibling(s"$fileName.scoverage.check")
50-
52+
val expectFile = path.resolveSibling(s"$fileName.scoverage.check")
5153
if updateCheckFiles then
5254
Files.copy(targetFile, expectFile, StandardCopyOption.REPLACE_EXISTING)
5355
else

0 commit comments

Comments
 (0)