forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestSuiteLinkerOptions.scala
39 lines (33 loc) · 1.43 KB
/
TestSuiteLinkerOptions.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
package build
// This file is an exact copy of the file of the same name in scala-js/scala-js
import org.scalajs.linker.interface._
object TestSuiteLinkerOptions {
def semantics(s: Semantics): Semantics = {
import Semantics.RuntimeClassNameMapper
s.withRuntimeClassNameMapper(
RuntimeClassNameMapper.keepAll().andThen(
RuntimeClassNameMapper.regexReplace(
raw"""^org\.scalajs\.testsuite\.compiler\.ReflectionTest\$$RenamedTestClass$$""".r,
"renamed.test.Class")
).andThen(
RuntimeClassNameMapper.regexReplace(
raw"""^org\.scalajs\.testsuite\.compiler\.ReflectionTest\$$Prefix""".r,
"renamed.test.byprefix.")
).andThen(
RuntimeClassNameMapper.regexReplace(
raw"""^org\.scalajs\.testsuite\.compiler\.ReflectionTest\$$OtherPrefix""".r,
"renamed.test.byotherprefix.")
)
)
}
def moduleInitializers: List[ModuleInitializer] = {
val module = "org.scalajs.testsuite.compiler.ModuleInitializers"
List(
ModuleInitializer.mainMethod(module, "mainNoArgs"),
ModuleInitializer.mainMethodWithArgs(module, "mainWithArgs"),
ModuleInitializer.mainMethodWithArgs(module, "mainWithArgs", List("foo", "bar")),
ModuleInitializer.mainMethod(module + "$NoLinkedClass", "main"),
ModuleInitializer.mainMethod(module + "$WithLinkedClass", "main")
)
}
}