diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-10-28 22:17:28 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-11-22 01:35:06 +0100 |
commit | aa700b65916c16ec9dce6d9d8bafd2bd426d8c83 (patch) | |
tree | 6b240f16508e123ad0d84582ecc959e5d83acfbc /project/Build.scala | |
parent | 06a3d47ea9fd1b67b3acba9d115a16d18549e377 (diff) | |
download | dotty-aa700b65916c16ec9dce6d9d8bafd2bd426d8c83.tar.gz dotty-aa700b65916c16ec9dce6d9d8bafd2bd426d8c83.tar.bz2 dotty-aa700b65916c16ec9dce6d9d8bafd2bd426d8c83.zip |
Fix JUnit tests by always packaging everything
Running `packageAll` is now required before running the tests, this
commit enforces this, by making `javaOptions` depend on `packageAll`,
this requires rewriting `packageAll` to be a task instead of a command alias.
Diffstat (limited to 'project/Build.scala')
-rw-r--r-- | project/Build.scala | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/project/Build.scala b/project/Build.scala index 6341f08c4..6e2844897 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -26,6 +26,8 @@ object DottyBuild extends Build { // "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1g", "-Xss2m" ) + lazy val packageAll = taskKey[Unit]("Package everything needed to run tests") + override def settings: Seq[Setting[_]] = { super.settings ++ Seq( scalaVersion in Global := "2.11.5", @@ -115,6 +117,14 @@ object DottyBuild extends Build { // enable improved incremental compilation algorithm incOptions := incOptions.value.withNameHashing(true), + + packageAll := { + val p1 = (packageBin in (`dotty-interfaces`, Compile)).value + val p2 = (packageBin in Compile).value + val p3 = (packageBin in (`dotty-library`, Compile)).value + val p4 = (packageBin in Test).value + }, + // enable verbose exception messages for JUnit testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-a", "-v", "--run-listener=test.ContextEscapeDetector"), testOptions in Test += Tests.Cleanup({ () => partestLockFile.delete }), @@ -189,7 +199,8 @@ object DottyBuild extends Build { packageOptions += ManifestAttributes(("Git-Hash", VersionUtil.gitHash)), // http://grokbase.com/t/gg/simple-build-tool/135ke5y90p/sbt-setting-jvm-boot-paramaters-for-scala - javaOptions <++= (dependencyClasspath in Runtime, packageBin in Compile) map { (attList, bin) => + // packageAll should always be run before tests + javaOptions <++= (dependencyClasspath in Runtime, packageAll) map { (attList, _) => // put needed dependencies on classpath: val path = for { file <- attList.map(_.data) @@ -222,13 +233,6 @@ object DottyBuild extends Build { ). settings( addCommandAlias( - "packageAll", - ";dotty-interfaces/package" + - ";dotty-compiler/package" + - ";dotty-library/package" + - ";dotty-compiler/test:package" - ) ++ - addCommandAlias( "partest", ";packageAll" + ";test:runMain dotc.build" + |