Some changes in test generating infrastructure:
* add separate run function for each test class to simplify and deduplicate generated code * move the code that process IGNORE_BACKEND directive to the separate function, outside of generated code. ** it reduces size and complexity of a generated code ** it allows to mute and unmute tests w/o regenerate tests * add an ability to generate IGNORE_BACKEND directive automatically, it's disabled by default * add an ability to remove IGNORE_BACKEND directive automatically, it's enabled by default * remove whitelists
This commit is contained in:
@@ -10,7 +10,6 @@ import com.google.common.collect.Sets;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import kotlin.io.FilesKt;
|
||||
import kotlin.text.StringsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -27,6 +26,8 @@ public final class InTextDirectivesUtils {
|
||||
|
||||
private static final String DIRECTIVES_FILE_NAME = "directives.txt";
|
||||
|
||||
public static final String IGNORE_BACKEND_DIRECTIVE_PREFIX = "// IGNORE_BACKEND: ";
|
||||
|
||||
private InTextDirectivesUtils() {
|
||||
}
|
||||
|
||||
@@ -225,19 +226,13 @@ public final class InTextDirectivesUtils {
|
||||
return backends.isEmpty() || backends.contains(targetBackend.name()) || backends.contains(targetBackend.getCompatibleWith().name());
|
||||
}
|
||||
|
||||
private static boolean isIgnoredTargetByPrefix(TargetBackend targetBackend, File file, String prefix) {
|
||||
public static boolean isIgnoredTarget(TargetBackend targetBackend, File file) {
|
||||
if (targetBackend == TargetBackend.ANY) return false;
|
||||
|
||||
List<String> ignoredBackends = findListWithPrefixes(textWithDirectives(file), prefix);
|
||||
List<String> ignoredBackends = findListWithPrefixes(textWithDirectives(file), IGNORE_BACKEND_DIRECTIVE_PREFIX);
|
||||
return ignoredBackends.contains(targetBackend.name());
|
||||
}
|
||||
|
||||
public static boolean isIgnoredTarget(TargetBackend targetBackend, File file) {
|
||||
if (!isAllowedByWhitelist(targetBackend, file)) return true;
|
||||
|
||||
return isIgnoredTargetByPrefix(targetBackend, file, "// IGNORE_BACKEND: ");
|
||||
}
|
||||
|
||||
public static boolean isIgnoredTargetWithoutCheck(TargetBackend targetBackend, File file) {
|
||||
return isIgnoredTargetByPrefix(targetBackend, file, "// IGNORE_BACKEND_WITHOUT_CHECK: ");
|
||||
}
|
||||
@@ -246,17 +241,4 @@ public final class InTextDirectivesUtils {
|
||||
public static boolean isPassingTarget(TargetBackend targetBackend, File file) {
|
||||
return isCompatibleTarget(targetBackend, file) && !isIgnoredTarget(targetBackend, file) && !isIgnoredTargetWithoutCheck(targetBackend, file);
|
||||
}
|
||||
|
||||
private static boolean isAllowedByWhitelist(@NotNull TargetBackend targetBackend, @NotNull File file) {
|
||||
List<File> whitelist = targetBackend.getWhitelist();
|
||||
if (whitelist == null) return true;
|
||||
|
||||
for (File entry : whitelist) {
|
||||
if (FilesKt.startsWith(file, entry)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,18 +87,20 @@ import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isCompatibleTarget;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isDirectiveDefined;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.*;
|
||||
|
||||
public class KotlinTestUtils {
|
||||
public static String TEST_MODULE_NAME = "test-module";
|
||||
|
||||
public static final String TEST_GENERATOR_NAME = "org.jetbrains.kotlin.generators.tests.TestsPackage";
|
||||
public static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
private static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
|
||||
public static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
private static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
Boolean.getBoolean("org.jetbrains.kotlin.run.ignored.tests.as.regular");
|
||||
|
||||
private static final boolean AUTOMATICALLY_UNMUTE_PASSED_TESTS = true;
|
||||
private static final boolean AUTOMATICALLY_MUTE_FAILED_TESTS = false;
|
||||
|
||||
private static final List<File> filesToDelete = new ArrayList<>();
|
||||
|
||||
/**
|
||||
@@ -1011,6 +1013,69 @@ public class KotlinTestUtils {
|
||||
return testFile;
|
||||
}
|
||||
|
||||
public interface DoTest {
|
||||
void invoke(String filePath) throws Exception;
|
||||
}
|
||||
|
||||
// In this test runner version the `testDataFile` parameter is annotated by `TestDataFile`.
|
||||
// So only file paths passed to this parameter will be used in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
public static void runTest(DoTest test, TargetBackend targetBackend, @TestDataFile String testDataFile) throws Exception {
|
||||
runTest0(test, targetBackend, testDataFile);
|
||||
}
|
||||
|
||||
// In this test runner version, NONE of the parameters are annotated by `TestDataFile`.
|
||||
// So DevKit will use test name to determine related files in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
//
|
||||
// Pro:
|
||||
// * in most cases, it shows all related files including generated js files, for example.
|
||||
// Cons:
|
||||
// * sometimes, for too common/general names, it shows many variants to navigate
|
||||
// * it adds an additional step for navigation -- you must choose an exact file to navigate
|
||||
public static void runTest0(DoTest test, TargetBackend targetBackend, String testDataFilePath) throws Exception {
|
||||
File testDataFile = new File(testDataFilePath);
|
||||
|
||||
boolean isIgnored = isIgnoredTarget(targetBackend, testDataFile);
|
||||
|
||||
try {
|
||||
test.invoke(testDataFilePath);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
|
||||
if (!isIgnored && AUTOMATICALLY_MUTE_FAILED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = directive + "\n" + text;
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was added to \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
if (RUN_IGNORED_TESTS_AS_REGULAR || !isIgnored) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isIgnored) {
|
||||
if (AUTOMATICALLY_UNMUTE_PASSED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = Pattern.compile("^" + directive + "\n", Pattern.MULTILINE).matcher(text).replaceAll("");
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was removed from \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive.");
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTestsRoot(@NotNull Class<?> testCaseClass) {
|
||||
TestMetadata testClassMetadata = testCaseClass.getAnnotation(TestMetadata.class);
|
||||
Assert.assertNotNull("No metadata for class: " + testCaseClass, testClassMetadata);
|
||||
|
||||
@@ -87,18 +87,20 @@ import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isCompatibleTarget;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isDirectiveDefined;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.*;
|
||||
|
||||
public class KotlinTestUtils {
|
||||
public static String TEST_MODULE_NAME = "test-module";
|
||||
|
||||
public static final String TEST_GENERATOR_NAME = "org.jetbrains.kotlin.generators.tests.TestsPackage";
|
||||
public static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
private static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
|
||||
public static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
private static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
Boolean.getBoolean("org.jetbrains.kotlin.run.ignored.tests.as.regular");
|
||||
|
||||
private static final boolean AUTOMATICALLY_UNMUTE_PASSED_TESTS = true;
|
||||
private static final boolean AUTOMATICALLY_MUTE_FAILED_TESTS = false;
|
||||
|
||||
private static final List<File> filesToDelete = new ArrayList<>();
|
||||
|
||||
/**
|
||||
@@ -1011,6 +1013,69 @@ public class KotlinTestUtils {
|
||||
return testFile;
|
||||
}
|
||||
|
||||
public interface DoTest {
|
||||
void invoke(String filePath) throws Exception;
|
||||
}
|
||||
|
||||
// In this test runner version the `testDataFile` parameter is annotated by `TestDataFile`.
|
||||
// So only file paths passed to this parameter will be used in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
public static void runTest(DoTest test, TargetBackend targetBackend, @TestDataFile String testDataFile) throws Exception {
|
||||
runTest0(test, targetBackend, testDataFile);
|
||||
}
|
||||
|
||||
// In this test runner version, NONE of the parameters are annotated by `TestDataFile`.
|
||||
// So DevKit will use test name to determine related files in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
//
|
||||
// Pro:
|
||||
// * in most cases, it shows all related files including generated js files, for example.
|
||||
// Cons:
|
||||
// * sometimes, for too common/general names, it shows many variants to navigate
|
||||
// * it adds an additional step for navigation -- you must choose an exact file to navigate
|
||||
public static void runTest0(DoTest test, TargetBackend targetBackend, String testDataFilePath) throws Exception {
|
||||
File testDataFile = new File(testDataFilePath);
|
||||
|
||||
boolean isIgnored = isIgnoredTarget(targetBackend, testDataFile);
|
||||
|
||||
try {
|
||||
test.invoke(testDataFilePath);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
|
||||
if (!isIgnored && AUTOMATICALLY_MUTE_FAILED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = directive + "\n" + text;
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was added to \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
if (RUN_IGNORED_TESTS_AS_REGULAR || !isIgnored) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isIgnored) {
|
||||
if (AUTOMATICALLY_UNMUTE_PASSED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = Pattern.compile("^" + directive + "\n", Pattern.MULTILINE).matcher(text).replaceAll("");
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was removed from \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive.");
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTestsRoot(@NotNull Class<?> testCaseClass) {
|
||||
TestMetadata testClassMetadata = testCaseClass.getAnnotation(TestMetadata.class);
|
||||
Assert.assertNotNull("No metadata for class: " + testCaseClass, testClassMetadata);
|
||||
|
||||
@@ -87,18 +87,20 @@ import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isCompatibleTarget;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isDirectiveDefined;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.*;
|
||||
|
||||
public class KotlinTestUtils {
|
||||
public static String TEST_MODULE_NAME = "test-module";
|
||||
|
||||
public static final String TEST_GENERATOR_NAME = "org.jetbrains.kotlin.generators.tests.TestsPackage";
|
||||
public static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
private static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
|
||||
public static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
private static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
Boolean.getBoolean("org.jetbrains.kotlin.run.ignored.tests.as.regular");
|
||||
|
||||
private static final boolean AUTOMATICALLY_UNMUTE_PASSED_TESTS = true;
|
||||
private static final boolean AUTOMATICALLY_MUTE_FAILED_TESTS = false;
|
||||
|
||||
private static final List<File> filesToDelete = new ArrayList<>();
|
||||
|
||||
/**
|
||||
@@ -1011,6 +1013,69 @@ public class KotlinTestUtils {
|
||||
return testFile;
|
||||
}
|
||||
|
||||
public interface DoTest {
|
||||
void invoke(String filePath) throws Exception;
|
||||
}
|
||||
|
||||
// In this test runner version the `testDataFile` parameter is annotated by `TestDataFile`.
|
||||
// So only file paths passed to this parameter will be used in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
public static void runTest(DoTest test, TargetBackend targetBackend, @TestDataFile String testDataFile) throws Exception {
|
||||
runTest0(test, targetBackend, testDataFile);
|
||||
}
|
||||
|
||||
// In this test runner version, NONE of the parameters are annotated by `TestDataFile`.
|
||||
// So DevKit will use test name to determine related files in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
//
|
||||
// Pro:
|
||||
// * in most cases, it shows all related files including generated js files, for example.
|
||||
// Cons:
|
||||
// * sometimes, for too common/general names, it shows many variants to navigate
|
||||
// * it adds an additional step for navigation -- you must choose an exact file to navigate
|
||||
public static void runTest0(DoTest test, TargetBackend targetBackend, String testDataFilePath) throws Exception {
|
||||
File testDataFile = new File(testDataFilePath);
|
||||
|
||||
boolean isIgnored = isIgnoredTarget(targetBackend, testDataFile);
|
||||
|
||||
try {
|
||||
test.invoke(testDataFilePath);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
|
||||
if (!isIgnored && AUTOMATICALLY_MUTE_FAILED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = directive + "\n" + text;
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was added to \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
if (RUN_IGNORED_TESTS_AS_REGULAR || !isIgnored) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isIgnored) {
|
||||
if (AUTOMATICALLY_UNMUTE_PASSED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = Pattern.compile("^" + directive + "\n", Pattern.MULTILINE).matcher(text).replaceAll("");
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was removed from \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive.");
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTestsRoot(@NotNull Class<?> testCaseClass) {
|
||||
TestMetadata testClassMetadata = testCaseClass.getAnnotation(TestMetadata.class);
|
||||
Assert.assertNotNull("No metadata for class: " + testCaseClass, testClassMetadata);
|
||||
|
||||
@@ -87,18 +87,20 @@ import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isCompatibleTarget;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isDirectiveDefined;
|
||||
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.*;
|
||||
|
||||
public class KotlinTestUtils {
|
||||
public static String TEST_MODULE_NAME = "test-module";
|
||||
|
||||
public static final String TEST_GENERATOR_NAME = "org.jetbrains.kotlin.generators.tests.TestsPackage";
|
||||
public static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
private static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
|
||||
|
||||
public static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
private static final boolean RUN_IGNORED_TESTS_AS_REGULAR =
|
||||
Boolean.getBoolean("org.jetbrains.kotlin.run.ignored.tests.as.regular");
|
||||
|
||||
private static final boolean AUTOMATICALLY_UNMUTE_PASSED_TESTS = true;
|
||||
private static final boolean AUTOMATICALLY_MUTE_FAILED_TESTS = false;
|
||||
|
||||
private static final List<File> filesToDelete = new ArrayList<>();
|
||||
|
||||
/**
|
||||
@@ -1011,6 +1013,69 @@ public class KotlinTestUtils {
|
||||
return testFile;
|
||||
}
|
||||
|
||||
public interface DoTest {
|
||||
void invoke(String filePath) throws Exception;
|
||||
}
|
||||
|
||||
// In this test runner version the `testDataFile` parameter is annotated by `TestDataFile`.
|
||||
// So only file paths passed to this parameter will be used in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
public static void runTest(DoTest test, TargetBackend targetBackend, @TestDataFile String testDataFile) throws Exception {
|
||||
runTest0(test, targetBackend, testDataFile);
|
||||
}
|
||||
|
||||
// In this test runner version, NONE of the parameters are annotated by `TestDataFile`.
|
||||
// So DevKit will use test name to determine related files in navigation actions, like "Navigate to testdata" and "Related Symbol..."
|
||||
//
|
||||
// Pro:
|
||||
// * in most cases, it shows all related files including generated js files, for example.
|
||||
// Cons:
|
||||
// * sometimes, for too common/general names, it shows many variants to navigate
|
||||
// * it adds an additional step for navigation -- you must choose an exact file to navigate
|
||||
public static void runTest0(DoTest test, TargetBackend targetBackend, String testDataFilePath) throws Exception {
|
||||
File testDataFile = new File(testDataFilePath);
|
||||
|
||||
boolean isIgnored = isIgnoredTarget(targetBackend, testDataFile);
|
||||
|
||||
try {
|
||||
test.invoke(testDataFilePath);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
|
||||
if (!isIgnored && AUTOMATICALLY_MUTE_FAILED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = directive + "\n" + text;
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was added to \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
if (RUN_IGNORED_TESTS_AS_REGULAR || !isIgnored) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
if (isIgnored) {
|
||||
if (AUTOMATICALLY_UNMUTE_PASSED_TESTS) {
|
||||
String text = doLoadFile(testDataFile);
|
||||
String directive = InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIX + targetBackend.name();
|
||||
String newText = Pattern.compile("^" + directive + "\n", Pattern.MULTILINE).matcher(text).replaceAll("");
|
||||
|
||||
if (!newText.equals(text)) {
|
||||
System.err.println("\"" + directive + "\" was removed from \"" + testDataFile + "\"");
|
||||
FileUtil.writeToFile(testDataFile, newText);
|
||||
}
|
||||
}
|
||||
|
||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive.");
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTestsRoot(@NotNull Class<?> testCaseClass) {
|
||||
TestMetadata testClassMetadata = testCaseClass.getAnnotation(TestMetadata.class);
|
||||
Assert.assertNotNull("No metadata for class: " + testCaseClass, testClassMetadata);
|
||||
|
||||
@@ -5,20 +5,14 @@
|
||||
|
||||
package org.jetbrains.kotlin.test
|
||||
|
||||
import java.io.File
|
||||
|
||||
enum class TargetBackend(
|
||||
private val compatibleWithTargetBackend: TargetBackend? = null,
|
||||
// if whitelist === null it will not be used in test generator (will work as usual)
|
||||
// if path to testData file starts with or equals to any entry from whitelist it will be processed as usual
|
||||
// otherwise a testData file will be treated as ignored
|
||||
val whitelist: List<File>? = null
|
||||
private val compatibleWithTargetBackend: TargetBackend? = null
|
||||
) {
|
||||
ANY,
|
||||
JVM,
|
||||
JVM_IR(JVM),
|
||||
JS,
|
||||
JS_IR(JS, JS_IR_BACKEND_TEST_WHITELIST);
|
||||
JS_IR(JS);
|
||||
|
||||
val compatibleWith get() = compatibleWithTargetBackend ?: ANY
|
||||
}
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.test
|
||||
|
||||
import java.io.File
|
||||
|
||||
val JS_IR_BACKEND_TEST_WHITELIST = listOf(
|
||||
"js/js.translator/testData/box/examples/funDelegation.kt",
|
||||
"js/js.translator/testData/box/examples/incrementProperty.kt",
|
||||
"js/js.translator/testData/box/examples/inheritedMethod.kt",
|
||||
"js/js.translator/testData/box/examples/initializerBlock.kt",
|
||||
"js/js.translator/testData/box/examples/kt242.kt",
|
||||
"js/js.translator/testData/box/examples/newInstanceDefaultConstructor.kt",
|
||||
"js/js.translator/testData/box/examples/propertyDelegation.kt",
|
||||
"js/js.translator/testData/box/examples/rightHandOverride.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/equals/stringsEqual.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/evaluationOrder/ifAsPlusArgument.kt",
|
||||
"js/js.translator/testData/box/expression/evaluationOrder/secondaryConstructorTemporaryVars.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/identifierClash/overloadedFun.kt",
|
||||
"js/js.translator/testData/box/expression/identifierClash/useVariableOfNameOfFunction.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/identityEquals/identityEqualsMethod.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/invoke/internalFunctionFromSuperclass.kt",
|
||||
"js/js.translator/testData/box/expression/invoke/invokeWithDispatchReceiver.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/misc/classWithoutPackage.kt",
|
||||
"js/js.translator/testData/box/expression/misc/KT-740-3.kt",
|
||||
"js/js.translator/testData/box/expression/misc/localProperty.kt",
|
||||
"js/js.translator/testData/box/expression/misc/propertiesWithExplicitlyDefinedAccessorsWithoutBodies.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/stringClass/kt2227_2.kt",
|
||||
"js/js.translator/testData/box/expression/stringClass/kt2227.kt",
|
||||
"js/js.translator/testData/box/expression/stringClass/objectToStringCallInTemplate.kt",
|
||||
"js/js.translator/testData/box/expression/stringClass/stringAssignment.kt",
|
||||
"js/js.translator/testData/box/expression/stringClass/stringConstant.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/stringTemplates/nonStrings.kt",
|
||||
|
||||
"js/js.translator/testData/box/expression/when/doWhileWithOneStmWhen.kt",
|
||||
"js/js.translator/testData/box/expression/when/empty.kt",
|
||||
"js/js.translator/testData/box/expression/when/ifWithOneStmWhen.kt",
|
||||
"js/js.translator/testData/box/expression/when/kt1665.kt",
|
||||
"js/js.translator/testData/box/expression/when/whenValue.kt",
|
||||
"js/js.translator/testData/box/expression/when/whenWithOneStmWhen.kt",
|
||||
"js/js.translator/testData/box/expression/when/whenWithOnlyElse.kt",
|
||||
"js/js.translator/testData/box/expression/when/whenWithoutExpression.kt",
|
||||
|
||||
"js/js.translator/testData/box/extensionFunction/extensionFunctionCalledFromExtensionFunction.kt",
|
||||
|
||||
"js/js.translator/testData/box/extensionProperty/inClass.kt",
|
||||
|
||||
"js/js.translator/testData/box/inheritance/abstractVarOverride.kt",
|
||||
"js/js.translator/testData/box/inheritance/baseCall.kt",
|
||||
"js/js.translator/testData/box/inheritance/initializersOfBasicClassExecute.kt",
|
||||
"js/js.translator/testData/box/inheritance/methodOverride.kt",
|
||||
"js/js.translator/testData/box/inheritance/valOverride.kt",
|
||||
"js/js.translator/testData/box/inheritance/valuePassedToAncestorConstructor.kt",
|
||||
"js/js.translator/testData/box/inheritance/withInitializeMethod.kt",
|
||||
|
||||
"js/js.translator/testData/box/initialize/rootPackageValInit.kt",
|
||||
"js/js.translator/testData/box/initialize/rootValInit.kt",
|
||||
|
||||
"js/js.translator/testData/box/inline/sameNameOfDeclarationsInSameModule.kt",
|
||||
|
||||
"js/js.translator/testData/box/multideclaration/multiValOrVar.kt",
|
||||
|
||||
"js/js.translator/testData/box/multiFile/functionsVisibleFromOtherFile.kt",
|
||||
|
||||
"js/js.translator/testData/box/multiPackage/createClassFromOtherPackage.kt",
|
||||
"js/js.translator/testData/box/multiPackage/createClassFromOtherPackageUsingImport.kt",
|
||||
"js/js.translator/testData/box/multiPackage/functionsVisibleFromOtherPackage.kt",
|
||||
"js/js.translator/testData/box/multiPackage/nestedPackageFunctionCalledFromOtherPackage.kt",
|
||||
"js/js.translator/testData/box/multiPackage/subpackagesWithClashingNames.kt",
|
||||
"js/js.translator/testData/box/multiPackage/subpackagesWithClashingNamesUsingImport.kt",
|
||||
|
||||
"js/js.translator/testData/box/nameClashes/differenceInCapitalization.kt",
|
||||
"js/js.translator/testData/box/nameClashes/methodOverload.kt",
|
||||
|
||||
"js/js.translator/testData/box/operatorOverloading/binaryDivOverload.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/compareTo.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/compareToByName.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/notOverload.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/plusOverload.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/postfixInc.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/prefixDecOverload.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/prefixIncReturnsCorrectValue.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/unaryOnIntPropertyAsStatement.kt",
|
||||
"js/js.translator/testData/box/operatorOverloading/usingModInCaseModAssignNotAvailable.kt",
|
||||
|
||||
"js/js.translator/testData/box/package/classCreatedInDeeplyNestedPackage.kt",
|
||||
"js/js.translator/testData/box/package/deeplyNestedPackage.kt",
|
||||
"js/js.translator/testData/box/package/deeplyNestedPackageFunctionCalled.kt",
|
||||
"js/js.translator/testData/box/package/initializersOfNestedPackagesExecute.kt",
|
||||
"js/js.translator/testData/box/package/nestedPackage.kt",
|
||||
|
||||
"js/js.translator/testData/box/propertyAccess/accessToInstanceProperty.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/customGetter.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/customSetter.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/field.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/initInstanceProperties.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/initValInConstructor.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/packageCustomAccessors.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/packagePropertyInitializer.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/packagePropertySet.kt",
|
||||
"js/js.translator/testData/box/propertyAccess/twoClassesWithProperties.kt",
|
||||
|
||||
"js/js.translator/testData/box/propertyOverride/overrideExtensionProperty.kt",
|
||||
|
||||
"js/js.translator/testData/box/safeCall/safeCall.kt",
|
||||
|
||||
"js/js.translator/testData/box/simple/assign.kt",
|
||||
"js/js.translator/testData/box/simple/breakDoWhile.kt",
|
||||
"js/js.translator/testData/box/simple/breakWhile.kt",
|
||||
"js/js.translator/testData/box/simple/classInstantiation.kt",
|
||||
"js/js.translator/testData/box/simple/comparison.kt",
|
||||
"js/js.translator/testData/box/simple/complexExpressionAsConstructorParameter.kt",
|
||||
"js/js.translator/testData/box/simple/constructorWithParameter.kt",
|
||||
"js/js.translator/testData/box/simple/constructorWithPropertiesAsParameters.kt",
|
||||
"js/js.translator/testData/box/simple/continueDoWhile.kt",
|
||||
"js/js.translator/testData/box/simple/continueWhile.kt",
|
||||
"js/js.translator/testData/box/simple/doWhile.kt",
|
||||
"js/js.translator/testData/box/simple/doWhile2.kt",
|
||||
"js/js.translator/testData/box/simple/elseif.kt",
|
||||
"js/js.translator/testData/box/simple/if.kt",
|
||||
"js/js.translator/testData/box/simple/ifElseAsExpression.kt",
|
||||
"js/js.translator/testData/box/simple/methodDeclarationAndCall.kt",
|
||||
"js/js.translator/testData/box/simple/minusAssignOnProperty.kt",
|
||||
"js/js.translator/testData/box/simple/notBoolean.kt",
|
||||
"js/js.translator/testData/box/simple/plusAssign.kt",
|
||||
"js/js.translator/testData/box/simple/positiveAndNegativeNumbers.kt",
|
||||
"js/js.translator/testData/box/simple/prefixIntOperations.kt",
|
||||
"js/js.translator/testData/box/simple/primCtorDelegation1.kt",
|
||||
"js/js.translator/testData/box/simple/propertiesAsParametersInitialized.kt",
|
||||
"js/js.translator/testData/box/simple/propertyAccess.kt",
|
||||
"js/js.translator/testData/box/simple/secCtorDelegation1.kt",
|
||||
"js/js.translator/testData/box/simple/secCtorDelegation2.kt",
|
||||
"js/js.translator/testData/box/simple/secCtorDelegation3.kt",
|
||||
"js/js.translator/testData/box/simple/secCtorDelegation4.kt",
|
||||
"js/js.translator/testData/box/simple/simpleInitializer.kt",
|
||||
"js/js.translator/testData/box/simple/while.kt",
|
||||
"js/js.translator/testData/box/simple/while2.kt",
|
||||
|
||||
"js/js.translator/testData/box/trait/funDelegation.kt"
|
||||
).map { File(it) }
|
||||
Reference in New Issue
Block a user