@@ -5,19 +5,23 @@ import java.io.{File => JFile}
5
5
final case class TestFlags (
6
6
defaultClassPath : String ,
7
7
runClassPath : String , // class path that is used when running `run` tests (not compiling)
8
- options : Array [String ]) {
8
+ options : Array [String ],
9
+ javacOptions : Array [String ]) {
9
10
10
11
def and (flags : String * ): TestFlags =
11
- TestFlags (defaultClassPath, runClassPath, options ++ flags)
12
+ TestFlags (defaultClassPath, runClassPath, options ++ flags, javacOptions )
12
13
13
14
def without (flags : String * ): TestFlags =
14
- TestFlags (defaultClassPath, runClassPath, options diff flags)
15
+ TestFlags (defaultClassPath, runClassPath, options diff flags, javacOptions )
15
16
16
17
def withClasspath (classPath : String ): TestFlags =
17
- TestFlags (s " $defaultClassPath${JFile .pathSeparator}$classPath" , runClassPath, options)
18
+ TestFlags (s " $defaultClassPath${JFile .pathSeparator}$classPath" , runClassPath, options, javacOptions )
18
19
19
20
def withRunClasspath (classPath : String ): TestFlags =
20
- TestFlags (defaultClassPath, s " $runClassPath${JFile .pathSeparator}$classPath" , options)
21
+ TestFlags (defaultClassPath, s " $runClassPath${JFile .pathSeparator}$classPath" , options, javacOptions)
22
+
23
+ def withJavacOnlyOptions (flags : String * ): TestFlags =
24
+ TestFlags (defaultClassPath, runClassPath, options, javacOptions ++ flags)
21
25
22
26
def all : Array [String ] = Array (" -classpath" , defaultClassPath) ++ options
23
27
@@ -43,10 +47,10 @@ final case class TestFlags(
43
47
val flags = all
44
48
val cp = flags.dropWhile(_ != " -classpath" ).take(2 )
45
49
val output = flags.dropWhile(_ != " -d" ).take(2 )
46
- cp ++ output
50
+ cp ++ output ++ javacOptions
47
51
}
48
52
}
49
53
50
54
object TestFlags {
51
- def apply (classPath : String , flags : Array [String ]): TestFlags = TestFlags (classPath, classPath, flags)
55
+ def apply (classPath : String , flags : Array [String ]): TestFlags = TestFlags (classPath, classPath, flags, Array .empty )
52
56
}
0 commit comments