[TEST] Drop machinery about experimental coroutines from compiler tests
This commit is contained in:
committed by
TeamCityServer
parent
8c4b7ad1e1
commit
aacf934b49
+1
-1
@@ -116,7 +116,7 @@ abstract class AbstractFirTypeEnhancementTest : KtUsefulTestCase() {
|
||||
|
||||
return targetFile
|
||||
}
|
||||
}, ""
|
||||
}
|
||||
)
|
||||
environment = createEnvironment(content)
|
||||
val virtualFiles = srcFiles.map {
|
||||
|
||||
+5
-20
@@ -17,7 +17,6 @@ import org.jetbrains.kotlin.TestsCompilerError
|
||||
import org.jetbrains.kotlin.analyzer.AnalysisResult
|
||||
import org.jetbrains.kotlin.analyzer.common.CommonResolverForModuleFactory
|
||||
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
|
||||
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
|
||||
import org.jetbrains.kotlin.cli.common.messages.GroupingMessageCollector
|
||||
@@ -127,15 +126,7 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
|
||||
|
||||
val oldModule = modules[testModule]!!
|
||||
|
||||
val languageVersionSettings =
|
||||
if (coroutinesPackage.isNotEmpty()) {
|
||||
val isExperimental = coroutinesPackage == StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString()
|
||||
CompilerTestLanguageVersionSettings(
|
||||
DEFAULT_DIAGNOSTIC_TESTS_FEATURES,
|
||||
if (isExperimental) ApiVersion.KOTLIN_1_2 else ApiVersion.KOTLIN_1_3,
|
||||
if (isExperimental) LanguageVersion.KOTLIN_1_2 else LanguageVersion.KOTLIN_1_3
|
||||
)
|
||||
} else loadLanguageVersionSettings(testFilesInModule)
|
||||
val languageVersionSettings = loadLanguageVersionSettings(testFilesInModule)
|
||||
|
||||
languageVersionSettingsByModule[testModule] = languageVersionSettings
|
||||
|
||||
@@ -180,7 +171,7 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
|
||||
var exceptionFromDescriptorValidation: Throwable? = null
|
||||
try {
|
||||
val expectedFile = getExpectedDescriptorFile(testDataFile, files)
|
||||
validateAndCompareDescriptorWithFile(expectedFile, files, modules, coroutinesPackage)
|
||||
validateAndCompareDescriptorWithFile(expectedFile, files, modules)
|
||||
} catch (e: Throwable) {
|
||||
exceptionFromDescriptorValidation = e
|
||||
}
|
||||
@@ -262,9 +253,7 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
|
||||
}
|
||||
|
||||
protected open fun checkDiagnostics(actualText: String, testDataFile: File) {
|
||||
KotlinTestUtils.assertEqualsToFile(getExpectedDiagnosticsFile(testDataFile), actualText) { s ->
|
||||
s.replace("COROUTINES_PACKAGE", coroutinesPackage)
|
||||
}
|
||||
KotlinTestUtils.assertEqualsToFile(getExpectedDiagnosticsFile(testDataFile), actualText)
|
||||
}
|
||||
|
||||
private fun checkFirTestdata(testDataFile: File, files: List<TestFile>) {
|
||||
@@ -289,7 +278,6 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
|
||||
val testRunner = object : AbstractFirOldFrontendDiagnosticsTest() {
|
||||
init {
|
||||
environment = this@AbstractDiagnosticsTest.environment
|
||||
coroutinesPackage = this@AbstractDiagnosticsTest.coroutinesPackage
|
||||
}
|
||||
}
|
||||
if (testDataFile.readText().contains("// FIR_IDENTICAL")) {
|
||||
@@ -529,8 +517,7 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
|
||||
private fun validateAndCompareDescriptorWithFile(
|
||||
expectedFile: File,
|
||||
testFiles: List<TestFile>,
|
||||
modules: Map<TestModule?, ModuleDescriptorImpl>,
|
||||
coroutinesPackage: String
|
||||
modules: Map<TestModule?, ModuleDescriptorImpl>
|
||||
) {
|
||||
if (skipDescriptorsValidation()) return
|
||||
if (testFiles.any { file -> InTextDirectivesUtils.isDirectiveDefined(file.expectedText, "// SKIP_TXT") }) {
|
||||
@@ -591,9 +578,7 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
|
||||
"Such tests are hard to maintain, take long time to execute and are subject to sudden unreviewed changes anyway."
|
||||
}
|
||||
|
||||
KotlinTestUtils.assertEqualsToFile(expectedFile, allPackagesText) { s ->
|
||||
s.replace("COROUTINES_PACKAGE", coroutinesPackage)
|
||||
}
|
||||
KotlinTestUtils.assertEqualsToFile(expectedFile, allPackagesText)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -16,6 +16,6 @@ abstract class AbstractDiagnosticsTestWithStdLib : AbstractDiagnosticsTest() {
|
||||
|
||||
override fun shouldValidateFirTestData(testDataFile: File): Boolean {
|
||||
val path = testDataFile.absolutePath
|
||||
return !path.endsWith(".kts") && coroutinesPackage != StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString()
|
||||
return !path.endsWith(".kts")
|
||||
}
|
||||
}
|
||||
|
||||
+1
-6
@@ -88,11 +88,6 @@ abstract class KotlinMultiFileTestWithJava<M : KotlinBaseTest.TestModule, F : Ko
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(fileText, "STDLIB_JDK8")) {
|
||||
result.add(ForTestCompileRuntime.runtimeJarForTestsWithJdk8())
|
||||
}
|
||||
if (StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString() == coroutinesPackage ||
|
||||
fileText.contains(StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString())
|
||||
) {
|
||||
result.add(ForTestCompileRuntime.coroutinesCompatForTests())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -152,7 +147,7 @@ abstract class KotlinMultiFileTestWithJava<M : KotlinBaseTest.TestModule, F : Ko
|
||||
KotlinTestUtils.mkdirs(tmpFile.parentFile)
|
||||
tmpFile.writeText(content, Charsets.UTF_8)
|
||||
}
|
||||
}, coroutinesPackage)
|
||||
})
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
+2
-6
@@ -68,11 +68,7 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
|
||||
private void doBytecodeListingTest(@NotNull File wholeFile) throws Exception {
|
||||
if (!InTextDirectivesUtils.isDirectiveDefined(FileUtil.loadFile(wholeFile), "CHECK_BYTECODE_LISTING")) return;
|
||||
|
||||
String suffix =
|
||||
(coroutinesPackage.equals(StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString()) || coroutinesPackage.isEmpty())
|
||||
&& InTextDirectivesUtils.isDirectiveDefined(FileUtil.loadFile(wholeFile), "COMMON_COROUTINES_TEST")
|
||||
? "_1_2" :
|
||||
getBackend().isIR() ? "_ir" : "";
|
||||
String suffix = getBackend().isIR() ? "_ir" : "";
|
||||
File expectedFile = new File(wholeFile.getParent(), FilesKt.getNameWithoutExtension(wholeFile) + suffix + ".txt");
|
||||
|
||||
String text =
|
||||
@@ -101,7 +97,7 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
|
||||
}
|
||||
);
|
||||
|
||||
assertEqualsToFile(expectedFile, text, s -> s.replace("COROUTINES_PACKAGE", coroutinesPackage));
|
||||
assertEqualsToFile(expectedFile, text);
|
||||
}
|
||||
|
||||
protected void blackBox(boolean reportProblems, boolean unexpectedBehaviour) {
|
||||
|
||||
+1
-2
@@ -31,8 +31,7 @@ abstract class AbstractBytecodeListingTest : CodegenTestCase() {
|
||||
)
|
||||
|
||||
val prefixes = when {
|
||||
backend.isIR -> listOf("_ir", "_1_3", "")
|
||||
coroutinesPackage == StandardNames.COROUTINES_PACKAGE_FQ_NAME_RELEASE.asString() -> listOf("_1_3", "")
|
||||
backend.isIR -> listOf("_ir", "")
|
||||
else -> listOf("")
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -19,9 +19,7 @@ abstract class AbstractDumpDeclarationsTest : CodegenTestCase() {
|
||||
dumpToFile = KotlinTestUtils.tmpDirForTest(this).resolve("$name.json")
|
||||
compile(files)
|
||||
classFileFactory.generationState.destroy()
|
||||
KotlinTestUtils.assertEqualsToFile(expectedResult, dumpToFile.readText()) {
|
||||
it.replace("COROUTINES_PACKAGE", coroutinesPackage)
|
||||
}
|
||||
KotlinTestUtils.assertEqualsToFile(expectedResult, dumpToFile.readText())
|
||||
}
|
||||
|
||||
override fun updateConfiguration(configuration: CompilerConfiguration) {
|
||||
|
||||
@@ -607,32 +607,21 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
|
||||
File file = new File(filePath);
|
||||
|
||||
String expectedText = KotlinTestUtils.doLoadFile(file);
|
||||
if (!coroutinesPackage.isEmpty()) {
|
||||
expectedText = expectedText.replace("COROUTINES_PACKAGE", coroutinesPackage);
|
||||
}
|
||||
|
||||
List<TestFile> testFiles = createTestFilesFromFile(file, expectedText);
|
||||
|
||||
doMultiFileTest(file, testFiles);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doTestWithCoroutinesPackageReplacement(@NotNull String filePath, @NotNull String packageName) throws Exception {
|
||||
this.coroutinesPackage = packageName;
|
||||
doTest(filePath);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected List<TestFile> createTestFilesFromFile(@NotNull File file, @NotNull String expectedText) {
|
||||
return createTestFilesFromFile(file, expectedText, coroutinesPackage, parseDirectivesPerFiles(), getBackend());
|
||||
return createTestFilesFromFile(file, expectedText, parseDirectivesPerFiles(), getBackend());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static List<TestFile> createTestFilesFromFile(
|
||||
@NotNull File file,
|
||||
@NotNull String expectedText,
|
||||
@NotNull String coroutinesPackage,
|
||||
boolean parseDirectivesPerFiles,
|
||||
@NotNull TargetBackend backend
|
||||
) {
|
||||
@@ -643,7 +632,7 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
|
||||
public TestFile create(@NotNull String fileName, @NotNull String text, @NotNull Directives directives) {
|
||||
return new TestFile(fileName, text, directives);
|
||||
}
|
||||
}, false, coroutinesPackage, parseDirectivesPerFiles);
|
||||
}, false, parseDirectivesPerFiles);
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(expectedText, "WITH_HELPERS")) {
|
||||
testFiles.add(new TestFile("CodegenTestHelpers.kt", TestHelperGeneratorKt.createTextForCodegenTestHelpers(backend)));
|
||||
}
|
||||
|
||||
@@ -64,7 +64,6 @@ import java.io.File
|
||||
abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() {
|
||||
companion object {
|
||||
const val DUMP_CFG_DIRECTIVE = "DUMP_CFG"
|
||||
const val COMMON_COROUTINES_DIRECTIVE = "COMMON_COROUTINES_TEST"
|
||||
|
||||
private val allowedKindsForDebugInfo = setOf(
|
||||
FirRealSourceElementKind,
|
||||
@@ -74,9 +73,6 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() {
|
||||
val TestFile.withDumpCfgDirective: Boolean
|
||||
get() = DUMP_CFG_DIRECTIVE in directives
|
||||
|
||||
val TestFile.withCommonCoroutinesDirective: Boolean
|
||||
get() = COMMON_COROUTINES_DIRECTIVE in directives
|
||||
|
||||
val File.cfgDumpFile: File
|
||||
get() = File(absolutePath.replace(".kt", ".dot"))
|
||||
}
|
||||
@@ -136,10 +132,7 @@ abstract class AbstractFirDiagnosticsTest : AbstractFirBaseDiagnosticsTest() {
|
||||
actualTextBuilder.append(testFile.expectedText)
|
||||
}
|
||||
}
|
||||
var actualText = actualTextBuilder.toString()
|
||||
if (testFiles.any { it.withCommonCoroutinesDirective }) {
|
||||
actualText = actualText.replace(coroutinesPackage, "COROUTINES_PACKAGE")
|
||||
}
|
||||
val actualText = actualTextBuilder.toString()
|
||||
KotlinTestUtils.assertEqualsToFile(file, actualText)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -295,7 +295,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
||||
}
|
||||
return targetFile;
|
||||
}
|
||||
}, "");
|
||||
});
|
||||
|
||||
Pair<PackageViewDescriptor, BindingContext> javaPackageAndContext = compileJavaAndLoadTestPackageAndBindingContextFromBinary(
|
||||
srcFiles, compiledDir, ConfigurationKind.ALL
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public abstract class ExtensibleResolveTestCase extends KotlinTestWithEnvironmen
|
||||
public KtFile create(@NotNull String fileName, @NotNull String text, @NotNull Directives directives) {
|
||||
return expectedResolveData.createFileFromMarkedUpText(fileName, text);
|
||||
}
|
||||
}, "");
|
||||
});
|
||||
expectedResolveData.checkResult(ExpectedResolveData.analyze(files, getEnvironment()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,29 +24,15 @@ import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
|
||||
abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase() {
|
||||
|
||||
@JvmField
|
||||
protected var coroutinesPackage: String = ""
|
||||
|
||||
@Throws(Exception::class)
|
||||
override fun setUp() {
|
||||
coroutinesPackage = ""
|
||||
super.setUp()
|
||||
}
|
||||
|
||||
@Throws(java.lang.Exception::class)
|
||||
protected open fun doTestWithCoroutinesPackageReplacement(filePath: String, coroutinesPackage: String) {
|
||||
this.coroutinesPackage = coroutinesPackage
|
||||
doTest(filePath)
|
||||
}
|
||||
|
||||
@Throws(java.lang.Exception::class)
|
||||
protected open fun doTest(filePath: String) {
|
||||
val file = File(filePath)
|
||||
var expectedText = KotlinTestUtils.doLoadFile(file)
|
||||
if (coroutinesPackage.isNotEmpty()) {
|
||||
expectedText = expectedText.replace("COROUTINES_PACKAGE", coroutinesPackage)
|
||||
}
|
||||
val expectedText = KotlinTestUtils.doLoadFile(file)
|
||||
doMultiFileTest(file, createTestFilesFromFile(file, expectedText))
|
||||
}
|
||||
|
||||
@@ -98,7 +84,6 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
|
||||
updateConfigurationByDirectivesInTestFiles(
|
||||
testFilesWithConfigurationDirectives,
|
||||
configuration,
|
||||
coroutinesPackage,
|
||||
parseDirectivesPerFiles()
|
||||
)
|
||||
updateConfiguration(configuration)
|
||||
@@ -203,18 +188,16 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
|
||||
testFilesWithConfigurationDirectives: List<TestFile>,
|
||||
configuration: CompilerConfiguration
|
||||
) {
|
||||
updateConfigurationByDirectivesInTestFiles(testFilesWithConfigurationDirectives, configuration, "", false)
|
||||
updateConfigurationByDirectivesInTestFiles(testFilesWithConfigurationDirectives, configuration, false)
|
||||
}
|
||||
|
||||
|
||||
private fun updateConfigurationByDirectivesInTestFiles(
|
||||
testFilesWithConfigurationDirectives: List<TestFile>,
|
||||
configuration: CompilerConfiguration,
|
||||
coroutinesPackage: String,
|
||||
usePreparsedDirectives: Boolean
|
||||
) {
|
||||
var explicitLanguageVersionSettings: LanguageVersionSettings? = null
|
||||
var disableReleaseCoroutines = false
|
||||
var includeCompatExperimentalCoroutines = false
|
||||
val kotlinConfigurationFlags: MutableList<String> = ArrayList(0)
|
||||
for (testFile in testFilesWithConfigurationDirectives) {
|
||||
@@ -247,13 +230,6 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
if (directives.contains("COMMON_COROUTINES_TEST")) {
|
||||
assert(!directives.contains("COROUTINES_PACKAGE")) { "Must replace COROUTINES_PACKAGE prior to tests compilation" }
|
||||
if (StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString() == coroutinesPackage) {
|
||||
disableReleaseCoroutines = true
|
||||
includeCompatExperimentalCoroutines = true
|
||||
}
|
||||
}
|
||||
if (content.contains(StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString())) {
|
||||
includeCompatExperimentalCoroutines = true
|
||||
}
|
||||
@@ -263,13 +239,6 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
|
||||
explicitLanguageVersionSettings = fileLanguageVersionSettings
|
||||
}
|
||||
}
|
||||
if (disableReleaseCoroutines) {
|
||||
explicitLanguageVersionSettings = CompilerTestLanguageVersionSettings(
|
||||
Collections.singletonMap(LanguageFeature.ReleaseCoroutines, LanguageFeature.State.DISABLED),
|
||||
ApiVersion.LATEST_STABLE,
|
||||
LanguageVersion.LATEST_STABLE, emptyMap()
|
||||
)
|
||||
}
|
||||
if (includeCompatExperimentalCoroutines) {
|
||||
configuration.addJvmClasspathRoot(ForTestCompileRuntime.coroutinesCompatForTests())
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ public class KotlinTestUtils {
|
||||
int firstLineEnd = text.indexOf('\n');
|
||||
return StringUtil.trimTrailing(text.substring(firstLineEnd + 1));
|
||||
}
|
||||
}, "");
|
||||
});
|
||||
|
||||
Assert.assertTrue("Exactly two files expected: ", files.size() == 2);
|
||||
|
||||
|
||||
@@ -41,23 +41,18 @@ public class TestFiles {
|
||||
|
||||
@NotNull
|
||||
public static <M extends KotlinBaseTest.TestModule, F> List<F> createTestFiles(@Nullable String testFileName, String expectedText, TestFileFactory<M, F> factory) {
|
||||
return createTestFiles(testFileName, expectedText, factory, false, "");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <M extends KotlinBaseTest.TestModule, F> List<F> createTestFiles(@Nullable String testFileName, String expectedText, TestFileFactory<M, F> factory, String coroutinesPackage) {
|
||||
return createTestFiles(testFileName, expectedText, factory, false, coroutinesPackage);
|
||||
return createTestFiles(testFileName, expectedText, factory, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <M extends KotlinBaseTest.TestModule, F> List<F> createTestFiles(String testFileName, String expectedText, TestFileFactory<M , F> factory,
|
||||
boolean preserveLocations, String coroutinesPackage) {
|
||||
return createTestFiles(testFileName, expectedText, factory, preserveLocations, coroutinesPackage, false);
|
||||
boolean preserveLocations) {
|
||||
return createTestFiles(testFileName, expectedText, factory, preserveLocations, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static <M extends KotlinBaseTest.TestModule, F> List<F> createTestFiles(String testFileName, String expectedText, TestFileFactory<M , F> factory,
|
||||
boolean preserveLocations, String coroutinesPackage, boolean parseDirectivesPerFile) {
|
||||
boolean preserveLocations, boolean parseDirectivesPerFile) {
|
||||
Map<String, M> modules = new HashMap<>();
|
||||
List<F> testFiles = Lists.newArrayList();
|
||||
Matcher matcher = FILE_OR_MODULE_PATTERN.matcher(expectedText);
|
||||
@@ -127,9 +122,7 @@ public class TestFiles {
|
||||
assert oldValue == null : "Module with name " + supportModule.name + " already present in file";
|
||||
}
|
||||
|
||||
boolean isReleaseCoroutines =
|
||||
!coroutinesPackage.contains("experimental") &&
|
||||
!isDirectiveDefined(expectedText, "!LANGUAGE: -ReleaseCoroutines");
|
||||
boolean isReleaseCoroutines = !isDirectiveDefined(expectedText, "!LANGUAGE: -ReleaseCoroutines");
|
||||
|
||||
boolean checkStateMachine = isDirectiveDefined(expectedText, "CHECK_STATE_MACHINE");
|
||||
boolean checkTailCallOptimization = isDirectiveDefined(expectedText, "CHECK_TAIL_CALL_OPTIMIZATION");
|
||||
|
||||
+1
-2
@@ -122,8 +122,7 @@ abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
|
||||
targetFile.writeText(adaptJavaSource(text))
|
||||
return targetFile
|
||||
}
|
||||
},
|
||||
""
|
||||
}
|
||||
)
|
||||
LoadDescriptorUtil.compileJavaWithAnnotationsJar(sources, tmpdir, emptyList(), null)
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ abstract class AbstractQuickFixMultiFileTest : KotlinLightCodeInsightFixtureTest
|
||||
}
|
||||
return TestFile(fileName, linesWithoutDirectives.joinToString(separator = "\n"))
|
||||
}
|
||||
}, ""
|
||||
}
|
||||
)
|
||||
|
||||
val afterFile = subFiles.firstOrNull { file -> file.path.contains(".after") }
|
||||
|
||||
@@ -44,7 +44,7 @@ abstract class AbstractJsLineNumberTest : KotlinTestWithEnvironment() {
|
||||
val sourceCode = file.readText()
|
||||
|
||||
TestFileFactoryImpl().use { testFactory ->
|
||||
val inputFiles = TestFiles.createTestFiles(file.name, sourceCode, testFactory, true, "")
|
||||
val inputFiles = TestFiles.createTestFiles(file.name, sourceCode, testFactory, true)
|
||||
val modules = inputFiles
|
||||
.map { it.module }.distinct()
|
||||
.associateBy { it.name }
|
||||
@@ -175,4 +175,4 @@ abstract class AbstractJsLineNumberTest : KotlinTestWithEnvironment() {
|
||||
private val BASE_PATH = "${BasicBoxTest.TEST_DATA_DIR_PATH}/$DIR_NAME"
|
||||
private val OUT_PATH = "${BasicBoxTest.TEST_DATA_DIR_PATH}/out/$DIR_NAME"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,8 +141,7 @@ abstract class BasicBoxTest(
|
||||
file.name,
|
||||
fileContent,
|
||||
testFactory,
|
||||
true,
|
||||
coroutinesPackage
|
||||
true
|
||||
)
|
||||
val modules = inputFiles
|
||||
.map { it.module }.distinct()
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
package org.jetbrains.kotlin.js.test
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.openapi.vfs.StandardFileSystems
|
||||
import com.intellij.openapi.vfs.VirtualFileManager
|
||||
import com.intellij.psi.PsiManager
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.backend.common.phaser.PhaseConfig
|
||||
import org.jetbrains.kotlin.backend.common.phaser.toPhaseMap
|
||||
import org.jetbrains.kotlin.backend.wasm.compileWasm
|
||||
@@ -28,10 +24,8 @@ import org.jetbrains.kotlin.js.test.engines.SpiderMonkeyEngine
|
||||
import org.jetbrains.kotlin.library.resolver.impl.KotlinLibraryResolverResultImpl
|
||||
import org.jetbrains.kotlin.library.resolver.impl.KotlinResolvedLibraryImpl
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.KtNamedFunction
|
||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
import org.jetbrains.kotlin.test.Directives
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.KotlinTestWithEnvironment
|
||||
@@ -63,7 +57,7 @@ abstract class BasicWasmBoxTest(
|
||||
val fileContent = KotlinTestUtils.doLoadFile(file)
|
||||
|
||||
TestFileFactoryImpl().use { testFactory ->
|
||||
val inputFiles: MutableList<TestFile> = TestFiles.createTestFiles(file.name, fileContent, testFactory, true, "")
|
||||
val inputFiles: MutableList<TestFile> = TestFiles.createTestFiles(file.name, fileContent, testFactory, true)
|
||||
val testPackage = testFactory.testPackage
|
||||
val outputFileBase = outputDir.absolutePath + "/" + getTestName(true)
|
||||
val outputWatFile = outputFileBase + ".wat"
|
||||
|
||||
Reference in New Issue
Block a user