Skip to content

Commit 7ffbbc7

Browse files
committed
Reorganize tests
1 parent 0e39cce commit 7ffbbc7

Some content is hidden

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

47 files changed

+18
-58
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ class BootstrappedOnlyCompilationTests {
199199
compileFilesInDir("tests/plugins/neg").checkExpectedErrors()
200200
compileDir("tests/plugins/custom/analyzer", withCompilerOptions.and("-Yretain-trees")).checkCompile()
201201
}
202+
203+
// tests for experimental featuress ------------------------------------------
204+
205+
@Test def experimental: Unit =
206+
implicit val testGroup: TestGroup = TestGroup("experimental")
207+
compileFilesInDir("tests/neg-custom-args/no-experimental", defaultOptions.and("-Yno-experimental")).checkExpectedErrors()
208+
if config.Properties.experimental then
209+
compileFilesInDir("tests/run-custom-args/experimental", defaultOptions.without("-Yno-experimental")).checkRuns()
210+
compileFilesInDir("tests/neg-custom-args/experimental", defaultOptions.without("-Yno-experimental")).checkExpectedErrors()
211+
compileFilesInDir("tests/pos-custom-args/experimental", defaultOptions.without("-Yno-experimental")).checkCompile()
212+
compileFilesInDir("tests/run-staging-experimental", withStagingOptions.without("-Yno-experimental")).checkRuns()
213+
202214
}
203215

204216
object BootstrappedOnlyCompilationTests extends ParallelTesting {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ class CompilationTests {
129129
compileFilesInDir("tests/neg-custom-args/allow-double-bindings", allowDoubleBindings),
130130
compileFilesInDir("tests/neg-custom-args/allow-deep-subtypes", allowDeepSubtypes),
131131
compileFilesInDir("tests/neg-custom-args/explicit-nulls", defaultOptions.and("-Yexplicit-nulls")),
132-
compileFilesInDir("tests/neg-custom-args/no-experimental", defaultOptions.and("-Yno-experimental")),
133132
compileDir("tests/neg-custom-args/impl-conv", defaultOptions.and("-Xfatal-warnings", "-feature")),
134133
compileFile("tests/neg-custom-args/implicit-conversions.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
135134
compileFile("tests/neg-custom-args/implicit-conversions-old.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
@@ -189,7 +188,7 @@ class CompilationTests {
189188
compileFile("tests/run-custom-args/fors.scala", defaultOptions.and("-source", "future")),
190189
compileFile("tests/run-custom-args/no-useless-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"),
191190
compileFile("tests/run-custom-args/defaults-serizaliable-no-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"),
192-
compileFilesInDir("tests/run-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions")),
191+
compileFilesInDir("tests/run-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions").without("-Yno-experimental")),
193192
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
194193
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init"))
195194
).checkRuns()
@@ -248,7 +247,6 @@ class CompilationTests {
248247
val lib =
249248
compileList("lib", librarySources,
250249
defaultOptions.and("-Ycheck-reentrant",
251-
"-language:experimental.erasedDefinitions", // support declaration of scala.compiletime.erasedValue
252250
// "-source", "future", // TODO: re-enable once we allow : @unchecked in pattern definitions. Right now, lots of narrowing pattern definitions fail.
253251
))(libGroup)
254252

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ object TestConfiguration {
99
val noCheckOptions = Array(
1010
"-pagewidth", "120",
1111
"-color:never",
12+
"-Yno-experimental",
1213
"-Xtarget", defaultTarget
1314
)
1415

project/Build.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ object Build {
246246

247247
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
248248

249+
scalacOptions += "-Yno-experimental",
250+
249251
// If someone puts a source file at the root (e.g., for manual testing),
250252
// don't pick it up as part of any project.
251253
sourcesInBase := false,
@@ -445,6 +447,8 @@ object Build {
445447
// Add git-hash used to package the distribution to the manifest to know it in runtime and report it in REPL
446448
packageOptions += ManifestAttributes(("Git-Hash", VersionUtil.gitHash)),
447449

450+
scalacOptions += "-Yno-experimental",
451+
448452
javaOptions ++= {
449453
val managedSrcDir = {
450454
// Populate the directory

tests/neg-macros/BigFloat/BigFloat_1.scala renamed to tests/neg-custom-args/experimental/BigFloat/BigFloat_1.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ object BigFloat extends App {
4848
'{BigInt(${Expr(x.toString)})}
4949
}
5050
}
51-

tests/neg/erased-inheritance.scala renamed to tests/neg-custom-args/experimental/erased-inheritance.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ erased trait D
88

99
val x = new A{} // ok, x is erased
1010
val y = new C with D{} // error
11-
12-

tests/neg/language-import.scala renamed to tests/neg-custom-args/experimental/language-import.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ object d:
2020
import language.experimental.genericNumberLiterals // ok
2121
import scala.language.noAutoTupling // ok
2222
import _root_.scala.language.strictEquality // ok
23-

tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala

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

tests/neg-with-compiler/GenericNumLits/Even_1.scala

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

tests/neg-with-compiler/GenericNumLits/Test_2.scala

Lines changed: 0 additions & 6 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
import language.experimental.erasedDefinitions
22
erased class A
3-

tests/run-macros/BigFloat/BigFloat_1.scala renamed to tests/run-custom-args/experimental/BigFloat/BigFloat_1.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,3 @@ object BigFloat extends App {
4848
'{BigInt(${Expr(x.toString)})}
4949
}
5050
}
51-
File renamed without changes.

0 commit comments

Comments
 (0)