mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-06 15:53:19 +00:00
Debugger: Add IR-powered ranking tests
This commit is contained in:
@@ -75,7 +75,7 @@ open class ClassCodegen protected constructor(
|
||||
val descriptor = WrappedClassDescriptor()
|
||||
descriptor.bind(irClass)
|
||||
return state.factory.newVisitor(
|
||||
OtherOrigin(descriptor.psiElement, descriptor),
|
||||
irClass.OtherOrigin,
|
||||
type,
|
||||
irClass.fileParent.loadSourceFilesInfo()
|
||||
)
|
||||
|
||||
@@ -58,7 +58,6 @@ import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest
|
||||
import org.jetbrains.kotlin.idea.debugger.evaluate.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.test.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS
|
||||
@@ -221,6 +220,10 @@ fun main(args: Array<String>) {
|
||||
model("fileRanking")
|
||||
}
|
||||
|
||||
testClass<AbstractIrFileRankingTest> {
|
||||
model("fileRanking", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractAsyncStackTraceTest> {
|
||||
model("asyncStackTrace")
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest
|
||||
import org.jetbrains.kotlin.idea.debugger.evaluate.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.test.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS
|
||||
@@ -228,6 +227,10 @@ fun main(args: Array<String>) {
|
||||
model("fileRanking")
|
||||
}
|
||||
|
||||
testClass<AbstractIrFileRankingTest> {
|
||||
model("fileRanking", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractAsyncStackTraceTest> {
|
||||
model("asyncStackTrace")
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest
|
||||
import org.jetbrains.kotlin.idea.debugger.evaluate.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.test.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS
|
||||
@@ -218,6 +217,10 @@ fun main(args: Array<String>) {
|
||||
model("fileRanking")
|
||||
}
|
||||
|
||||
testClass<AbstractIrFileRankingTest> {
|
||||
model("fileRanking", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractAsyncStackTraceTest> {
|
||||
model("asyncStackTrace")
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest
|
||||
import org.jetbrains.kotlin.idea.debugger.evaluate.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.test.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS
|
||||
@@ -218,6 +217,10 @@ fun main(args: Array<String>) {
|
||||
model("fileRanking")
|
||||
}
|
||||
|
||||
testClass<AbstractIrFileRankingTest> {
|
||||
model("fileRanking", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractAsyncStackTraceTest> {
|
||||
model("asyncStackTrace")
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest
|
||||
import org.jetbrains.kotlin.idea.debugger.evaluate.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.sequence.exec.AbstractSequenceTraceTestCase
|
||||
import org.jetbrains.kotlin.idea.debugger.test.*
|
||||
import org.jetbrains.kotlin.idea.debugger.test.AbstractFileRankingTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS
|
||||
@@ -218,6 +217,10 @@ fun main(args: Array<String>) {
|
||||
model("fileRanking")
|
||||
}
|
||||
|
||||
testClass<AbstractIrFileRankingTest> {
|
||||
model("fileRanking", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractAsyncStackTraceTest> {
|
||||
model("asyncStackTrace")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2019 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.idea.debugger.test
|
||||
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
|
||||
abstract class AbstractIrFileRankingTest : AbstractFileRankingTest() {
|
||||
override fun getBackend() = TargetBackend.JVM_IR
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright 2010-2019 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.idea.debugger.test;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class IrFileRankingTestGenerated extends AbstractIrFileRankingTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInFileRanking() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("anonymousClasses.kt")
|
||||
public void testAnonymousClasses() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/anonymousClasses.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("differentFlags.kt")
|
||||
public void testDifferentFlags() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/differentFlags.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("init.kt")
|
||||
public void testInit() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/init.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdas.kt")
|
||||
public void testLambdas() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/lambdas.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("multilinePrimaryConstructor.kt")
|
||||
public void testMultilinePrimaryConstructor() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/multilinePrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("multilinePrimaryConstructorWithBody.kt")
|
||||
public void testMultilinePrimaryConstructorWithBody() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/multilinePrimaryConstructorWithBody.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("parametersWithUnloadedClass.kt")
|
||||
public void testParametersWithUnloadedClass() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/parametersWithUnloadedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyDelegates.kt")
|
||||
public void testPropertyDelegates() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/propertyDelegates.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("sameClassName.kt")
|
||||
public void testSameClassName() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/sameClassName.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("sameClassNameDifferentMethodNames.kt")
|
||||
public void testSameClassNameDifferentMethodNames() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/sameClassNameDifferentMethodNames.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/simple.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("topLevel.kt")
|
||||
public void testTopLevel() throws Exception {
|
||||
runTest("idea/jvm-debugger/jvm-debugger-test/testData/fileRanking/topLevel.kt");
|
||||
}
|
||||
}
|
||||
@@ -33,4 +33,6 @@ class A {
|
||||
block { block { val x = 4 }}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
@@ -18,4 +18,6 @@ class B {
|
||||
val a by lazy {
|
||||
val b = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
Reference in New Issue
Block a user