Tests: compute runtime classpath for JVM box tests manually

Taking just the `jvmClasspathRoots` is not correct because it also
contains stuff needed for resolve to work correctly, such as JDK (full
or mock), stdlib (full or mock), reflect. JDK is obviously not needed in
the classpath, and stdlib/reflect are available via the parent class
loader, which is specifically reused across all tests to make them run
faster.

Also, don't try to create class loader for Java-only modules in
`JvmBoxRunner.processModule`. This happens, for example, for all tests
which were moved from `boxAgainstJava`.
This commit is contained in:
Alexander Udalov
2021-02-05 19:02:23 +01:00
parent df42868874
commit aaecb87d1b
2 changed files with 34 additions and 10 deletions
@@ -23,6 +23,11 @@ data class TestModule(
val directives: RegisteredDirectives,
val languageVersionSettings: LanguageVersionSettings
) {
override fun equals(other: Any?): Boolean =
other is TestModule && name == other.name
override fun hashCode(): Int = name.hashCode()
override fun toString(): String {
return buildString {
appendLine("Module: $name")