[JS TESTS] Rewrite js tests using new test infrastructure

This commit is contained in:
Ivan Kylchik
2021-08-28 15:51:42 +03:00
parent 4deab9693e
commit a2d2ace71a
51 changed files with 17973 additions and 11986 deletions
@@ -16,6 +16,7 @@ dependencies {
testImplementation(projectTests(":compiler:fir:fir2ir"))
testImplementation(projectTests(":compiler:fir:analysis-tests:legacy-fir-tests"))
testImplementation(projectTests(":compiler:visualizer"))
testImplementation(projectTests(":js:js.tests"))
testImplementation(projectTests(":generators:test-generator"))
testCompileOnly(project(":kotlin-reflect-api"))
testRuntimeOnly(project(":kotlin-reflect"))
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.test.generators
import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
import org.jetbrains.kotlin.generators.util.TestGeneratorUtil
import org.jetbrains.kotlin.js.testNew.*
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.runners.*
import org.jetbrains.kotlin.test.runners.codegen.*
@@ -162,6 +163,46 @@ fun generateJUnit5CompilerTests(args: Array<String>) {
}
}
// ---------------------------------------------- JS tests ----------------------------------------------
testGroup(testsRoot = "js/js.tests/tests-gen", testDataRoot = "js/js.translator/testData") {
testClass<AbstractBoxJsTest> {
model("box/", pattern = "^([^_](.+))\\.kt$", excludeDirs = listOf("incremental"))
}
testClass<AbstractSourceMapGenerationSmokeTest> {
model("sourcemap/")
}
testClass<AbstractOutputPrefixPostfixTest> {
model("outputPrefixPostfix/")
}
testClass<AbstractMultiModuleOrderTest> {
model("multiModuleOrder/")
}
}
testGroup(testsRoot = "js/js.tests/tests-gen", testDataRoot = "compiler/testData") {
val jvmOnlyBoxTests = listOf(
"testsWithJava9",
"testsWithJava15",
"testsWithJava17",
)
testClass<AbstractJsCodegenBoxTest> {
model("codegen/box", excludeDirs = jvmOnlyBoxTests + "compileKotlinAgainstKotlin")
}
testClass<AbstractJsCodegenInlineTest> {
model("codegen/boxInline")
}
testClass<AbstractJsLegacyPrimitiveArraysBoxTest> {
model("codegen/box/arrays")
}
}
// ---------------------------------------------- FIR tests ----------------------------------------------
testGroup(testsRoot = "compiler/fir/analysis-tests/tests-gen", testDataRoot = "compiler/testData") {