-
Notifications
You must be signed in to change notification settings - Fork 1k
/
TestConfiguration.scala
78 lines (68 loc) · 2.29 KB
/
TestConfiguration.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package dotty
package tools
package vulpix
import java.io.File
object TestConfiguration {
val noCheckOptions = Array(
"-pagewidth", "120",
"-color:never"
)
val checkOptions = Array(
// "-Yscala2-unpickler", s"${Properties.scalaLibrary}",
"-Yno-deep-subtypes",
"-Yno-double-bindings",
"-Yforce-sbt-phases",
"-Xverify-signatures"
)
val basicClasspath = mkClasspath(List(
Properties.scalaLibrary,
Properties.dottyLibrary
))
val withCompilerClasspath = mkClasspath(List(
Properties.scalaLibrary,
Properties.scalaAsm,
Properties.jlineTerminal,
Properties.jlineReader,
Properties.compilerInterface,
Properties.dottyInterfaces,
Properties.dottyLibrary,
Properties.dottyCompiler
))
val withStagingClasspath = mkClasspath(List(
Properties.scalaLibrary,
Properties.scalaAsm,
Properties.jlineTerminal,
Properties.jlineReader,
Properties.compilerInterface,
Properties.dottyInterfaces,
Properties.dottyLibrary,
Properties.dottyStaging,
Properties.dottyCompiler
))
def mkClasspath(classpaths: List[String]): String =
classpaths.map({ p =>
val file = new java.io.File(p)
assert(file.exists, s"File $p couldn't be found.")
file.getAbsolutePath
}).mkString(File.pathSeparator)
val yCheckOptions = Array("-Ycheck:all")
val commonOptions = checkOptions ++ noCheckOptions ++ yCheckOptions
val defaultOptions = TestFlags(basicClasspath, commonOptions)
val withCompilerOptions =
defaultOptions.withClasspath(withCompilerClasspath).withRunClasspath(withCompilerClasspath)
val withStagingOptions =
defaultOptions.withClasspath(withStagingClasspath).withRunClasspath(withStagingClasspath)
val allowDeepSubtypes = defaultOptions without "-Yno-deep-subtypes"
val allowDoubleBindings = defaultOptions without "-Yno-double-bindings"
val picklingOptions = defaultOptions and (
"-Xprint-types",
"-Ytest-pickler",
"-Yprint-pos",
"-Yprint-pos-syms"
)
val picklingWithCompilerOptions =
picklingOptions.withClasspath(withCompilerClasspath).withRunClasspath(withCompilerClasspath)
val scala2Mode = defaultOptions and "-language:Scala2"
val explicitUTF8 = defaultOptions and ("-encoding", "UTF8")
val explicitUTF16 = defaultOptions and ("-encoding", "UTF16")
}