Skip to content

Commit b9d7b05

Browse files
committed
Add Scala 2 library TASTy test blacklist
1 parent c7af437 commit b9d7b05

File tree

6 files changed

+52
-6
lines changed

6 files changed

+52
-6
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
### tests/run
2+
typeclass-derivation3.scala # `::.next` vs `::.next$accessor$1`
3+
4+
## tests/run-macros
5+
tasty-extractors-2
6+
tasty-extractors-1
7+
tasty-extractors-types
8+
9+
## tests/neg
10+
constructor-proxy-shadowing.scala
11+
i8752.scala
12+
13+
## (#18882) tests/init-global/neg
14+
unapplySeq-implicit-arg3.scala
15+
t9312.scala
16+
unapplySeq-implicit-arg2.scala
17+
unapplySeq-implicit-arg.scala
18+
19+
## (#18882) tests/init-global/pos
20+
patmat.scala
21+
patmat-interpolator.scala
22+
unapplySeq-implicit-arg-pos.scala
23+
global-cycle11.scala
24+
25+
## tests/patmat
26+
t7746.scala # order of exhaustivity suggestions differs
27+
t4408.scala # order of exhaustivity suggestions differs
28+
patmat-ortype.scala # order of exhaustivity suggestions differs
29+
i13003.scala # order of exhaustivity suggestions differs

compiler/test/dotty/Properties.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ object Properties {
8585
/** scala-library TASTy jar */
8686
def scalaLibraryTasty: Option[String] = sys.props.get("dotty.tests.tasties.scalaLibrary")
8787

88+
/** If we are using the scala-library TASTy jar */
89+
def usingScalaLibraryTasty: Boolean = scalaLibraryTasty.isDefined
90+
8891
/** scala-asm jar */
8992
def scalaAsm: String = sys.props("dotty.tests.classes.scalaAsm")
9093

compiler/test/dotty/tools/TestSources.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import java.io.File
66
import java.nio.file._
77

88
import scala.jdk.CollectionConverters._
9+
import dotty.Properties
910

1011
object TestSources {
1112

@@ -36,6 +37,14 @@ object TestSources {
3637
def runTestRecheckExcluded: List[String] = loadList(runTestRecheckExcludesFile)
3738
def runLazyValsAllowlist: List[String] = loadList(runLazyValsAllowlistFile)
3839

40+
// other lists
41+
42+
def scala2LibraryTastyBlacklistFile: String = "compiler/test/dotc/scala2-library-tasty.blacklist"
43+
44+
def scala2LibraryTastyBlacklisted: List[String] =
45+
if Properties.usingScalaLibraryTasty then loadList(scala2LibraryTastyBlacklistFile)
46+
else Nil
47+
3948
// load lists
4049

4150
private def loadList(path: String): List[String] = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class BootstrappedOnlyCompilationTests {
120120

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

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ class CompilationTests {
4444
// Run tests for legacy lazy vals
4545
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init", "-Ylegacy-lazy-vals", "-Ycheck-constraint-deps"), FileFilter.include(TestSources.posLazyValsAllowlist)),
4646
compileDir("tests/pos-special/java-param-names", defaultOptions.withJavacOnlyOptions("-parameters")),
47-
compileDir("tests/pos-special/stdlib", allowDeepSubtypes),
47+
) ::: (
48+
// FIXME: This fails due to a bug involving self types and capture checking
49+
if Properties.usingScalaLibraryTasty then Nil
50+
else List(compileDir("tests/pos-special/stdlib", allowDeepSubtypes))
4851
)
4952

5053
if scala.util.Properties.isJavaAtLeast("16") then
@@ -128,7 +131,7 @@ class CompilationTests {
128131
@Test def negAll: Unit = {
129132
implicit val testGroup: TestGroup = TestGroup("compileNeg")
130133
aggregateTests(
131-
compileFilesInDir("tests/neg", defaultOptions),
134+
compileFilesInDir("tests/neg", defaultOptions, FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)),
132135
compileFilesInDir("tests/neg-deep-subtype", allowDeepSubtypes),
133136
compileFilesInDir("tests/neg-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
134137
compileFile("tests/neg-custom-args/sourcepath/outer/nested/Test1.scala", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath")),
@@ -151,7 +154,7 @@ class CompilationTests {
151154
@Test def runAll: Unit = {
152155
implicit val testGroup: TestGroup = TestGroup("runAll")
153156
aggregateTests(
154-
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init")),
157+
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init"), FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)),
155158
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
156159
compileFilesInDir("tests/run-custom-args/captures", allowDeepSubtypes.and("-language:experimental.captureChecking")),
157160
// Run tests for legacy lazy vals.
@@ -211,8 +214,8 @@ class CompilationTests {
211214
@Test def checkInitGlobal: Unit = {
212215
implicit val testGroup: TestGroup = TestGroup("checkInitGlobal")
213216
val options = defaultOptions.and("-Ysafe-init-global", "-Xfatal-warnings")
214-
compileFilesInDir("tests/init-global/neg", options).checkExpectedErrors()
215-
compileFilesInDir("tests/init-global/pos", options).checkCompile()
217+
compileFilesInDir("tests/init-global/neg", options, FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)).checkExpectedErrors()
218+
compileFilesInDir("tests/init-global/pos", options, FileFilter.exclude(TestSources.scala2LibraryTastyBlacklisted)).checkCompile()
216219
}
217220

218221
// initialization tests

compiler/test/dotty/tools/dotc/transform/PatmatExhaustivityTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ class PatmatExhaustivityTest {
6363

6464
@Test
6565
def patmatExhaustivity: Unit = {
66+
val blacklisted = TestSources.scala2LibraryTastyBlacklisted.toSet
6667
val res = Directory(testsDir).list.toList
6768
.filter(f => f.extension == "scala" || f.isDirectory)
6869
.filter { f =>
6970
val path = if f.isDirectory then f.path + "/" else f.path
7071
Properties.testsFilter.isEmpty || Properties.testsFilter.exists(path.contains)
7172
}
73+
.filterNot(f => blacklisted.contains(f.name))
7274
.map(f => if f.isDirectory then compileDir(f.jpath) else compileFile(f.jpath))
7375

7476
val failed = res.filter(!_)

0 commit comments

Comments
 (0)