diff --git a/mirai-core/src/commonTest/kotlin/test/initPlatform.common.kt b/mirai-core/src/commonTest/kotlin/test/initPlatform.common.kt index d17aa4374..130dcb9bc 100644 --- a/mirai-core/src/commonTest/kotlin/test/initPlatform.common.kt +++ b/mirai-core/src/commonTest/kotlin/test/initPlatform.common.kt @@ -9,6 +9,7 @@ package net.mamoe.mirai.internal.test +import net.mamoe.mirai.IMirai import org.junit.jupiter.api.Test import org.junit.jupiter.api.Timeout import java.util.concurrent.TimeUnit @@ -28,6 +29,13 @@ abstract class AbstractTest { System.setProperty("mirai.debug.network.show.components.creation.stacktrace", "true") } + + companion object { + init { + Exception() // create a exception to load relevant classes to estimate invocation time of test cases more accurately. + IMirai::class.simpleName // similarly, load classes. + } + } } internal expect class PlatformInitializationTest() : AbstractTest {