Skip to content

Commit 86b4d62

Browse files
Merge pull request #11950 from dotty-staging/fix-11885
Fix typo in idempotency test filter
2 parents 4ab402c + 9c94edc commit 86b4d62

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

compiler/test/dotty/tools/dotc/IdempotencyTests.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ class IdempotencyTests {
1818
import IdempotencyTests._
1919
import CompilationTest.aggregateTests
2020

21+
val filter = FileFilter.exclude(
22+
s"pos${JFile.separator}i6507b"
23+
)
24+
2125
@Category(Array(classOf[SlowTests]))
2226
@Test def idempotency: Unit = {
2327
implicit val testGroup: TestGroup = TestGroup("idempotency")
2428
val opt = defaultOptions
2529

2630
val posIdempotency = aggregateTests(
27-
compileFilesInDir("tests/pos", opt)(TestGroup("idempotency/posIdempotency1")),
28-
compileFilesInDir("tests/pos", opt)(TestGroup("idempotency/posIdempotency2")),
31+
compileFilesInDir("tests/pos", opt, filter)(TestGroup("idempotency/posIdempotency1")),
32+
compileFilesInDir("tests/pos", opt, filter)(TestGroup("idempotency/posIdempotency2")),
2933
)
3034

3135
val orderIdempotency = {

compiler/test/dotty/tools/vulpix/FileFilter.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ sealed trait FileFilter {
55
}
66

77
object FileFilter {
8+
def exclude(file: String): FileFilter = exclude(file :: Nil)
9+
10+
def exclude(file: String, files: String*): FileFilter =
11+
exclude(file :: files.toList)
812

913
def exclude(files: List[String]): FileFilter = new FileFilter {
1014
private val blackList = files.toSet

tests/idempotency/IdempotencyCheck.scala

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ import java.util.stream.Stream as JStream
66
import scala.collection.JavaConverters.*
77

88
object IdempotencyCheck {
9-
val flakyTestsOnWindows =
10-
if scala.util.Properties.isWin
11-
then Set(s"pos${JFile.separator}i6507b")
12-
else Set.empty
13-
14-
val blacklisted = flakyTestsOnWindows
15-
169
def checkIdempotency(dir1: String, dir2: String): Unit = {
1710
var failed = 0
1811
var total = 0
@@ -25,14 +18,14 @@ object IdempotencyCheck {
2518
val bytecodeFiles = {
2619
def bytecodeFiles(paths: JStream[JPath], dir: String): List[(String, JPath)] = {
2720
def isBytecode(file: String) = file.endsWith(".class") || file.endsWith(".tasty")
28-
def tupleWithName(f: JPath) = (f.toString.substring(dir.length + 1, f.toString.length - 6), f)
21+
def tupleWithName(f: JPath) = (f.toString.substring(dir.length, f.toString.length - 6), f)
2922
paths.iterator.asScala.filter(path => isBytecode(path.toString)).map(tupleWithName).toList
3023
}
3124
bytecodeFiles(JFiles.walk(dir1Path), dir1String) ++ bytecodeFiles(JFiles.walk(dir2Path), dir2String)
3225
}
3326
val groups = bytecodeFiles.groupBy(_._1).mapValues(_.map(_._2))
3427

35-
groups.filterNot(x => blacklisted(x._1)).iterator.flatMap { g =>
28+
groups.iterator.flatMap { g =>
3629
def pred(f: JPath, dir: String, isTasty: Boolean) =
3730
f.toString.contains(dir) && f.toString.endsWith(if (isTasty) ".tasty" else ".class")
3831
val class1 = g._2.find(f => pred(f, dir1String, isTasty = false))

0 commit comments

Comments
 (0)