Skip to content

Commit

Permalink
Reorganize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Mar 25, 2021
1 parent 0e39cce commit 7ffbbc7
Show file tree
Hide file tree
Showing 47 changed files with 18 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ class BootstrappedOnlyCompilationTests {
compileFilesInDir("tests/plugins/neg").checkExpectedErrors()
compileDir("tests/plugins/custom/analyzer", withCompilerOptions.and("-Yretain-trees")).checkCompile()
}

// tests for experimental featuress ------------------------------------------

@Test def experimental: Unit =
implicit val testGroup: TestGroup = TestGroup("experimental")
compileFilesInDir("tests/neg-custom-args/no-experimental", defaultOptions.and("-Yno-experimental")).checkExpectedErrors()
if config.Properties.experimental then
compileFilesInDir("tests/run-custom-args/experimental", defaultOptions.without("-Yno-experimental")).checkRuns()
compileFilesInDir("tests/neg-custom-args/experimental", defaultOptions.without("-Yno-experimental")).checkExpectedErrors()
compileFilesInDir("tests/pos-custom-args/experimental", defaultOptions.without("-Yno-experimental")).checkCompile()
compileFilesInDir("tests/run-staging-experimental", withStagingOptions.without("-Yno-experimental")).checkRuns()

}

object BootstrappedOnlyCompilationTests extends ParallelTesting {
Expand Down
4 changes: 1 addition & 3 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ class CompilationTests {
compileFilesInDir("tests/neg-custom-args/allow-double-bindings", allowDoubleBindings),
compileFilesInDir("tests/neg-custom-args/allow-deep-subtypes", allowDeepSubtypes),
compileFilesInDir("tests/neg-custom-args/explicit-nulls", defaultOptions.and("-Yexplicit-nulls")),
compileFilesInDir("tests/neg-custom-args/no-experimental", defaultOptions.and("-Yno-experimental")),
compileDir("tests/neg-custom-args/impl-conv", defaultOptions.and("-Xfatal-warnings", "-feature")),
compileFile("tests/neg-custom-args/implicit-conversions.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
compileFile("tests/neg-custom-args/implicit-conversions-old.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
Expand Down Expand Up @@ -189,7 +188,7 @@ class CompilationTests {
compileFile("tests/run-custom-args/fors.scala", defaultOptions.and("-source", "future")),
compileFile("tests/run-custom-args/no-useless-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"),
compileFile("tests/run-custom-args/defaults-serizaliable-no-forwarders.scala", defaultOptions and "-Xmixin-force-forwarders:false"),
compileFilesInDir("tests/run-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions")),
compileFilesInDir("tests/run-custom-args/erased", defaultOptions.and("-language:experimental.erasedDefinitions").without("-Yno-experimental")),
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init"))
).checkRuns()
Expand Down Expand Up @@ -248,7 +247,6 @@ class CompilationTests {
val lib =
compileList("lib", librarySources,
defaultOptions.and("-Ycheck-reentrant",
"-language:experimental.erasedDefinitions", // support declaration of scala.compiletime.erasedValue
// "-source", "future", // TODO: re-enable once we allow : @unchecked in pattern definitions. Right now, lots of narrowing pattern definitions fail.
))(libGroup)

Expand Down
1 change: 1 addition & 0 deletions compiler/test/dotty/tools/vulpix/TestConfiguration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ object TestConfiguration {
val noCheckOptions = Array(
"-pagewidth", "120",
"-color:never",
"-Yno-experimental",
"-Xtarget", defaultTarget
)

Expand Down
4 changes: 4 additions & 0 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ object Build {

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

scalacOptions += "-Yno-experimental",

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

scalacOptions += "-Yno-experimental",

javaOptions ++= {
val managedSrcDir = {
// Populate the directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ object BigFloat extends App {
'{BigInt(${Expr(x.toString)})}
}
}

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ erased trait D

val x = new A{} // ok, x is erased
val y = new C with D{} // error


File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ object d:
import language.experimental.genericNumberLiterals // ok
import scala.language.noAutoTupling // ok
import _root_.scala.language.strictEquality // ok

File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions tests/neg-with-compiler/GenericNumLits/EvenFromDigitsImpl_1.scala

This file was deleted.

24 changes: 0 additions & 24 deletions tests/neg-with-compiler/GenericNumLits/Even_1.scala

This file was deleted.

6 changes: 0 additions & 6 deletions tests/neg-with-compiler/GenericNumLits/Test_2.scala

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import language.experimental.erasedDefinitions
erased class A

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ object BigFloat extends App {
'{BigInt(${Expr(x.toString)})}
}
}

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7ffbbc7

Please sign in to comment.