Skip to content

Commit

Permalink
Split blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Nov 20, 2023
1 parent 0cbee8f commit 726da0c
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## See #18882
patmat.scala
t9312.scala
unapplySeq-implicit-arg.scala
unapplySeq-implicit-arg2.scala
unapplySeq-implicit-arg3.scala
2 changes: 2 additions & 0 deletions compiler/test/dotc/neg-scala2-library-tasty.blacklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
i8752.scala
f-interpolator-neg.scala # Additional: A pure expression does nothing in statement position
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
t7746.scala # order of exhaustivity suggestions differs
t4408.scala # order of exhaustivity suggestions differs
patmat-ortype.scala # order of exhaustivity suggestions differs
i13003.scala # order of exhaustivity suggestions differs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## See #18882
patmat.scala
patmat-interpolator.scala
unapplySeq-implicit-arg-pos.scala
global-cycle11.scala
4 changes: 4 additions & 0 deletions compiler/test/dotc/run-macros-scala2-library-tasty.blacklist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Checkfile differences for equivalent type
tasty-extractors-1
tasty-extractors-2
tasty-extractors-types
30 changes: 0 additions & 30 deletions compiler/test/dotc/scala2-library-tasty.blacklist

This file was deleted.

29 changes: 24 additions & 5 deletions compiler/test/dotty/tools/TestSources.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,51 @@ object TestSources {
def posTestRecheckExcludesFile: String = "compiler/test/dotc/pos-test-recheck.excludes"
def posLazyValsAllowlistFile: String = "compiler/test/dotc/pos-lazy-vals-tests.allowlist"
def posLintingAllowlistFile: String = "compiler/test/dotc/pos-linting.allowlist"
def posInitGlobalScala2LibraryTastyBlacklistFile: String = "compiler/test/dotc/pos-init-global-scala2-library-tasty.blacklist"

def posFromTastyBlacklisted: List[String] = loadList(posFromTastyBlacklistFile)
def posTestPicklingBlacklisted: List[String] = loadList(posTestPicklingBlacklistFile)
def posTestRecheckExcluded: List[String] = loadList(posTestRecheckExcludesFile)
def posLazyValsAllowlist: List[String] = loadList(posLazyValsAllowlistFile)
def posLintingAllowlist: List[String] = loadList(posLintingAllowlistFile)
def posInitGlobalScala2LibraryTastyBlacklisted: List[String] =
if Properties.usingScalaLibraryTasty then loadList(posInitGlobalScala2LibraryTastyBlacklistFile)
else Nil

// run tests lists

def runFromTastyBlacklistFile: String = "compiler/test/dotc/run-from-tasty.blacklist"
def runTestPicklingBlacklistFile: String = "compiler/test/dotc/run-test-pickling.blacklist"
def runTestRecheckExcludesFile: String = "compiler/test/dotc/run-test-recheck.excludes"
def runLazyValsAllowlistFile: String = "compiler/test/dotc/run-lazy-vals-tests.allowlist"

def runMacrosScala2LibraryTastyBlacklistFile: String = "compiler/test/dotc/run-macros-scala2-library-tasty.blacklist"

def runFromTastyBlacklisted: List[String] = loadList(runFromTastyBlacklistFile)
def runTestPicklingBlacklisted: List[String] = loadList(runTestPicklingBlacklistFile)
def runTestRecheckExcluded: List[String] = loadList(runTestRecheckExcludesFile)
def runLazyValsAllowlist: List[String] = loadList(runLazyValsAllowlistFile)
def runMacrosScala2LibraryTastyBlacklisted: List[String] =
if Properties.usingScalaLibraryTasty then loadList(runMacrosScala2LibraryTastyBlacklistFile)
else Nil

// neg tests lists

def negScala2LibraryTastyBlacklistFile: String = "compiler/test/dotc/neg-scala2-library-tasty.blacklist"
def negInitGlobalScala2LibraryTastyBlacklistFile: String = "compiler/test/dotc/neg-init-global-scala2-library-tasty.blacklist"

def negScala2LibraryTastyBlacklisted: List[String] =
if Properties.usingScalaLibraryTasty then loadList(negScala2LibraryTastyBlacklistFile)
else Nil
def negInitGlobalScala2LibraryTastyBlacklisted: List[String] =
if Properties.usingScalaLibraryTasty then loadList(negInitGlobalScala2LibraryTastyBlacklistFile)
else Nil

// other lists
// patmat tests lists

def scala2LibraryTastyBlacklistFile: String = "compiler/test/dotc/scala2-library-tasty.blacklist"
def patmatExhaustivityScala2LibraryTastyBlacklistFile: String = "compiler/test/dotc/patmat-exhaustivity-scala2-library-tasty.blacklist"

def scala2LibraryTastyBlacklisted: List[String] =
if Properties.usingScalaLibraryTasty then loadList(scala2LibraryTastyBlacklistFile)
def patmatExhaustivityScala2LibraryTastyBlacklisted: List[String] =
if Properties.usingScalaLibraryTasty then loadList(patmatExhaustivityScala2LibraryTastyBlacklistFile)
else Nil

// load lists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class BootstrappedOnlyCompilationTests {

@Test def runMacros: Unit = {
implicit val testGroup: TestGroup = TestGroup("runMacros")
compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros"), FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted))
compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros"), FileFilter.exclude(TestSources.runMacrosScala2LibraryTastyBlacklisted))
.checkRuns()
}

Expand Down
8 changes: 4 additions & 4 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class CompilationTests {
@Test def negAll: Unit = {
implicit val testGroup: TestGroup = TestGroup("compileNeg")
aggregateTests(
compileFilesInDir("tests/neg", defaultOptions, FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)),
compileFilesInDir("tests/neg", defaultOptions, FileFilter.exclude(TestSources.negScala2LibraryTastyBlacklisted)),
compileFilesInDir("tests/neg-deep-subtype", allowDeepSubtypes),
compileFilesInDir("tests/neg-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
compileFile("tests/neg-custom-args/sourcepath/outer/nested/Test1.scala", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath")),
Expand All @@ -156,7 +156,7 @@ class CompilationTests {
@Test def runAll: Unit = {
implicit val testGroup: TestGroup = TestGroup("runAll")
aggregateTests(
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init"), FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)),
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init")),
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
compileFilesInDir("tests/run-custom-args/captures", allowDeepSubtypes.and("-language:experimental.captureChecking")),
// Run tests for legacy lazy vals.
Expand Down Expand Up @@ -216,8 +216,8 @@ class CompilationTests {
@Test def checkInitGlobal: Unit = {
implicit val testGroup: TestGroup = TestGroup("checkInitGlobal")
val options = defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings")
compileFilesInDir("tests/init-global/neg", options, FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)).checkExpectedErrors()
compileFilesInDir("tests/init-global/pos", options, FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)).checkCompile()
compileFilesInDir("tests/init-global/neg", options, FileFilter.exclude(TestSources.negInitGlobalScala2LibraryTastyBlacklisted)).checkExpectedErrors()
compileFilesInDir("tests/init-global/pos", options, FileFilter.exclude(TestSources.posInitGlobalScala2LibraryTastyBlacklisted)).checkCompile()
}

// initialization tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class PatmatExhaustivityTest {

@Test
def patmatExhaustivity: Unit = {
val blacklisted = TestSources.scala2LibraryTastyBlacklisted.toSet
val blacklisted = TestSources.patmatExhaustivityScala2LibraryTastyBlacklisted.toSet
val res = Directory(testsDir).list.toList
.filter(f => f.extension == "scala" || f.isDirectory)
.filter { f =>
Expand Down

0 comments on commit 726da0c

Please sign in to comment.