Revert "Add special tests for interceptRun support"
This reverts commit 01c21e218a.
This commit is contained in:
committed by
Stanislav Erokhin
parent
7ffefb515f
commit
8387d04425
@@ -255,10 +255,6 @@ fun main(args: Array<String>) {
|
||||
model("codegen/boxAgainstJava")
|
||||
}
|
||||
|
||||
testClass<AbstractAdditionalCoroutineBlackBoxCodegenTest> {
|
||||
model("codegen/box/coroutines")
|
||||
}
|
||||
|
||||
testClass<AbstractScriptCodegenTest> {
|
||||
model("codegen/script", extension = "kts")
|
||||
}
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ public class SimpleTestClassModel implements TestClassModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldBeGenerated(@NotNull String baseClassName) {
|
||||
public boolean shouldBeGenerated() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-15
@@ -20,14 +20,12 @@ import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.codegen.AbstractAdditionalCoroutineBlackBoxCodegenTest;
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.utils.Printer;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -104,19 +102,8 @@ public class SimpleTestMethodModel implements TestMethodModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldBeGenerated(@NotNull String baseClassName) {
|
||||
if (!InTextDirectivesUtils.isCompatibleTarget(targetBackend, file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!baseClassName.equals(AbstractAdditionalCoroutineBlackBoxCodegenTest.class.getSimpleName())) return true;
|
||||
|
||||
try {
|
||||
return !InTextDirectivesUtils.isDirectiveDefined(FileUtil.loadFile(file), "// NO_INTERCEPT_RESUME_TESTS");
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
public boolean shouldBeGenerated() {
|
||||
return InTextDirectivesUtils.isCompatibleTarget(targetBackend, file);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ public class SingleClassTestModel implements TestClassModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldBeGenerated(@NotNull String baseClassName) {
|
||||
public boolean shouldBeGenerated() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ public class TestGenerator {
|
||||
for (Iterator<MethodModel> iterator = testMethods.iterator(); iterator.hasNext(); ) {
|
||||
MethodModel methodModel = iterator.next();
|
||||
|
||||
if (!methodModel.shouldBeGenerated(baseTestClassName)) continue;
|
||||
if (!methodModel.shouldBeGenerated()) continue;
|
||||
|
||||
generateTestMethod(p, methodModel);
|
||||
if (iterator.hasNext() || !innerTestClasses.isEmpty()) {
|
||||
@@ -188,11 +188,11 @@ public class TestGenerator {
|
||||
|
||||
private static void generateTestMethod(Printer p, MethodModel methodModel) {
|
||||
generateMetadata(p, methodModel);
|
||||
|
||||
|
||||
methodModel.generateSignature(p);
|
||||
p.printWithNoIndent(" {");
|
||||
p.println();
|
||||
|
||||
|
||||
p.pushIndent();
|
||||
|
||||
methodModel.generateBody(p);
|
||||
|
||||
@@ -31,7 +31,7 @@ interface TestClassModel : TestEntityModel {
|
||||
}
|
||||
|
||||
interface MethodModel : TestEntityModel {
|
||||
fun shouldBeGenerated(baseClassName: String): Boolean = true
|
||||
fun shouldBeGenerated(): Boolean = true
|
||||
fun generateSignature(p: Printer)
|
||||
fun generateBody(p: Printer)
|
||||
}
|
||||
@@ -40,4 +40,4 @@ interface TestMethodModel : MethodModel {
|
||||
override fun generateSignature(p: Printer) {
|
||||
p.print("public void $name() throws Exception")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user