Skip to content

Commit 7bd94f7

Browse files
committed
Simplify macro tests with custom args
1 parent 512fbd5 commit 7bd94f7

Some content is hidden

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

49 files changed

+51
-21
lines changed

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

Lines changed: 3 additions & 16 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

@@ -110,9 +106,6 @@ class BootstrappedOnlyCompilationTests {
110106
aggregateTests(
111107
compileFilesInDir("tests/neg-macros", defaultOptions.and("-Xcheck-macros")),
112108
compileFilesInDir("tests/neg-inlines-strict", defaultOptions.and("-source", "future")),
113-
compileFile("tests/pos-macros/i9570.scala", defaultOptions.and("-Xfatal-warnings")),
114-
compileFile("tests/pos-macros/macro-deprecation.scala", defaultOptions.and("-Xfatal-warnings", "-deprecation")),
115-
compileFile("tests/pos-macros/macro-experimental.scala", defaultOptions.and("-Yno-experimental")),
116109
).checkExpectedErrors()
117110
}
118111

@@ -128,15 +121,9 @@ class BootstrappedOnlyCompilationTests {
128121

129122
@Test def runMacros: Unit = {
130123
implicit val testGroup: TestGroup = TestGroup("runMacros")
131-
aggregateTests(
132-
compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros")),
133-
compileFilesInDir("tests/run-custom-args/Yretain-trees", defaultOptions and "-Yretain-trees"),
134-
compileFilesInDir("tests/run-custom-args/Yread-comments", defaultOptions and "-Yread-docs"),
135-
compileFilesInDir("tests/run-custom-args/run-macros-erased", defaultOptions.and("-language:experimental.erasedDefinitions").and("-Xcheck-macros")),
136-
compileDir("tests/run-custom-args/Xmacro-settings/simple", defaultOptions.and("-Xmacro-settings:one,two,three")),
137-
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")),
138-
)
139-
}.checkRuns()
124+
compileFilesInDir("tests/run-macros", defaultOptions.and("-Xcheck-macros"))
125+
.checkRuns()
126+
}
140127

141128
@Test def runWithCompiler: Unit = {
142129
implicit val testGroup: TestGroup = TestGroup("runWithCompiler")

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/run-custom-args/Xmacro-settings/compileTimeEnv/Test.scala renamed to tests/run-macros/Xmacro-settings-compileTimeEnv/Test.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xmacro-settings:a,b=1,c.b.a=x.y.z=1,myLogger.level=INFO
2+
13
import scala.compiletime.*
24

35
object Test {
@@ -16,10 +18,10 @@ object Test {
1618
}
1719

1820
def runBasic(): Unit = {
19-
printEnv("a")
20-
printEnv("b")
21-
printEnv("c.b.a")
22-
printEnv("wat")
21+
printEnv("a")
22+
printEnv("b")
23+
printEnv("c.b.a")
24+
printEnv("wat")
2325
}
2426

2527
inline def printEnv(inline k: String): Unit =

tests/run-custom-args/Xmacro-settings/simple/Test.scala renamed to tests/run-macros/Xmacro-settings-simple/Test.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Xmacro-settings:one,two,three
2+
13
import x.*
24

35
object Test {

tests/run-custom-args/Yread-comments/i12351/Test_2.scala renamed to tests/run-macros/i12351/Test_2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Yread-docs
2+
13
@main def Test(): Unit = {
24
println(getDocString[Data])
35
assert(getDocString[Data].nonEmpty)

tests/run-custom-args/Yread-comments/i12352/Main.scala renamed to tests/run-macros/i12352/Main.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// scalac: -Yread-docs
2+
13
@main def Test(): Unit = {
24
val res = getDocString[scala.quoted.Quotes]
35
println(res)

tests/run-custom-args/run-macros-erased/i17105/Macro_1.scala renamed to tests/run-macros/i17105b/Macro_1.scala

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

35
inline def testExpr(inline body: Any) = ${ testExprImpl('body) }

tests/run-custom-args/run-macros-erased/i17105/Test_2.scala renamed to tests/run-macros/i17105b/Test_2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import scala.language.experimental.erasedDefinitions
2+
13
@main def Test: Unit =
24
println("case erased: " + testExpr { def erasedfn1(erased x: String) = "placeholder"; erasedfn1("arg1")})
35
println("case erased nested: " + testExpr {

tests/run-custom-args/run-macros-erased/macro-erased/1.scala renamed to tests/run-macros/macro-erased/Macro_1.scala

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

35
object Macro {

tests/run-custom-args/run-macros-erased/reflect-isFunctionType/test_2.scala renamed to tests/run-macros/reflect-isFunctionType/test_2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import scala.language.experimental.erasedDefinitions
2+
13
trait Box {
24
type T
35
}

tests/run-macros/tasty-definitions-1/quoted_2.scala

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

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

tests/run-custom-args/Yretain-trees/tasty-definitions-2/Test_2.scala renamed to tests/run-macros/tasty-definitions-2/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
object Test {
24
def main(args: Array[String]): Unit = {
35
println(Foo.inspectBody(Foo.foo))

tests/run-custom-args/Yretain-trees/tasty-definitions-3/Test_2.scala renamed to tests/run-macros/tasty-definitions-3/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
object Test {
24

35
def main(args: Array[String]): Unit = {

tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_2.scala renamed to tests/run-macros/tasty-extractors-owners/quoted_2.scala

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

23
import Macros.*
34

tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_2.scala renamed to tests/run-macros/tasty-load-tree-1/quoted_2.scala

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

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

tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_2.scala renamed to tests/run-macros/tasty-load-tree-2/quoted_2.scala

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

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

0 commit comments

Comments
 (0)