From 1b19afa6184a0237a803f13e8491bfcb51b7585e Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 14 Nov 2016 20:04:24 +0100 Subject: Run dotty tests with the correct baseDirectory Before this commit, Build.scala contained: baseDirectory in run := baseDirectory.value / "..", The goal of this line is that when invoking the compiler using `run` or `dotc`, the working directory is the root of the dotty project, which is convenient for testing. However, this line also affects the working directory of `dotty-compiler/runPartestRunner`, but not of `dotty-compiler/test`. The result was that `dotty-compiler/test` was broken, and fixing the paths in the code would break `partest`. We solve this by using a different baseDirectory when running partest. --- project/Build.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'project/Build.scala') diff --git a/project/Build.scala b/project/Build.scala index 0f8594556..c241f77bd 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -179,8 +179,10 @@ object DottyBuild extends Build { ) map { case (k, v) => (k, v.getAbsolutePath) } }, - // Set run baseDir to be root of project, makes dotc saner - baseDirectory in run := baseDirectory.value / "..", + // For convenience, change the baseDirectory when running the compiler + baseDirectory in (Compile, run) := baseDirectory.value / "..", + // .. but not when running partest + baseDirectory in (Test, run) := baseDirectory.value, repl := Def.inputTaskDyn { val args: Seq[String] = spaceDelimited("").parsed -- cgit v1.2.3