diff --git a/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiModuleHighlightingTest.kt b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiModuleHighlightingTest.kt index d41ae568127..83f84f17ddf 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiModuleHighlightingTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiModuleHighlightingTest.kt @@ -30,14 +30,10 @@ import com.intellij.psi.util.PsiModificationTracker import org.jetbrains.kotlin.analyzer.ModuleInfo import org.jetbrains.kotlin.analyzer.ResolverForModuleComputationTracker import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments -import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime -import org.jetbrains.kotlin.config.JvmTarget import org.jetbrains.kotlin.config.LanguageVersion -import org.jetbrains.kotlin.config.TargetPlatformKind import org.jetbrains.kotlin.idea.completion.test.withServiceRegistered import org.jetbrains.kotlin.idea.facet.KotlinFacetConfiguration import org.jetbrains.kotlin.idea.facet.KotlinFacetType -import org.jetbrains.kotlin.idea.framework.JSLibraryKind import org.jetbrains.kotlin.idea.project.KotlinCodeBlockModificationListener import org.jetbrains.kotlin.idea.project.KotlinModuleModificationTracker import org.jetbrains.kotlin.idea.test.PluginTestCaseBase @@ -227,68 +223,4 @@ open class MultiModuleHighlightingTest : AbstractMultiModuleHighlightingTest() { configuration.configure() } } - - // Some tests are ignored below. They fail because markers are not stripped correctly in multi-module highlighting tests. - // TODO: fix this in the test framework and unignore the tests - class MultiPlatform : AbstractMultiModuleHighlightingTest() { - override fun getTestDataPath() = "${PluginTestCaseBase.getTestDataPathBase()}/multiModuleHighlighting/multiplatform/" - - fun testBasic() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - - fun testHeaderClass() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - - fun testHeaderWithoutImplForBoth() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], TargetPlatformKind.JavaScript) - } - - fun ignore_testHeaderPartiallyImplemented() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - - fun testHeaderFunctionProperty() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - - fun testSuppressHeaderWithoutImpl() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - - fun testCatchHeaderExceptionInPlatformModule() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], withStdlibCommon = true) - } - - fun testWithOverrides() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - - fun testUseCorrectBuiltInsForCommonModule() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_8], TargetPlatformKind.JavaScript, - withStdlibCommon = true, jdk = FULL_JDK, configureModule = { module, platform -> - if (platform == TargetPlatformKind.JavaScript) { - module.addLibrary(ForTestCompileRuntime.stdlibJsForTests(), kind = JSLibraryKind) - module.addLibrary(ForTestCompileRuntime.stdlibCommonForTests()) - } - }) - } - - fun testHeaderClassImplTypealias() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - - fun testHeaderFunUsesStdlibInSignature() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], withStdlibCommon = true, configureModule = { module, platform -> - if (platform is TargetPlatformKind.Jvm) { - module.addLibrary(ForTestCompileRuntime.runtimeJarForTests()) - } - }) - } - - fun ignore_testNestedClassWithoutImpl() { - doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) - } - } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiPlatformHighlightingTest.kt b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiPlatformHighlightingTest.kt new file mode 100644 index 00000000000..fce4f3c0328 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/caches/resolve/MultiPlatformHighlightingTest.kt @@ -0,0 +1,88 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.caches.resolve + +import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime +import org.jetbrains.kotlin.config.JvmTarget +import org.jetbrains.kotlin.config.TargetPlatformKind +import org.jetbrains.kotlin.idea.framework.JSLibraryKind +import org.jetbrains.kotlin.idea.test.PluginTestCaseBase +import org.jetbrains.kotlin.test.TestJdkKind + +// Some tests are ignored below. They fail because markers are not stripped correctly in multi-module highlighting tests. +// TODO: fix this in the test framework and unignore the tests +class MultiPlatformHighlightingTest : AbstractMultiModuleHighlightingTest() { + override fun getTestDataPath() = "${PluginTestCaseBase.getTestDataPathBase()}/multiModuleHighlighting/multiplatform/" + + fun testBasic() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } + + fun testHeaderClass() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } + + fun testHeaderWithoutImplForBoth() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], TargetPlatformKind.JavaScript) + } + + fun ignore_testHeaderPartiallyImplemented() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } + + fun testHeaderFunctionProperty() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } + + fun testSuppressHeaderWithoutImpl() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } + + fun testCatchHeaderExceptionInPlatformModule() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], withStdlibCommon = true) + } + + fun testWithOverrides() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } + + fun testUseCorrectBuiltInsForCommonModule() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_8], TargetPlatformKind.JavaScript, + withStdlibCommon = true, jdk = TestJdkKind.FULL_JDK, configureModule = { module, platform -> + if (platform == TargetPlatformKind.JavaScript) { + module.addLibrary(ForTestCompileRuntime.stdlibJsForTests(), kind = JSLibraryKind) + module.addLibrary(ForTestCompileRuntime.stdlibCommonForTests()) + } + }) + } + + fun testHeaderClassImplTypealias() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } + + fun testHeaderFunUsesStdlibInSignature() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6], withStdlibCommon = true, configureModule = { module, platform -> + if (platform is TargetPlatformKind.Jvm) { + module.addLibrary(ForTestCompileRuntime.runtimeJarForTests()) + } + }) + } + + fun ignore_testNestedClassWithoutImpl() { + doMultiPlatformTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6]) + } +} \ No newline at end of file