Skip to content

Commit c921574

Browse files
committed
Simplify macro tests with custom args
[Cherry-picked cc90bf3][modified]
1 parent 451838f commit c921574

Some content is hidden

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

51 files changed

+125
-24
lines changed

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

Lines changed: 5 additions & 19 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,15 +119,9 @@ 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")

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/neg/i9685bis.check

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- [E008] Not Found Error: tests/neg/i9685bis.scala:25:4 ---------------------------------------------------------------
2+
25 | 1.asdf // error
3+
| ^^^^^^
4+
| value asdf is not a member of Int, but could be made available as an extension method.
5+
|
6+
| The following import might make progress towards fixing the problem:
7+
|
8+
| import foo.Baz.toBaz
9+
|

tests/neg/i9685bis.scala

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// scalac: -source future
2+
3+
package foo
4+
5+
import scala.language.implicitConversions
6+
7+
class Foo
8+
9+
object Foo:
10+
11+
inline implicit def toFoo(x: Int): Foo = Foo()
12+
13+
class Bar
14+
15+
object Bar:
16+
inline given Conversion[Int, Bar] with
17+
def apply(x: Int): Bar = Bar()
18+
19+
class Baz
20+
21+
object Baz:
22+
transparent inline implicit def toBaz(x: Int): Baz = Baz()
23+
24+
object Usage:
25+
1.asdf // error

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

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

0 commit comments

Comments
 (0)