aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-04 23:13:41 +0200
committerFelix Mulder <felix.mulder@gmail.com>2017-04-12 11:21:58 +0200
commit2f1a542034ddbc6cccf321e068e5161d32839f07 (patch)
treea296f1a2cf96d1b716d62ff98d184e374fc16f2a /project
parenteff50df8308e3e1989dcbc509c5efbc5c0d087ac (diff)
downloaddotty-2f1a542034ddbc6cccf321e068e5161d32839f07.tar.gz
dotty-2f1a542034ddbc6cccf321e068e5161d32839f07.tar.bz2
dotty-2f1a542034ddbc6cccf321e068e5161d32839f07.zip
Remove partest, keeping `dotc.tests` for now
Diffstat (limited to 'project')
-rw-r--r--project/Build.scala92
1 files changed, 8 insertions, 84 deletions
diff --git a/project/Build.scala b/project/Build.scala
index bb02416cc..391799ef7 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -134,27 +134,7 @@ object Build {
settings(
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("run", "dotty-compiler/run")
).
settings(publishing)
@@ -287,43 +267,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),
@@ -389,6 +332,12 @@ object Build {
"--run-listener=dotty.tools.ContextEscapeDetector"
),
+ // Ignore old sequential unit tests when running `test` in sbt
+ testOptions in Test += Tests.Argument(
+ TestFrameworks.JUnit,
+ "--exclude-categories=dotc.SequentialUnitTests"
+ ),
+
/* Add the sources of scalajs-ir.
* To guarantee that dotty can bootstrap without depending on a version
* of scalajs-ir built with a different Scala compiler, we add its
@@ -471,35 +420,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`).