[K/Wasm] Generate .d.ts tests for K/Wasm in the same way as we do for K/JS ^KT-65778 Fixed
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import java.net.URI
|
||||
import com.github.gradle.node.npm.task.NpmTask
|
||||
import java.util.*
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
alias(libs.plugins.gradle.node)
|
||||
}
|
||||
|
||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
||||
|
||||
node {
|
||||
download.set(true)
|
||||
version.set(nodejsVersion)
|
||||
nodeProjectDir.set(layout.buildDirectory.dir("node"))
|
||||
if (cacheRedirectorEnabled) {
|
||||
distBaseUrl.set("https://cache-redirector.jetbrains.com/nodejs.org/dist")
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -116,6 +129,42 @@ fun Test.setupGradlePropertiesForwarding() {
|
||||
}
|
||||
}
|
||||
|
||||
val testDataDir = project(":js:js.translator").projectDir.resolve("testData")
|
||||
val typescriptTestsDir = testDataDir.resolve("typescript-export")
|
||||
val wasmTestDir = typescriptTestsDir.resolve("wasm")
|
||||
|
||||
fun generateTypeScriptTestFor(dir: String): TaskProvider<NpmTask> = tasks.register<NpmTask>("generate-ts-for-$dir") {
|
||||
val baseDir = wasmTestDir.resolve(dir)
|
||||
val mainTsFile = fileTree(baseDir).files.find { it.name.endsWith("__main.ts") } ?: return@register
|
||||
val mainJsFile = baseDir.resolve("${mainTsFile.nameWithoutExtension}.js")
|
||||
|
||||
workingDir.set(testDataDir)
|
||||
|
||||
inputs.file(mainTsFile)
|
||||
outputs.file(mainJsFile)
|
||||
outputs.upToDateWhen { mainJsFile.exists() }
|
||||
|
||||
args.set(listOf("run", "generateTypeScriptTests", "--", "./typescript-export/wasm/$dir/tsconfig.json"))
|
||||
}
|
||||
|
||||
val installTsDependencies by task<NpmTask> {
|
||||
val packageLockFile = testDataDir.resolve("package-lock.json")
|
||||
val nodeModules = testDataDir.resolve("node_modules")
|
||||
inputs.file(testDataDir.resolve("package.json"))
|
||||
outputs.file(packageLockFile)
|
||||
outputs.upToDateWhen { nodeModules.exists() }
|
||||
|
||||
workingDir.set(testDataDir)
|
||||
args.set(listOf("install"))
|
||||
}
|
||||
|
||||
val generateTypeScriptTests by parallel(
|
||||
beforeAll = installTsDependencies,
|
||||
tasksToRun = wasmTestDir
|
||||
.listFiles { it: File -> it.isDirectory }
|
||||
.map { generateTypeScriptTestFor(it.name) }
|
||||
)
|
||||
|
||||
val unzipJsShell by task<Copy> {
|
||||
dependsOn(jsShell)
|
||||
from {
|
||||
@@ -163,10 +212,12 @@ fun Project.wasmProjectTest(
|
||||
wasmProjectTest("test")
|
||||
|
||||
wasmProjectTest("testFir") {
|
||||
dependsOn(generateTypeScriptTests)
|
||||
include("**/Fir*.class")
|
||||
}
|
||||
|
||||
wasmProjectTest("testK1") {
|
||||
dependsOn(generateTypeScriptTests)
|
||||
include("**/K1*.class")
|
||||
}
|
||||
|
||||
|
||||
@@ -113,5 +113,15 @@ fun main(args: Array<String>) {
|
||||
model("debug/stepping")
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("wasm/wasm.tests/tests-gen", "js/js.translator/testData", testRunnerMethodName = "runTest0") {
|
||||
testClass<AbstractFirWasmTypeScriptExportTest> {
|
||||
model("typescript-export/wasm/")
|
||||
}
|
||||
|
||||
testClass<AbstractK1WasmTypeScriptExportTest> {
|
||||
model("typescript-export/wasm/")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade
|
||||
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact
|
||||
import org.jetbrains.kotlin.test.model.*
|
||||
import org.jetbrains.kotlin.test.services.EnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.test.services.configuration.JsEnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.test.services.configuration.WasmEnvironmentConfiguratorJs
|
||||
import org.jetbrains.kotlin.wasm.test.converters.FirWasmKlibBackendFacade
|
||||
import org.jetbrains.kotlin.wasm.test.converters.WasmBackendFacade
|
||||
@@ -81,4 +82,28 @@ open class AbstractK1WasmSteppingTest : AbstractK1WasmTest(
|
||||
+WasmEnvironmentConfigurationDirectives.GENERATE_SOURCE_MAP
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class AbstractK1WasmTypeScriptExportTest : AbstractK1WasmTest(
|
||||
"${JsEnvironmentConfigurator.TEST_DATA_DIR_PATH}/typescript-export/wasm/",
|
||||
"typescript-export/"
|
||||
) {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.defaultDirectives {
|
||||
+WasmEnvironmentConfigurationDirectives.CHECK_TYPESCRIPT_DECLARATIONS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class AbstractFirWasmTypeScriptExportTest : AbstractK1WasmTest(
|
||||
"${JsEnvironmentConfigurator.TEST_DATA_DIR_PATH}/typescript-export/wasm/",
|
||||
"typescript-export/"
|
||||
) {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.defaultDirectives {
|
||||
+WasmEnvironmentConfigurationDirectives.CHECK_TYPESCRIPT_DECLARATIONS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -56,6 +56,14 @@ abstract class AbstractWasmArtifactsCollector(testServices: TestServices) : Wasm
|
||||
mjsFiles += AdditionalFile(it.name, it.readText())
|
||||
}
|
||||
|
||||
|
||||
originalFile.parentFile.resolve(originalFile.nameWithoutExtension + "__main${JavaScript.DOT_EXTENSION}")
|
||||
.takeIf { it.exists() }
|
||||
?.let {
|
||||
entryMjs = it.name
|
||||
mjsFiles += AdditionalFile(it.name, it.readText())
|
||||
}
|
||||
|
||||
return JsArtifacts(entryMjs, jsFiles, mjsFiles)
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@ class WasmDtsHandler(testServices: TestServices) : WasmBinaryArtifactHandler(tes
|
||||
val globalDirectives = testServices.moduleStructure.allDirectives
|
||||
if (WasmEnvironmentConfigurationDirectives.CHECK_TYPESCRIPT_DECLARATIONS !in globalDirectives) return
|
||||
|
||||
val referenceDtsFile = module.files.first().originalFile.withReplacedExtensionOrNull(".kt", ".d.ts")
|
||||
?: error("Can't find reference .d.ts file")
|
||||
val referenceDtsFile = module.files.first().originalFile.parentFile
|
||||
.resolve("index.d.mts")
|
||||
.run { takeIf { it.exists() } ?: error("'${path}' doesn't exist") }
|
||||
|
||||
val generatedDts = info.compilerResult.dts
|
||||
?: error("Can't find generated .d.ts file")
|
||||
|
||||
Generated
-59
@@ -9,7 +9,6 @@ import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -186,62 +185,4 @@ public class FirWasmJsCodegenInteropTestGenerated extends AbstractFirWasmJsCodeg
|
||||
public void testWasmImport() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/wasmImport.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class TypeScriptDeclarations {
|
||||
@Test
|
||||
public void testAllFilesPresentInTypeScriptDeclarations() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("externalDeclarations.kt")
|
||||
public void testExternalDeclarations() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/externalDeclarations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/generics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsPrimitives.kt")
|
||||
public void testJsPrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/jsPrimitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableJsPrimitives.kt")
|
||||
public void testNullableJsPrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/nullableJsPrimitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullablePrimitives.kt")
|
||||
public void testNullablePrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/nullablePrimitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableUnisnged.kt")
|
||||
public void testNullableUnisnged() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/nullableUnisnged.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitives.kt")
|
||||
public void testPrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/primitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unisnged.kt")
|
||||
public void testUnisnged() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/unisnged.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+155
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.wasm.test;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateWasmTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class FirWasmTypeScriptExportTestGenerated extends AbstractFirWasmTypeScriptExportTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInWasm() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/externalDeclarations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class ExternalDeclarations {
|
||||
@Test
|
||||
public void testAllFilesPresentInExternalDeclarations() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/externalDeclarations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("externalDeclarations.kt")
|
||||
public void testExternalDeclarations() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/externalDeclarations/externalDeclarations.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/generics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Generics {
|
||||
@Test
|
||||
public void testAllFilesPresentInGenerics() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/generics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/generics/generics.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/jsPrimitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsPrimitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInJsPrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/jsPrimitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsPrimitives.kt")
|
||||
public void testJsPrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/jsPrimitives/jsPrimitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/nullableJsPrimitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class NullableJsPrimitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInNullableJsPrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/nullableJsPrimitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableJsPrimitives.kt")
|
||||
public void testNullableJsPrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/nullableJsPrimitives/nullableJsPrimitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/nullablePrimitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class NullablePrimitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInNullablePrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/nullablePrimitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullablePrimitives.kt")
|
||||
public void testNullablePrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/nullablePrimitives/nullablePrimitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/nullableUnsigned")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class NullableUnsigned {
|
||||
@Test
|
||||
public void testAllFilesPresentInNullableUnsigned() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/nullableUnsigned"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableUnsinged.kt")
|
||||
public void testNullableUnsinged() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/nullableUnsigned/nullableUnsinged.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/primitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Primitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInPrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/primitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitives.kt")
|
||||
public void testPrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/primitives/primitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/unsigned")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Unsigned {
|
||||
@Test
|
||||
public void testAllFilesPresentInUnsigned() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/unsigned"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsinged.kt")
|
||||
public void testUnsinged() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/unsigned/unsinged.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
-59
@@ -9,7 +9,6 @@ import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
@@ -186,62 +185,4 @@ public class K1WasmCodegenWasmJsInteropTestGenerated extends AbstractK1WasmCodeg
|
||||
public void testWasmImport() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/wasmImport.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class TypeScriptDeclarations {
|
||||
@Test
|
||||
public void testAllFilesPresentInTypeScriptDeclarations() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("externalDeclarations.kt")
|
||||
public void testExternalDeclarations() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/externalDeclarations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/generics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsPrimitives.kt")
|
||||
public void testJsPrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/jsPrimitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableJsPrimitives.kt")
|
||||
public void testNullableJsPrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/nullableJsPrimitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullablePrimitives.kt")
|
||||
public void testNullablePrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/nullablePrimitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableUnisnged.kt")
|
||||
public void testNullableUnisnged() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/nullableUnisnged.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitives.kt")
|
||||
public void testPrimitives() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/primitives.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unisnged.kt")
|
||||
public void testUnisnged() {
|
||||
runTest("compiler/testData/codegen/boxWasmJsInterop/typeScriptDeclarations/unisnged.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+155
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.wasm.test;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateWasmTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class K1WasmTypeScriptExportTestGenerated extends AbstractK1WasmTypeScriptExportTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInWasm() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/externalDeclarations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class ExternalDeclarations {
|
||||
@Test
|
||||
public void testAllFilesPresentInExternalDeclarations() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/externalDeclarations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("externalDeclarations.kt")
|
||||
public void testExternalDeclarations() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/externalDeclarations/externalDeclarations.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/generics")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Generics {
|
||||
@Test
|
||||
public void testAllFilesPresentInGenerics() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/generics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/generics/generics.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/jsPrimitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsPrimitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInJsPrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/jsPrimitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jsPrimitives.kt")
|
||||
public void testJsPrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/jsPrimitives/jsPrimitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/nullableJsPrimitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class NullableJsPrimitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInNullableJsPrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/nullableJsPrimitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableJsPrimitives.kt")
|
||||
public void testNullableJsPrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/nullableJsPrimitives/nullableJsPrimitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/nullablePrimitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class NullablePrimitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInNullablePrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/nullablePrimitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullablePrimitives.kt")
|
||||
public void testNullablePrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/nullablePrimitives/nullablePrimitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/nullableUnsigned")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class NullableUnsigned {
|
||||
@Test
|
||||
public void testAllFilesPresentInNullableUnsigned() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/nullableUnsigned"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableUnsinged.kt")
|
||||
public void testNullableUnsinged() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/nullableUnsigned/nullableUnsinged.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/primitives")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Primitives {
|
||||
@Test
|
||||
public void testAllFilesPresentInPrimitives() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/primitives"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitives.kt")
|
||||
public void testPrimitives() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/primitives/primitives.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("js/js.translator/testData/typescript-export/wasm/unsigned")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Unsigned {
|
||||
@Test
|
||||
public void testAllFilesPresentInUnsigned() {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/typescript-export/wasm/unsigned"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsinged.kt")
|
||||
public void testUnsinged() {
|
||||
runTest("js/js.translator/testData/typescript-export/wasm/unsigned/unsinged.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user