Skip to content

Commit 9eb96ee

Browse files
authored
Backport "Simplify macro tests with custom args" to LTS (#19158)
Backports #18369 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents 85aae06 + 43d421a commit 9eb96ee

File tree

102 files changed

+117
-11173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+117
-11173
lines changed

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

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ class BootstrappedOnlyCompilationTests {
2929
aggregateTests(
3030
compileFilesInDir("tests/bench", defaultOptions.without("-Yno-deep-subtypes")),
3131
compileFilesInDir("tests/pos-macros", defaultOptions.and("-Xcheck-macros")),
32-
compileFilesInDir("tests/pos-custom-args/semanticdb", defaultOptions.and("-Xsemanticdb")),
33-
compileDir("tests/pos-special/i7592", defaultOptions.and("-Yretain-trees")),
34-
compileDir("tests/pos-special/i11331.1", defaultOptions),
35-
compileDir("tests/pos-custom-args/i13405", defaultOptions.and("-Xfatal-warnings")),
3632
).checkCompile()
3733
}
3834

@@ -107,12 +103,8 @@ class BootstrappedOnlyCompilationTests {
107103

108104
@Test def negMacros: Unit = {
109105
implicit val testGroup: TestGroup = TestGroup("compileNegWithCompiler")
110-
aggregateTests(
111-
compileFilesInDir("tests/neg-macros", defaultOptions.and("-Xcheck-macros")),
112-
compileFile("tests/pos-macros/i9570.scala", defaultOptions.and("-Xfatal-warnings")),
113-
compileFile("tests/pos-macros/macro-deprecation.scala", defaultOptions.and("-Xfatal-warnings", "-deprecation")),
114-
compileFile("tests/pos-macros/macro-experimental.scala", defaultOptions.and("-Yno-experimental")),
115-
).checkExpectedErrors()
106+
compileFilesInDir("tests/neg-macros", defaultOptions.and("-Xcheck-macros"))
107+
.checkExpectedErrors()
116108
}
117109

118110
@Test def negWithCompiler: Unit = {
@@ -127,26 +119,20 @@ class BootstrappedOnlyCompilationTests {
127119

128120
@Test def runMacros: Unit = {
129121
implicit val testGroup: TestGroup = TestGroup("runMacros")
130-
aggregateTests(
131-
compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros")),
132-
compileFilesInDir("tests/run-custom-args/Yretain-trees", defaultOptions and "-Yretain-trees"),
133-
compileFilesInDir("tests/run-custom-args/Yread-comments", defaultOptions and "-Yread-docs"),
134-
compileFilesInDir("tests/run-custom-args/run-macros-erased", defaultOptions.and("-language:experimental.erasedDefinitions").and("-Xcheck-macros")),
135-
compileDir("tests/run-custom-args/Xmacro-settings/simple", defaultOptions.and("-Xmacro-settings:one,two,three")),
136-
compileDir("tests/run-custom-args/Xmacro-settings/compileTimeEnv", defaultOptions.and("-Xmacro-settings:a,b=1,c.b.a=x.y.z=1,myLogger.level=INFO")),
137-
)
138-
}.checkRuns()
122+
compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros"))
123+
.checkRuns()
124+
}
139125

140126
@Test def runWithCompiler: Unit = {
141127
implicit val testGroup: TestGroup = TestGroup("runWithCompiler")
142128
val basicTests = List(
143129
compileFilesInDir("tests/run-with-compiler", withCompilerOptions),
144130
compileFilesInDir("tests/run-staging", withStagingOptions),
145-
compileFilesInDir("tests/run-custom-args/tasty-inspector", withTastyInspectorOptions)
131+
compileFilesInDir("tests/run-tasty-inspector", withTastyInspectorOptions)
146132
)
147133
val tests =
148134
if scala.util.Properties.isWin then basicTests
149-
else compileDir("tests/run-custom-args/tasty-interpreter", withTastyInspectorOptions) :: basicTests
135+
else compileDir("tests/old-tasty-interpreter-prototype", withTastyInspectorOptions) :: basicTests
150136

151137
aggregateTests(tests: _*).checkRuns()
152138
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class CompilationTests {
5050
compileFilesInDir("tests/pos-custom-args/no-experimental", defaultOptions.and("-Yno-experimental")),
5151
compileFilesInDir("tests/pos-custom-args/strict", defaultOptions.and("-source", "future", "-deprecation", "-Xfatal-warnings")),
5252
compileDir("tests/pos-special/java-param-names", defaultOptions.withJavacOnlyOptions("-parameters")),
53-
compileDir("tests/pos-special/stdlib", defaultOptions),
5453
compileFile(
5554
// succeeds despite -Xfatal-warnings because of -nowarn
5655
"tests/neg-custom-args/fatal-warnings/xfatalWarnings.scala",

tests/pos-macros/i9570.scala renamed to tests/neg-macros/i9570.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xfatal-warnings
2+
13
import scala.quoted.*
24

35
object Macros {

tests/pos-macros/macro-deprecation.scala renamed to tests/neg-macros/macro-deprecation.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xfatal-warnings -deprecation
2+
13
import scala.quoted.*
24

35
inline def f = ${ impl } // error

tests/pos-macros/macro-experimental.scala renamed to tests/neg-macros/macro-experimental.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Yno-experimental
2+
13
import scala.quoted.*
24
import scala.annotation.experimental
35

tests/pos-custom-args/i13405/Test.scala

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/pos-macros/i13405/Test.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// scalac: -Xfatal-warnings
2+
3+
@main def main: Unit = hh()

tests/pos-special/i7592/Test_2.scala renamed to tests/pos-macros/i7592/Test_2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Yretain-trees
2+
13
def return1 = 1
24

35
def testReturn1 = {

tests/pos-custom-args/semanticdb/inline-unapply/App_2.scala renamed to tests/pos-macros/semanticdb-inline-unapply/App_2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// scalac: -Xsemanticdb
12

23
object Test {
34
def main(args: Array[String]): Unit = {

tests/pos-custom-args/semanticdb/inline-unapply/Macro_1.scala renamed to tests/pos-macros/semanticdb-inline-unapply/Macro_1.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xsemanticdb
2+
13
import scala.quoted.*
24

35
object Succ:

tests/pos-custom-args/semanticdb/macro-pos/example_1.scala renamed to tests/pos-macros/semanticdb-macro-pos/example_1.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xsemanticdb
2+
13
import quoted.*
24

35
object CodeImpl {

tests/pos-custom-args/semanticdb/macro-pos/example_2.scala renamed to tests/pos-macros/semanticdb-macro-pos/example_2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xsemanticdb
2+
13
import quoted.*
24

35
object TestImpl {

tests/pos-custom-args/semanticdb/macro-pos/example_3.scala renamed to tests/pos-macros/semanticdb-macro-pos/example_3.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xsemanticdb
2+
13
object Test {
24

35
def test = TestImpl.fun("")

tests/pos-special/stdlib/Test1.scala

Lines changed: 0 additions & 34 deletions
This file was deleted.

tests/pos-special/stdlib/Test2.scala

Lines changed: 0 additions & 232 deletions
This file was deleted.

0 commit comments

Comments
 (0)