Skip to content

Commit 1b19afa

Browse files
committed
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.
1 parent cc56d3d commit 1b19afa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

project/Build.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ object DottyBuild extends Build {
179179
) map { case (k, v) => (k, v.getAbsolutePath) }
180180
},
181181

182-
// Set run baseDir to be root of project, makes dotc saner
183-
baseDirectory in run := baseDirectory.value / "..",
182+
// For convenience, change the baseDirectory when running the compiler
183+
baseDirectory in (Compile, run) := baseDirectory.value / "..",
184+
// .. but not when running partest
185+
baseDirectory in (Test, run) := baseDirectory.value,
184186

185187
repl := Def.inputTaskDyn {
186188
val args: Seq[String] = spaceDelimited("<arg>").parsed

0 commit comments

Comments
 (0)