File tree Expand file tree Collapse file tree 3 files changed +25
-23
lines changed Expand file tree Collapse file tree 3 files changed +25
-23
lines changed Original file line number Diff line number Diff line change 1
1
2
- import scala .tools . partest . StoreReporterDirectTest
2
+ import scala .reflect . io . AbstractFile
3
3
import scala .tools .nsc ._
4
+ import scala .tools .partest .StoreReporterDirectTest
4
5
import scala .util .chaining ._
5
6
6
7
object Test extends StoreReporterDirectTest {
@@ -15,13 +16,14 @@ object Test extends StoreReporterDirectTest {
15
16
def code = rounds(round).tap(_ => round += 1 )
16
17
// intercept the settings created for compile()
17
18
override def newSettings (args : List [String ]) = {
18
- val outDir = testOutput.parent / testOutput / s " test-output- $round"
19
- def prevOutDir = testOutput.parent / testOutput / s " test-output- ${round - 1 }"
20
- outDir.createDirectory()
19
+ val outDir = testOutput / s " test-output- $round"
20
+ def prevOutDir = testOutput / s " test-output- ${round - 1 }"
21
+ outDir.createDirectory(force = true )
22
+ val af = AbstractFile .getDirectory(outDir)
21
23
// put the previous round on the class path
22
- val args1 = " -d " :: outDir .path :: args
23
- val args2 = if (round > 0 ) " -cp " :: prevOutDir.path :: args1 else args1
24
- super .newSettings(args2 )
24
+ val args1 = if (round > 0 ) " -cp " :: prevOutDir .path :: args else args
25
+ super .newSettings( args1)
26
+ .tap(_.outputDirs.setSingleOutput(af) )
25
27
}
26
28
// avoid setting -d
27
29
override def newCompiler (args : String * ): Global = {
Original file line number Diff line number Diff line change 1
1
2
- import scala .tools . partest . StoreReporterDirectTest
2
+ import scala .reflect . io . AbstractFile
3
3
import scala .tools .nsc ._
4
+ import scala .tools .partest .StoreReporterDirectTest
4
5
import scala .util .chaining ._
5
6
6
7
object Test extends StoreReporterDirectTest {
@@ -17,13 +18,14 @@ object Test extends StoreReporterDirectTest {
17
18
def code = rounds(round).tap(_ => round += 1 )
18
19
// intercept the settings created for compile()
19
20
override def newSettings (args : List [String ]) = {
20
- val outDir = testOutput.parent / testOutput / s " test-output- $round"
21
- def prevOutDir = testOutput.parent / testOutput / s " test-output- ${round - 1 }"
22
- outDir.createDirectory()
21
+ val outDir = testOutput / s " test-output- $round"
22
+ def prevOutDir = testOutput / s " test-output- ${round - 1 }"
23
+ outDir.createDirectory(force = true )
24
+ val af = AbstractFile .getDirectory(outDir)
23
25
// put the previous round on the class path
24
- val args1 = " -d " :: outDir .path :: args
25
- val args2 = if (round > 0 ) " -cp " :: prevOutDir.path :: args1 else args1
26
- super .newSettings(args2 )
26
+ val args1 = if (round > 0 ) " -cp " :: prevOutDir .path :: args else args
27
+ super .newSettings( args1)
28
+ .tap(_.outputDirs.setSingleOutput(af) )
27
29
}
28
30
// avoid setting -d
29
31
override def newCompiler (args : String * ): Global = {
Original file line number Diff line number Diff line change 1
1
2
- import scala .tools .partest .StoreReporterDirectTest
3
2
import scala .tools .nsc ._
3
+ import scala .tools .partest .StoreReporterDirectTest
4
4
import scala .util .chaining ._
5
5
6
6
object Test extends StoreReporterDirectTest {
@@ -16,15 +16,13 @@ object Test extends StoreReporterDirectTest {
16
16
else code1.tap(_ => round += 1 )
17
17
// intercept the settings created for compile()
18
18
override def newSettings (args : List [String ]) = {
19
- val outDir = testOutput.parent / testOutput / s " test-output- $round"
20
- def prevOutDir = testOutput.parent / testOutput / s " test-output- ${round - 1 }"
21
- outDir.createDirectory()
19
+ val outDir = testOutput / s " test-output- $round"
20
+ def prevOutDir = testOutput / s " test-output- ${round - 1 }"
21
+ outDir.createDirectory(force = true )
22
22
// put the previous round on the class path
23
- val ss =
24
- if (round > 0 ) super .newSettings(" -cp" :: prevOutDir.path :: args)
25
- else super .newSettings(args)
26
- ss.outputDirs.add(srcDir = testPath.parent.path, outDir = outDir.path)
27
- ss
23
+ val args1 = if (round > 0 ) " -cp" :: prevOutDir.path :: args else args
24
+ super .newSettings(args1)
25
+ .tap(_.outputDirs.add(srcDir = testPath.parent.path, outDir = outDir.path))
28
26
}
29
27
// avoid setting -d
30
28
override def newCompiler (args : String * ): Global = {
You can’t perform that action at this time.
0 commit comments