diff --git a/compiler/test/dotc/neg-init-global-scala2-library-tasty.blacklist b/compiler/test/dotc/neg-init-global-scala2-library-tasty.blacklist new file mode 100644 index 000000000000..f435867fcaab --- /dev/null +++ b/compiler/test/dotc/neg-init-global-scala2-library-tasty.blacklist @@ -0,0 +1,6 @@ +## See #18882 +patmat.scala +t9312.scala +unapplySeq-implicit-arg.scala +unapplySeq-implicit-arg2.scala +unapplySeq-implicit-arg3.scala diff --git a/compiler/test/dotc/neg-scala2-library-tasty.blacklist b/compiler/test/dotc/neg-scala2-library-tasty.blacklist new file mode 100644 index 000000000000..d46a021ddd50 --- /dev/null +++ b/compiler/test/dotc/neg-scala2-library-tasty.blacklist @@ -0,0 +1,2 @@ +i8752.scala +f-interpolator-neg.scala # Additional: A pure expression does nothing in statement position diff --git a/compiler/test/dotc/patmat-exhaustivity-scala2-library-tasty.blacklist b/compiler/test/dotc/patmat-exhaustivity-scala2-library-tasty.blacklist new file mode 100644 index 000000000000..6f1717d532fd --- /dev/null +++ b/compiler/test/dotc/patmat-exhaustivity-scala2-library-tasty.blacklist @@ -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 diff --git a/compiler/test/dotc/pos-init-global-scala2-library-tasty.blacklist b/compiler/test/dotc/pos-init-global-scala2-library-tasty.blacklist new file mode 100644 index 000000000000..eb60fc3b7c14 --- /dev/null +++ b/compiler/test/dotc/pos-init-global-scala2-library-tasty.blacklist @@ -0,0 +1,5 @@ +## See #18882 +patmat.scala +patmat-interpolator.scala +unapplySeq-implicit-arg-pos.scala +global-cycle11.scala diff --git a/compiler/test/dotc/run-macros-scala2-library-tasty.blacklist b/compiler/test/dotc/run-macros-scala2-library-tasty.blacklist new file mode 100644 index 000000000000..63a6e2cee345 --- /dev/null +++ b/compiler/test/dotc/run-macros-scala2-library-tasty.blacklist @@ -0,0 +1,4 @@ +# Checkfile differences for equivalent type +tasty-extractors-1 +tasty-extractors-2 +tasty-extractors-types diff --git a/compiler/test/dotc/scala2-library-tasty.blacklist b/compiler/test/dotc/scala2-library-tasty.blacklist deleted file mode 100644 index 53988852f36c..000000000000 --- a/compiler/test/dotc/scala2-library-tasty.blacklist +++ /dev/null @@ -1,30 +0,0 @@ -## tests/run-macros -tasty-extractors-1 -tasty-extractors-2 -tasty-extractors-types - -## tests/neg -i8752.scala -f-interpolator-neg.scala # Additional: A pure expression does nothing in statement position - -## (#18882) tests/init-global/neg -t9312.scala -unapplySeq-implicit-arg.scala -unapplySeq-implicit-arg2.scala -unapplySeq-implicit-arg3.scala - -## (#18882) tests/init-global/pos -patmat.scala -patmat-interpolator.scala -unapplySeq-implicit-arg-pos.scala -global-cycle11.scala - -## tests/patmat -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 - -## Other issues -# - CompilationTests.pos: tests/pos-special/stdlib -# - CoverageTests.checkInstrumentedRuns diff --git a/compiler/test/dotty/tools/TestSources.scala b/compiler/test/dotty/tools/TestSources.scala index 289359dab132..a288e49c5eb9 100644 --- a/compiler/test/dotty/tools/TestSources.scala +++ b/compiler/test/dotty/tools/TestSources.scala @@ -17,12 +17,16 @@ 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 @@ -30,19 +34,34 @@ object TestSources { 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 diff --git a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala index 7aefae6ee39d..ab2adddbb16e 100644 --- a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala @@ -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() } diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index 764e85cca9ca..41b8de0d6138 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -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")), @@ -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. @@ -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 diff --git a/compiler/test/dotty/tools/dotc/transform/PatmatExhaustivityTest.scala b/compiler/test/dotty/tools/dotc/transform/PatmatExhaustivityTest.scala index 66aed6e9973d..f538d9534cd9 100644 --- a/compiler/test/dotty/tools/dotc/transform/PatmatExhaustivityTest.scala +++ b/compiler/test/dotty/tools/dotc/transform/PatmatExhaustivityTest.scala @@ -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 =>