JS/JS IR: split testing tasks for the two backends
Run jsTest for current backend, and jsIrTest for the JS-IR backend tests
This commit is contained in:
@@ -64,14 +64,19 @@ sourceSets {
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
projectTest {
|
||||
|
||||
fun Test.setUpBoxTests(jsEnabled: Boolean, jsIrEnabled: Boolean, skipIrKlib: Boolean = false) {
|
||||
dependsOn(":dist")
|
||||
dependsOn(testJsRuntime)
|
||||
dependsOn(generateIrRuntimeKlib)
|
||||
if (jsEnabled) dependsOn(testJsRuntime)
|
||||
if (jsIrEnabled && !skipIrKlib) dependsOn(generateIrRuntimeKlib)
|
||||
|
||||
if (jsEnabled && !jsIrEnabled) exclude("org/jetbrains/kotlin/js/test/ir/semantics/*")
|
||||
if (!jsEnabled && jsIrEnabled) include("org/jetbrains/kotlin/js/test/ir/semantics/*")
|
||||
|
||||
jvmArgs("-da:jdk.nashorn.internal.runtime.RecompilableScriptFunctionData") // Disable assertion which fails due to a bug in nashorn (KT-23637)
|
||||
workingDir = rootDir
|
||||
if (findProperty("kotlin.compiler.js.ir.tests.skip")?.toString()?.toBoolean() == true) {
|
||||
exclude("org/jetbrains/kotlin/js/test/semantics/Ir*")
|
||||
exclude("org/jetbrains/kotlin/js/test/ir/semantics/*")
|
||||
}
|
||||
doFirst {
|
||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||
@@ -86,19 +91,29 @@ projectTest {
|
||||
}
|
||||
}
|
||||
|
||||
testsJar {}
|
||||
projectTest {
|
||||
setUpBoxTests(jsEnabled = true, jsIrEnabled = true)
|
||||
}
|
||||
|
||||
projectTest("jsTest") {
|
||||
setUpBoxTests(jsEnabled = true, jsIrEnabled = false)
|
||||
}
|
||||
|
||||
projectTest("jsIrTest") {
|
||||
setUpBoxTests(jsEnabled = false, jsIrEnabled = true)
|
||||
}
|
||||
|
||||
projectTest("quickTest") {
|
||||
dependsOn(":dist")
|
||||
dependsOn(testJsRuntime)
|
||||
workingDir = rootDir
|
||||
setUpBoxTests(jsEnabled = true, jsIrEnabled = false)
|
||||
systemProperty("kotlin.js.skipMinificationTest", "true")
|
||||
doFirst {
|
||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
||||
}
|
||||
}
|
||||
|
||||
projectTest("quickIrTest") {
|
||||
setUpBoxTests(jsEnabled = false, jsIrEnabled = true, skipIrKlib = true)
|
||||
}
|
||||
|
||||
testsJar {}
|
||||
|
||||
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt")
|
||||
val testDataDir = project(":js:js.translator").projectDir.resolve("testData")
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.generators.tests
|
||||
import org.jetbrains.kotlin.generators.tests.generator.testGroup
|
||||
import org.jetbrains.kotlin.js.test.AbstractDceTest
|
||||
import org.jetbrains.kotlin.js.test.AbstractJsLineNumberTest
|
||||
import org.jetbrains.kotlin.js.test.ir.semantics.*
|
||||
import org.jetbrains.kotlin.js.test.semantics.*
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.js.test.semantics;
|
||||
package org.jetbrains.kotlin.js.test.ir.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. 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.js.test.ir.semantics
|
||||
|
||||
import org.jetbrains.kotlin.js.test.BasicBoxTest
|
||||
import org.jetbrains.kotlin.js.test.BasicIrBoxTest
|
||||
|
||||
abstract class AbstractIrBoxJsTest : BasicIrBoxTest(BasicBoxTest.TEST_DATA_DIR_PATH + "box/", "irBox/")
|
||||
|
||||
abstract class AbstractIrJsCodegenBoxTest : BasicIrBoxTest(
|
||||
"compiler/testData/codegen/box/",
|
||||
"codegen/irBox/"
|
||||
)
|
||||
|
||||
abstract class BorrowedIrInlineTest(relativePath: String) : BasicIrBoxTest(
|
||||
"compiler/testData/codegen/boxInline/$relativePath",
|
||||
"codegen/irBoxInline/$relativePath"
|
||||
) {
|
||||
init {
|
||||
additionalCommonFileDirectories += BasicBoxTest.TEST_DATA_DIR_PATH + relativePath + "/_commonFiles/"
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractIrNonLocalReturnsTest : BorrowedIrInlineTest("nonLocalReturns/")
|
||||
|
||||
abstract class AbstractIrPropertyAccessorsInlineTests : BorrowedIrInlineTest("property/")
|
||||
|
||||
abstract class AbstractIrNoInlineTests : BorrowedIrInlineTest("noInline/")
|
||||
|
||||
abstract class AbstractIrCallableReferenceInlineTests : BorrowedIrInlineTest("callableReference/")
|
||||
|
||||
abstract class AbstractIrEnumValuesInlineTests : BorrowedIrInlineTest("enum/")
|
||||
|
||||
abstract class AbstractIrInlineDefaultValuesTests : BorrowedIrInlineTest("defaultValues/")
|
||||
|
||||
abstract class AbstractIrInlineSuspendTests : BorrowedIrInlineTest("suspend/")
|
||||
|
||||
abstract class AbstractIrJsInlineContractsTests : BorrowedIrInlineTest("contracts/")
|
||||
+1
-33
@@ -56,36 +56,4 @@ abstract class AbstractSourceMapGenerationSmokeTest : BasicBoxTest(
|
||||
"sourcemap/",
|
||||
generateSourceMap = true,
|
||||
generateNodeJsRunner = false
|
||||
)
|
||||
|
||||
abstract class AbstractIrBoxJsTest : BasicIrBoxTest(BasicBoxTest.TEST_DATA_DIR_PATH + "box/", "irBox/")
|
||||
|
||||
abstract class AbstractIrJsCodegenBoxTest : BasicIrBoxTest(
|
||||
"compiler/testData/codegen/box/",
|
||||
"codegen/irBox/"
|
||||
)
|
||||
|
||||
abstract class BorrowedIrInlineTest(relativePath: String) : BasicIrBoxTest(
|
||||
"compiler/testData/codegen/boxInline/$relativePath",
|
||||
"codegen/irBoxInline/$relativePath"
|
||||
) {
|
||||
init {
|
||||
additionalCommonFileDirectories += BasicBoxTest.TEST_DATA_DIR_PATH + relativePath + "/_commonFiles/"
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractIrNonLocalReturnsTest : BorrowedIrInlineTest("nonLocalReturns/")
|
||||
|
||||
abstract class AbstractIrPropertyAccessorsInlineTests : BorrowedIrInlineTest("property/")
|
||||
|
||||
abstract class AbstractIrNoInlineTests : BorrowedIrInlineTest("noInline/")
|
||||
|
||||
abstract class AbstractIrCallableReferenceInlineTests : BorrowedIrInlineTest("callableReference/")
|
||||
|
||||
abstract class AbstractIrEnumValuesInlineTests : BorrowedIrInlineTest("enum/")
|
||||
|
||||
abstract class AbstractIrInlineDefaultValuesTests : BorrowedIrInlineTest("defaultValues/")
|
||||
|
||||
abstract class AbstractIrInlineSuspendTests : BorrowedIrInlineTest("suspend/")
|
||||
|
||||
abstract class AbstractIrJsInlineContractsTests : BorrowedIrInlineTest("contracts/")
|
||||
)
|
||||
Reference in New Issue
Block a user