Skip to content

Commit aec6070

Browse files
committed
Add Scala 2 library TASTy test blacklist
1 parent 3b81f4a commit aec6070

7 files changed

+67
-9
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
### tests/run
2+
typeclass-derivation3.scala # `::.next` vs `::.next$accessor$1`
3+
typelevel-peano.scala # failure to reduce inline match (fix in #18874)
4+
5+
## tests/run-macros
6+
tasty-extractors-2
7+
tasty-extractors-1
8+
tasty-extractors-types
9+
Xmacro-settings-compileTimeEnv # failure to reduce inline match
10+
11+
### tests/pos
12+
i13161.scala # failure to reduce inline match
13+
not-looping-implicit.scala # failure to reduce inline match
14+
15+
## tests/neg
16+
constructor-proxy-shadowing.scala
17+
i8752.scala
18+
f-interpolator-neg.scala # Additional: A pure expression does nothing in statement position
19+
20+
## (#18882) tests/init-global/neg
21+
unapplySeq-implicit-arg3.scala
22+
t9312.scala
23+
unapplySeq-implicit-arg2.scala
24+
unapplySeq-implicit-arg.scala
25+
26+
## (#18882) tests/init-global/pos
27+
patmat.scala
28+
patmat-interpolator.scala
29+
unapplySeq-implicit-arg-pos.scala
30+
global-cycle11.scala
31+
32+
## tests/patmat
33+
t7746.scala # order of exhaustivity suggestions differs
34+
t4408.scala # order of exhaustivity suggestions differs
35+
patmat-ortype.scala # order of exhaustivity suggestions differs
36+
i13003.scala # order of exhaustivity suggestions differs
37+
38+
## Other issues
39+
# - CompilationTests.pos: tests/pos-special/stdlib
40+
# - CoverageTests.checkInstrumentedRuns

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: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class CompilationTests {
3232
implicit val testGroup: TestGroup = TestGroup("compilePos")
3333
var tests = List(
3434
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init", "-Wunused:all", "-Xlint:private-shadow", "-Xlint:type-parameter-shadow"), FileFilter.include(TestSources.posLintingAllowlist)),
35-
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init"), FileFilter.exclude(TestSources.posLintingAllowlist)),
35+
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init"), FileFilter.exclude(TestSources.posLintingAllowlist ::: TestSources.scala2LibraryTastyBlacklisted)),
3636
compileFilesInDir("tests/pos-deep-subtype", allowDeepSubtypes),
3737
compileFilesInDir("tests/pos-special/sourcepath/outer", defaultOptions.and("-sourcepath", "tests/pos-special/sourcepath")),
3838
compileFile("tests/pos-special/sourcepath/outer/nested/Test4.scala", defaultOptions.and("-sourcepath", "tests/pos-special/sourcepath")),
@@ -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.
@@ -171,7 +174,7 @@ class CompilationTests {
171174
@Test def pickling: Unit = {
172175
implicit val testGroup: TestGroup = TestGroup("testPickling")
173176
aggregateTests(
174-
compileFilesInDir("tests/pos", picklingOptions, FileFilter.exclude(TestSources.posTestPicklingBlacklisted)),
177+
compileFilesInDir("tests/pos", picklingOptions, FileFilter.exclude(TestSources.posTestPicklingBlacklisted ::: TestSources.scala2LibraryTastyBlacklisted)),
175178
compileFilesInDir("tests/run", picklingOptions, FileFilter.exclude(TestSources.runTestPicklingBlacklisted))
176179
).checkCompile()
177180
}
@@ -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/coverage/CoverageTests.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class CoverageTests:
3232

3333
@Test
3434
def checkInstrumentedRuns(): Unit =
35-
checkCoverageIn(rootSrc.resolve("run"), true)
35+
if !Properties.usingScalaLibraryTasty then // FIXME: these tests should run using the Scala 2 library TASTy
36+
checkCoverageIn(rootSrc.resolve("run"), true)
3637

3738
def checkCoverageIn(dir: Path, run: Boolean)(using TestGroup): Unit =
3839
/** Converts \\ (escaped \) to / on windows, to make the tests pass without changing the serialization. */

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)