@@ -41,24 +41,24 @@ class CoverageTests:
41
41
lines
42
42
end fixWindowsPaths
43
43
44
- Files .walk(dir).filter(scalaFile.matches).forEach(p => {
45
- val path = p
46
- val fileName = path.getFileName.toString.stripSuffix(" .scala" )
47
- val targetDir = computeCoverageInTmp(path, dir, run)
48
- val targetFile = targetDir.resolve(s " scoverage.coverage " )
49
- val expectFile = p .resolveSibling(s " $fileName.scoverage.check " )
50
-
51
- if updateCheckFiles then
52
- Files .copy(targetFile, expectFile, StandardCopyOption .REPLACE_EXISTING )
53
- else
54
- val expected = fixWindowsPaths(Files .readAllLines(expectFile).asScala)
55
- val obtained = fixWindowsPaths(Files .readAllLines(targetFile).asScala)
56
- if expected != obtained then
57
- for ((exp, actual),i) <- expected.zip(obtained).filter(_ != _).zipWithIndex do
58
- Console .err.println(s " wrong line ${i+ 1 }: " )
59
- Console .err.println(s " expected: $exp" )
60
- Console .err.println(s " actual : $actual" )
61
- fail(s " $targetFile differs from expected $expectFile" )
44
+ Files .walk(dir).filter(scalaFile.matches).forEach(path => {
45
+ if Properties .testsFilter.isEmpty || Properties .testsFilter.exists(path.toString.contains) then
46
+ val fileName = path.getFileName.toString.stripSuffix(" .scala" )
47
+ val targetDir = computeCoverageInTmp(path, dir, run)
48
+ val targetFile = targetDir.resolve(s " scoverage.coverage " )
49
+ val expectFile = path .resolveSibling(s " $fileName.scoverage.check " )
50
+
51
+ if updateCheckFiles then
52
+ Files .copy(targetFile, expectFile, StandardCopyOption .REPLACE_EXISTING )
53
+ else
54
+ val expected = fixWindowsPaths(Files .readAllLines(expectFile).asScala)
55
+ val obtained = fixWindowsPaths(Files .readAllLines(targetFile).asScala)
56
+ if expected != obtained then
57
+ for ((exp, actual),i) <- expected.zip(obtained).filter(_ != _).zipWithIndex do
58
+ Console .err.println(s " wrong line ${i+ 1 }: " )
59
+ Console .err.println(s " expected: $exp" )
60
+ Console .err.println(s " actual : $actual" )
61
+ fail(s " $targetFile differs from expected $expectFile" )
62
62
63
63
})
64
64
0 commit comments