[Wasm] Add box and stdlib tests in wasi mode
This commit is contained in:
committed by
Zalim Bashorov
parent
f42d0b1ed4
commit
983991d46c
@@ -6,6 +6,8 @@ import org.gradle.api.Project
|
||||
import org.gradle.api.tasks.testing.Test
|
||||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8RootExtension
|
||||
import org.jetbrains.kotlin.gradle.targets.js.d8.D8RootPlugin
|
||||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
|
||||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
|
||||
|
||||
private object V8Utils {
|
||||
lateinit var d8Plugin: D8RootExtension
|
||||
@@ -30,3 +32,27 @@ fun Test.setupV8() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private object NodeJsUtils {
|
||||
lateinit var nodeJsPlugin: NodeJsRootExtension
|
||||
|
||||
fun useNodeJsPlugin(project: Project) {
|
||||
nodeJsPlugin = NodeJsRootPlugin.apply(project.rootProject)
|
||||
nodeJsPlugin.nodeVersion = project.nodejsVersion
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.useNodeJsPlugin() {
|
||||
NodeJsUtils.useNodeJsPlugin(this)
|
||||
}
|
||||
|
||||
fun Test.setupNodeJs() {
|
||||
dependsOn(NodeJsUtils.nodeJsPlugin.nodeJsSetupTaskProvider)
|
||||
val nodeJsExecutablePath = project.provider {
|
||||
NodeJsUtils.nodeJsPlugin.requireConfigured().nodeExecutable
|
||||
}
|
||||
doFirst {
|
||||
systemProperty("javascript.engine.path.NodeJs", nodeJsExecutablePath.get())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user