diff options
author | vsalvis <salvisbergvera@gmail.com> | 2015-05-11 13:45:49 +0200 |
---|---|---|
committer | vsalvis <salvisbergvera@gmail.com> | 2015-05-12 11:19:34 +0200 |
commit | 7e3595d1f7efa34ef3ea2409529643cd8864e926 (patch) | |
tree | d75e9a0204a4110d9e9649ced9dd8e45c06202c3 /project | |
parent | ca3fc43bb3f9eb0068669acf6e64b3c6bd310511 (diff) | |
download | dotty-7e3595d1f7efa34ef3ea2409529643cd8864e926.tar.gz dotty-7e3595d1f7efa34ef3ea2409529643cd8864e926.tar.bz2 dotty-7e3595d1f7efa34ef3ea2409529643cd8864e926.zip |
Better documentation for partest dottyJar option
Diffstat (limited to 'project')
-rw-r--r-- | project/Build.scala | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/project/Build.scala b/project/Build.scala index af8c51211..7d5d59ec5 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -64,20 +64,30 @@ object DottyBuild extends Build { // enable verbose exception messages for JUnit testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-a", "-v", "--run-listener=test.ContextEscapeDetector"), testOptions in Test += Tests.Cleanup({ () => if (partestLock != null) partestLock.release }), - // when this file is locked, running test generates the files for partest - // otherwise it just executes the tests directly + // When this file is locked, running test generates the files for partest. + // Otherwise it just executes the tests directly. So running two separate + // sbt instances might result in unexpected behavior if one does partest + // and the other test, since the second still sees the locked file and thus + // generates partest files instead of running JUnit tests, but doesn't + // partest them. lockPartestFile := { val partestLockFile = "." + File.separator + "tests" + File.separator + "partest.lock" try { partestLock = new RandomAccessFile(partestLockFile, "rw").getChannel.tryLock + if (partestLock == null) + throw new RuntimeException("ERROR: sbt partest: file is locked already. Bad things happen when trying to mix test/partest in two concurrent sbt instances.") } catch { - case ex: java.nio.channels.OverlappingFileLockException => // locked already + case ex: java.nio.channels.OverlappingFileLockException => // locked already, Tests.Cleanup didn't run + if (partestLock != null) + partestLock.release + throw new RuntimeException("ERROR: sbt partest: file was still locked, please try again or restart sbt.") } }, runPartestRunner <<= Def.taskDyn { val jars = Seq((packageBin in Compile).value.getAbsolutePath) ++ getJarPaths(partestDeps.value, ivyPaths.value.ivyHome) val dottyJars = "-dottyJars " + jars.length + " " + jars.mkString(" ") + // Provide the jars required on the classpath of run tests runTask(Test, "dotty.partest.DPConsoleRunner", dottyJars) }, |