aboutsummaryrefslogtreecommitdiff
path: root/project/Build.scala
diff options
context:
space:
mode:
Diffstat (limited to 'project/Build.scala')
-rw-r--r--project/Build.scala105
1 files changed, 15 insertions, 90 deletions
diff --git a/project/Build.scala b/project/Build.scala
index bb02416cc..8b1c0e31e 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -47,8 +47,8 @@ object Build {
// Spawns a repl with the correct classpath
lazy val repl = inputKey[Unit]("run the REPL with correct classpath")
- // Run tests with filter
- lazy val filterTest = inputKey[Unit]("runs integration test with the supplied filter")
+ // Run tests with filter through vulpix test suite
+ lazy val vulpix = inputKey[Unit]("runs integration test with the supplied filter")
// Used to compile files similar to ./bin/dotc script
lazy val dotc =
@@ -135,26 +135,7 @@ object Build {
triggeredMessage in ThisBuild := Watched.clearWhenTriggered,
addCommandAlias("run", "dotty-compiler/run") ++
- addCommandAlias(
- "partest",
- ";publishLocal" + // Non-bootstrapped dotty needs to be published first
- ";dotty-compiler-bootstrapped/lockPartestFile" +
- ";dotty-compiler-bootstrapped/test:test" +
- ";dotty-compiler-bootstrapped/runPartestRunner"
- ) ++
- addCommandAlias(
- "partest-only",
- ";publishLocal" + // Non-bootstrapped dotty needs to be published first
- ";dotty-compiler-bootstrapped/lockPartestFile" +
- ";dotty-compiler-bootstrapped/test:test-only dotc.tests" +
- ";dotty-compiler-bootstrapped/runPartestRunner"
- ) ++
- addCommandAlias(
- "partest-only-no-bootstrap",
- ";dotty-compiler/lockPartestFile" +
- ";dotty-compiler/test:test-only dotc.tests" +
- ";dotty-compiler/runPartestRunner"
- )
+ addCommandAlias("legacyTests", "dotty-compiler/testOnly dotc.tests")
).
settings(publishing)
@@ -287,43 +268,6 @@ object Build {
"org.scala-lang" % "scala-reflect" % scalacVersion,
"org.scala-lang" % "scala-library" % scalacVersion % "test"),
- // start partest specific settings:
- libraryDependencies += "org.scala-lang.modules" %% "scala-partest" % "1.0.11" % "test",
- testOptions in Test += Tests.Cleanup({ () => partestLockFile.delete }),
- // this option is needed so that partest doesn't run
- partestDeps := Seq(
- scalaCompiler,
- "org.scala-lang" % "scala-reflect" % scalacVersion,
- "org.scala-lang" % "scala-library" % scalacVersion % "test"
- ),
- lockPartestFile := {
- // When this file is present, running `test` generates the files for
- // partest. Otherwise it just executes the tests directly.
- val lockDir = partestLockFile.getParentFile
- lockDir.mkdirs
- // Cannot have concurrent partests as they write to the same directory.
- if (lockDir.list.size > 0)
- throw new RuntimeException("ERROR: sbt partest: another partest is already running, pid in lock file: " + lockDir.list.toList.mkString(" "))
- partestLockFile.createNewFile
- partestLockFile.deleteOnExit
- },
- runPartestRunner := Def.inputTaskDyn {
- // Magic! This is both an input task and a dynamic task. Apparently
- // command line arguments get passed to the last task in an aliased
- // sequence (see partest alias below), so this works.
- val args = Def.spaceDelimited("<arg>").parsed
- val jars = List(
- (packageBin in Compile).value.getAbsolutePath,
- packageAll.value("dotty-library"),
- packageAll.value("dotty-interfaces")
- ) ++ getJarPaths(partestDeps.value, ivyPaths.value.ivyHome)
- val dottyJars =
- s"""-dottyJars ${jars.length + 2} dotty.jar dotty-lib.jar ${jars.mkString(" ")}"""
- // Provide the jars required on the classpath of run tests
- runTask(Test, "dotty.partest.DPConsoleRunner", dottyJars + " " + args.mkString(" "))
- }.evaluated,
- // end partest specific settings
-
// enable improved incremental compilation algorithm
incOptions := incOptions.value.withNameHashing(true),
@@ -340,12 +284,18 @@ object Build {
)
}.evaluated,
- filterTest := Def.inputTaskDyn {
+ test in Test := {
+ // Exclude legacy tests by default
+ (testOnly in Test).toTask(" -- --exclude-categories=java.lang.Exception").value
+ },
+
+ vulpix := Def.inputTaskDyn {
val args: Seq[String] = spaceDelimited("<arg>").parsed
- testOptions := Seq()
- (testOnly in Test).toTask(
- " dotty.tools.dotc.CompilationTests -- -Ddotty.partest.filter=" + args.head
- )
+ val cmd = " dotty.tools.dotc.CompilationTests" + {
+ if (args.nonEmpty) " -- -Ddotty.tests.filter=" + args.mkString(" ")
+ else ""
+ }
+ (testOnly in Test).toTask(cmd)
}.evaluated,
// Override run to be able to run compiled classfiles
@@ -471,35 +421,10 @@ object Build {
"-Ddotty.tests.classes.compiler=" + pA("dotty-compiler")
)
- ("-DpartestParentID=" + pid) :: jars ::: tuning ::: agentOptions ::: ci_build ::: path.toList
+ jars ::: tuning ::: agentOptions ::: ci_build ::: path.toList
}
)
- // Partest tasks
- lazy val partestDeps =
- SettingKey[Seq[ModuleID]]("partestDeps", "Finds jars for partest dependencies")
- lazy val runPartestRunner =
- InputKey[Unit]("runPartestRunner", "Runs partest")
- lazy val lockPartestFile =
- TaskKey[Unit]("lockPartestFile", "Creates the lock file at ./tests/locks/partest-<pid>.lock")
- lazy val partestLockFile =
- new File("." + File.separator + "tests" + File.separator + "locks" + File.separator + s"partest-$pid.lock")
-
- def pid = java.lang.Long.parseLong(java.lang.management.ManagementFactory.getRuntimeMXBean().getName().split("@")(0))
-
- def getJarPaths(modules: Seq[ModuleID], ivyHome: Option[File]): Seq[String] = ivyHome match {
- case Some(home) =>
- modules.map({ module =>
- val file = Path(home) / Path("cache") /
- Path(module.organization) / Path(module.name) / Path("jars") /
- Path(module.name + "-" + module.revision + ".jar")
- if (!file.isFile) throw new RuntimeException("ERROR: sbt getJarPaths: dependency jar not found: " + file)
- else file.jfile.getAbsolutePath
- })
- case None => throw new RuntimeException("ERROR: sbt getJarPaths: ivyHome not defined")
- }
- // end partest tasks
-
lazy val `dotty-compiler` = project.in(file("compiler")).
dependsOn(`dotty-interfaces`).
dependsOn(`dotty-library`).