Change policy with legacy compiler backend

[JS] Remove incremental js jps test

[JS] Remove test of maven js archetype

[JS] Fix another one test

[JS] Fix tests for jps

[JS] Try to fix maven test data

[JS] Fix test data

[JS] Fix test data for ant

[JS] Fix jsExtraHelp test

[JS] Fix test run from not-Gradle build tools

[JS] Set flag without compiler error

[JS] Disable warnings and errors in legacy compiler called from Gradle

[JS] Proofread messages

[JS] Not proofread messages

KT-42326
This commit is contained in:
Ilya Goncharov
2022-09-29 13:56:30 +00:00
committed by Space Team
parent a3ad0a6e88
commit c726360ad2
113 changed files with 498 additions and 745 deletions
@@ -32,10 +32,6 @@ fun main(args: Array<String>) {
)
}
testClass<AbstractIncrementalJsJpsTest> {
model("incremental/multiModule/common", extension = null, excludeParentDirs = true)
}
testClass<AbstractMultiplatformJpsTestWithGeneratedContent> {
model(
"incremental/multiModule/multiplatform/withGeneratedContent", extension = null, excludeParentDirs = true,
@@ -1,40 +0,0 @@
/*
* Copyright 2010-2018 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.jps.build
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
import org.jetbrains.kotlin.config.KotlinFacetSettings
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder
import org.jetbrains.kotlin.incremental.testingUtils.BuildLogFinder.Companion.JS_JPS_LOG
import org.jetbrains.kotlin.jps.model.JpsKotlinFacetModuleExtension
import org.jetbrains.kotlin.platform.js.JsPlatforms
import java.io.File
abstract class AbstractIncrementalJsJpsTest : AbstractIncrementalJpsTest() {
override val buildLogFinder: BuildLogFinder
get() = super.buildLogFinder.copy(isJsEnabled = true)
override fun doTest(testDataPath: String) {
val buildLogFile = File(testDataPath).resolve(JS_JPS_LOG)
if (!buildLogFile.exists()) {
buildLogFile.writeText("JPS JS LOG PLACEHOLDER")
}
super.doTest(testDataPath)
}
override fun overrideModuleSettings() {
myProject.modules.forEach {
val facet = KotlinFacetSettings()
facet.compilerArguments = K2JSCompilerArguments()
facet.targetPlatform = JsPlatforms.defaultJsPlatform
it.container.setChild(
JpsKotlinFacetModuleExtension.KIND,
JpsKotlinFacetModuleExtension(facet)
)
}
}
}
@@ -167,6 +167,7 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() {
libraries = libPaths.joinToString(File.pathSeparator)
reportOutputFiles = true
freeArgs = filesToCompile.map { it.canonicalPath }
useDeprecatedLegacyCompiler = true
}
configureAdditionalArgs(args)
return runJSCompiler(args, env)
@@ -1,463 +0,0 @@
/*
* Copyright 2010-2022 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.jps.build;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.util.KtTestUtil;
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.jps.GenerateJpsPluginTestsKt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class IncrementalJsJpsTestGenerated extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInCommon() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common"), Pattern.compile("^([^\\.]+)$"), null, true);
}
@TestMetadata("classAdded")
public void testClassAdded() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/classAdded/");
}
@TestMetadata("classRemoved")
public void testClassRemoved() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/classRemoved/");
}
@TestMetadata("constantValueChanged")
public void testConstantValueChanged() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/constantValueChanged/");
}
@TestMetadata("copyFileToAnotherModule")
public void testCopyFileToAnotherModule() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule/");
}
@TestMetadata("defaultArgumentInConstructorRemoved")
public void testDefaultArgumentInConstructorRemoved() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved/");
}
@TestMetadata("defaultParameterAdded")
public void testDefaultParameterAdded() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded/");
}
@TestMetadata("defaultParameterAddedForTopLevelFun")
public void testDefaultParameterAddedForTopLevelFun() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun/");
}
@TestMetadata("defaultParameterRemoved")
public void testDefaultParameterRemoved() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved/");
}
@TestMetadata("defaultParameterRemovedForTopLevelFun")
public void testDefaultParameterRemovedForTopLevelFun() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun/");
}
@TestMetadata("defaultValueInConstructorRemoved")
public void testDefaultValueInConstructorRemoved() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved/");
}
@TestMetadata("duplicatedClass")
public void testDuplicatedClass() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/duplicatedClass/");
}
@TestMetadata("exportedDependency")
public void testExportedDependency() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/exportedDependency/");
}
@TestMetadata("functionFromDifferentPackageChanged")
public void testFunctionFromDifferentPackageChanged() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged/");
}
@TestMetadata("inlineFunctionInlined")
public void testInlineFunctionInlined() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined/");
}
@TestMetadata("inlineFunctionTwoPackageParts")
public void testInlineFunctionTwoPackageParts() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts/");
}
@TestMetadata("moveFileToAnotherModule")
public void testMoveFileToAnotherModule() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule/");
}
@TestMetadata("simple")
public void testSimple() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/simple/");
}
@TestMetadata("simpleDependency")
public void testSimpleDependency() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependency/");
}
@TestMetadata("simpleDependencyErrorOnAccessToInternal1")
public void testSimpleDependencyErrorOnAccessToInternal1() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1/");
}
@TestMetadata("simpleDependencyErrorOnAccessToInternal2")
public void testSimpleDependencyErrorOnAccessToInternal2() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2/");
}
@TestMetadata("simpleDependencyUnchanged")
public void testSimpleDependencyUnchanged() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged/");
}
@TestMetadata("transitiveDependency")
public void testTransitiveDependency() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/transitiveDependency/");
}
@TestMetadata("transitiveInlining")
public void testTransitiveInlining() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/transitiveInlining/");
}
@TestMetadata("twoDependants")
public void testTwoDependants() throws Exception {
runTest("jps/jps-plugin/testData/incremental/multiModule/common/twoDependants/");
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/classAdded")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassAdded extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInClassAdded() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/classAdded"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/classRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ClassRemoved extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInClassRemoved() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/constantValueChanged")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ConstantValueChanged extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInConstantValueChanged() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/constantValueChanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class CopyFileToAnotherModule extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInCopyFileToAnotherModule() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultArgumentInConstructorRemoved extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultArgumentInConstructorRemoved() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterAdded extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterAdded() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterAddedForTopLevelFun extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterAddedForTopLevelFun() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterRemoved extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterRemoved() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultParameterRemovedForTopLevelFun extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultParameterRemovedForTopLevelFun() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DefaultValueInConstructorRemoved extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDefaultValueInConstructorRemoved() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/duplicatedClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class DuplicatedClass extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInDuplicatedClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/duplicatedClass"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/exportedDependency")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ExportedDependency extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInExportedDependency() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/exportedDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class FunctionFromDifferentPackageChanged extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInFunctionFromDifferentPackageChanged() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineFunctionInlined extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInInlineFunctionInlined() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class InlineFunctionTwoPackageParts extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInInlineFunctionTwoPackageParts() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class MoveFileToAnotherModule extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInMoveFileToAnotherModule() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simple")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Simple extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimple() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simple"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependency")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependency extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependency() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyErrorOnAccessToInternal1 extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal1() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyErrorOnAccessToInternal2 extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal2() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class SimpleDependencyUnchanged extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInSimpleDependencyUnchanged() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/transitiveDependency")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TransitiveDependency extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTransitiveDependency() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/transitiveDependency"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/transitiveInlining")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TransitiveInlining extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTransitiveInlining() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/transitiveInlining"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
@TestMetadata("jps/jps-plugin/testData/incremental/multiModule/common/twoDependants")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TwoDependants extends AbstractIncrementalJsJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTwoDependants() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps/jps-plugin/testData/incremental/multiModule/common/twoDependants"), Pattern.compile("^([^\\.]+)$"), null, true);
}
}
}
@@ -78,8 +78,6 @@ import java.util.zip.ZipOutputStream
open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
companion object {
private const val ADDITIONAL_MODULE_NAME = "module2"
private val EXCLUDE_FILES = arrayOf("Excluded.class", "YetAnotherExcluded.class")
private val NOTHING = arrayOf<String>()
private const val KOTLIN_JS_LIBRARY = "jslib-example"
@@ -119,13 +117,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
buildAllModules().assertSuccessful()
}
protected fun doTestWithKotlinJavaScriptLibrary() {
initProject(JS_STDLIB)
createKotlinJavaScriptLibraryArchive()
addDependency(KOTLIN_JS_LIBRARY, File(workDir, KOTLIN_JS_LIBRARY_JAR))
buildAllModules().assertSuccessful()
}
fun testKotlinProject() {
doTest()
@@ -150,14 +141,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
buildAllModules().assertSuccessful()
}
fun testKotlinJavaScriptProject() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
checkOutputFilesList()
checkWhen(touch("src/test1.kt"), null, pathsToDelete = k2jsOutput(PROJECT_NAME))
}
private fun k2jsOutput(vararg moduleNames: String): Array<String> {
val moduleNamesSet = moduleNames.toSet()
val list = mutableListOf<String>()
@@ -177,54 +160,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
return list.toTypedArray()
}
fun testKotlinJavaScriptProjectNewSourceRootTypes() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
checkOutputFilesList()
}
fun testKotlinJavaScriptProjectWithCustomOutputPaths() {
initProject(JS_STDLIB_WITHOUT_FACET)
buildAllModules().assertSuccessful()
checkOutputFilesList(File(workDir, "target"))
}
fun testKotlinJavaScriptProjectWithSourceMap() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
val sourceMapContent = File(getOutputDir(PROJECT_NAME), "$PROJECT_NAME.js.map").readText()
val expectedPath = "prefix-dir/src/pkg/test1.kt"
assertTrue("Source map file should contain relative path ($expectedPath)", sourceMapContent.contains("\"$expectedPath\""))
val librarySourceMapFile = File(getOutputDir(PROJECT_NAME), "lib/kotlin.js.map")
assertTrue("Source map for stdlib should be copied to $librarySourceMapFile", librarySourceMapFile.exists())
}
fun testKotlinJavaScriptProjectWithSourceMapRelativePaths() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
val sourceMapContent = File(getOutputDir(PROJECT_NAME), "$PROJECT_NAME.js.map").readText()
val expectedPath = "../../../src/pkg/test1.kt"
assertTrue("Source map file should contain relative path ($expectedPath)", sourceMapContent.contains("\"$expectedPath\""))
val librarySourceMapFile = File(getOutputDir(PROJECT_NAME), "lib/kotlin.js.map")
assertTrue("Source map for stdlib should be copied to $librarySourceMapFile", librarySourceMapFile.exists())
}
fun testKotlinJavaScriptProjectWithTwoModules() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
checkOutputFilesList()
checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME))
checkWhen(touch("module2/src/module2.kt"), null, k2jsOutput(ADDITIONAL_MODULE_NAME))
checkWhen(arrayOf(touch("src/test1.kt"), touch("module2/src/module2.kt")), null, k2jsOutput(PROJECT_NAME, ADDITIONAL_MODULE_NAME))
}
@WorkingDir("KotlinJavaScriptProjectWithTwoModules")
fun testKotlinJavaScriptProjectWithTwoModulesAndWithLibrary() {
initProject()
@@ -234,84 +169,6 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
buildAllModules().assertSuccessful()
}
fun testKotlinJavaScriptProjectWithDirectoryAsStdlib() {
initProject()
setupKotlinJSFacet()
val jslibJar = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibJarPath
val jslibDir = File(workDir, "KotlinJavaScript")
try {
Decompressor.Zip(jslibJar).extract(jslibDir)
}
catch (ex: IOException) {
throw IllegalStateException(ex.message)
}
addDependency("KotlinJavaScript", jslibDir)
buildAllModules().assertSuccessful()
checkOutputFilesList()
checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME))
}
fun testKotlinJavaScriptProjectWithDirectoryAsLibrary() {
initProject(JS_STDLIB)
addDependency(KOTLIN_JS_LIBRARY, File(workDir, KOTLIN_JS_LIBRARY))
buildAllModules().assertSuccessful()
checkOutputFilesList()
checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME))
}
fun testKotlinJavaScriptProjectWithLibrary() {
doTestWithKotlinJavaScriptLibrary()
checkOutputFilesList()
checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME))
}
fun testKotlinJavaScriptProjectWithLibraryCustomOutputDir() {
doTestWithKotlinJavaScriptLibrary()
checkOutputFilesList()
checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME))
}
fun testKotlinJavaScriptProjectWithLibraryNoCopy() {
doTestWithKotlinJavaScriptLibrary()
checkOutputFilesList()
checkWhen(touch("src/test1.kt"), null, k2jsOutput(PROJECT_NAME))
}
fun testKotlinJavaScriptProjectWithLibraryAndErrors() {
initProject(JS_STDLIB)
createKotlinJavaScriptLibraryArchive()
addDependency(KOTLIN_JS_LIBRARY, File(workDir, KOTLIN_JS_LIBRARY_JAR))
buildAllModules().assertFailed()
checkOutputFilesList()
}
fun testKotlinJavaScriptProjectWithEmptyDependencies() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
}
fun testKotlinJavaScriptInternalFromSpecialRelatedModule() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
}
fun testKotlinJavaScriptProjectWithTests() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
}
fun testKotlinJavaScriptProjectWithTestsAndSeparateTestAndSrcModuleDependencies() {
initProject(JS_STDLIB)
buildAllModules().assertSuccessful()
}
fun testExcludeFolderInSourceRoot() {
doTest()
@@ -89,7 +89,9 @@ abstract class KotlinJpsBuildTestBase : AbstractKotlinJpsBuildTestCase() {
protected fun setupKotlinJSFacet() {
myProject.modules.forEach {
val facet = KotlinFacetSettings()
facet.compilerArguments = K2JSCompilerArguments()
facet.compilerArguments = K2JSCompilerArguments().apply {
useDeprecatedLegacyCompiler = true
}
facet.targetPlatform = JsPlatforms.defaultJsPlatform
it.container.setChild(
@@ -43,17 +43,6 @@ class KotlinJpsBuildTestIncremental : KotlinJpsBuildTest() {
).run()
}
fun testKotlinJavaScriptChangePackage() {
initProject(LibraryDependency.JS_STDLIB)
buildAllModules().assertSuccessful()
val class2Kt = File(workDir, "src/Class2.kt")
val newClass2KtContent = class2Kt.readText().replace("package2", "package1")
change(class2Kt.path, newClass2KtContent)
buildAllModules().assertSuccessful()
checkOutputFilesList(File(workDir, "out/production"))
}
fun testJpsDaemonIC() {
fun testImpl() {
assertTrue("Daemon was not enabled!", isDaemonEnabled())
@@ -262,7 +262,10 @@ class ModulesTxtBuilder {
"jvm" -> settings.compilerArguments =
K2JVMCompilerArguments().also { settings.targetPlatform = JvmPlatforms.defaultJvmPlatform }
"js" -> settings.compilerArguments =
K2JSCompilerArguments().also { settings.targetPlatform = JsPlatforms.defaultJsPlatform }
K2JSCompilerArguments().also {
settings.targetPlatform = JsPlatforms.defaultJsPlatform
it.useDeprecatedLegacyCompiler = true
}
"native" -> settings.compilerArguments =
FakeK2NativeCompilerArguments().also { settings.targetPlatform = NativePlatforms.unspecifiedNativePlatform }
else -> {
@@ -50,6 +50,7 @@ abstract class AbstractJsProtoComparisonTest : AbstractProtoComparisonTest<Proto
metaInfo = true
main = K2JsArgumentConstants.NO_CALL
freeArgs = ktFiles
useDeprecatedLegacyCompiler = true
}
val env = createTestingCompilerEnvironment(messageCollector, outputItemsCollector, services)