Fixed KotlinLintTestGenerated.testJavaPerformance + refactoring
Moved android lint tests from uast-kotlin to idea-android
This commit is contained in:
@@ -156,7 +156,7 @@ import org.jetbrains.kotlin.serialization.AbstractLocalClassProtoTest
|
||||
import org.jetbrains.kotlin.shortenRefs.AbstractShortenRefsTest
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.types.AbstractTypeBindingTest
|
||||
import org.jetbrains.kotlin.uast.AbstractKotlinLintTest
|
||||
import org.jetbrains.kotlin.android.lint.AbstractKotlinLintTest
|
||||
import java.io.File
|
||||
import java.lang.IllegalArgumentException
|
||||
import java.util.*
|
||||
@@ -1109,12 +1109,6 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("plugins/uast-kotlin/test", "plugins/uast-kotlin/testData") {
|
||||
testClass<AbstractKotlinLintTest>() {
|
||||
model("lint", excludeParentDirs = true)
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("plugins/plugins-tests/tests", "plugins/annotation-collector/testData") {
|
||||
testClass<AbstractAnnotationProcessorBoxTest>() {
|
||||
model("collectToFile", recursive = false, extension = null)
|
||||
@@ -1165,6 +1159,10 @@ fun main(args: Array<String>) {
|
||||
testClass<AbstractAndroidQuickFixMultiFileTest>() {
|
||||
model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile")
|
||||
}
|
||||
|
||||
testClass<AbstractKotlinLintTest>() {
|
||||
model("android/lint", excludeParentDirs = true)
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("plugins/plugins-tests/tests", "plugins/android-extensions/android-extensions-jps/testData") {
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
<orderEntry type="module" module-name="frontend.java" />
|
||||
<orderEntry type="module" module-name="tests-common" scope="TEST" />
|
||||
<orderEntry type="module" module-name="idea-core" />
|
||||
<orderEntry type="module" module-name="lint-idea" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
+4
-2
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.uast
|
||||
package org.jetbrains.kotlin.android.lint
|
||||
|
||||
import org.jetbrains.android.inspections.klint.AndroidLintInspectionBase
|
||||
import org.jetbrains.kotlin.android.KotlinAndroidTestCase
|
||||
@@ -29,6 +29,8 @@ abstract class AbstractKotlinLintTest : KotlinAndroidTestCase() {
|
||||
super.setUp()
|
||||
ConfigLibraryUtil.configureKotlinRuntime(myModule)
|
||||
AndroidLintInspectionBase.invalidateInspectionShortName2IssueMap()
|
||||
// needs access to .class files in kotlin runtime jar
|
||||
myFixture.allowTreeAccessForAllFiles()
|
||||
}
|
||||
|
||||
override fun tearDown() {
|
||||
@@ -69,5 +71,5 @@ abstract class AbstractKotlinLintTest : KotlinAndroidTestCase() {
|
||||
myFixture.checkHighlighting(true, false, false)
|
||||
}
|
||||
|
||||
override fun getTestDataPath() = KotlinTestUtils.getHomeDirectory() + "/plugins/uast-kotlin/testData/lint/"
|
||||
override fun getTestDataPath() = KotlinTestUtils.getHomeDirectory() + "/idea/testData/android/lint/"
|
||||
}
|
||||
+27
-27
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.uast;
|
||||
package org.jetbrains.kotlin.android.lint;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
@@ -28,155 +28,155 @@ import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/uast-kotlin/testData/lint")
|
||||
@TestMetadata("idea/testData/android/lint")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class KotlinLintTestGenerated extends AbstractKotlinLintTest {
|
||||
@TestMetadata("alarm.kt")
|
||||
public void testAlarm() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/alarm.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/alarm.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInLint() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("plugins/uast-kotlin/testData/lint"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/android/lint"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("apiCheck.kt")
|
||||
public void testApiCheck() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/apiCheck.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/apiCheck.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("callSuper.kt")
|
||||
public void testCallSuper() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/callSuper.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/callSuper.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("commitFragment.kt")
|
||||
public void testCommitFragment() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/commitFragment.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/commitFragment.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("javaPerformance.kt")
|
||||
public void testJavaPerformance() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/javaPerformance.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/javaPerformance.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("javaScriptInterface.kt")
|
||||
public void testJavaScriptInterface() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/javaScriptInterface.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/javaScriptInterface.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("layoutInflation.kt")
|
||||
public void testLayoutInflation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/layoutInflation.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/layoutInflation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("log.kt")
|
||||
public void testLog() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/log.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/log.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("noInternationalSms.kt")
|
||||
public void testNoInternationalSms() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/noInternationalSms.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/noInternationalSms.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("overrideConcrete.kt")
|
||||
public void testOverrideConcrete() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/overrideConcrete.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/overrideConcrete.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("parcel.kt")
|
||||
public void testParcel() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/parcel.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/parcel.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sdCardTest.kt")
|
||||
public void testSdCardTest() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/sdCardTest.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/sdCardTest.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("setJavaScriptEnabled.kt")
|
||||
public void testSetJavaScriptEnabled() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/setJavaScriptEnabled.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/setJavaScriptEnabled.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sharedPrefs.kt")
|
||||
public void testSharedPrefs() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/sharedPrefs.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/sharedPrefs.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("showDiagnosticsWhenFileIsRed.kt")
|
||||
public void testShowDiagnosticsWhenFileIsRed() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/showDiagnosticsWhenFileIsRed.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/showDiagnosticsWhenFileIsRed.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("sqlite.kt")
|
||||
public void testSqlite() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/sqlite.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/sqlite.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("systemServices.kt")
|
||||
public void testSystemServices() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/systemServices.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/systemServices.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("toast.kt")
|
||||
public void testToast() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/toast.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/toast.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("valueOf.kt")
|
||||
public void testValueOf() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/valueOf.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/valueOf.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("viewConstructor.kt")
|
||||
public void testViewConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/viewConstructor.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/viewConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("viewHolder.kt")
|
||||
public void testViewHolder() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/viewHolder.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/viewHolder.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("wrongAnnotation.kt")
|
||||
public void testWrongAnnotation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/wrongAnnotation.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/wrongAnnotation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("wrongImport.kt")
|
||||
public void testWrongImport() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/wrongImport.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/wrongImport.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("wrongViewCall.kt")
|
||||
public void testWrongViewCall() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/uast-kotlin/testData/lint/wrongViewCall.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/android/lint/wrongViewCall.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
Vendored
plugins/uast-kotlin/testData/lint/javaPerformance.kt → idea/testData/android/lint/javaPerformance.kt
Vendored
+1
-1
@@ -2,8 +2,8 @@
|
||||
// INSPECTION_CLASS2: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintUseSparseArraysInspection
|
||||
// INSPECTION_CLASS3: org.jetbrains.android.inspections.klint.AndroidLintInspectionToolProvider$AndroidKLintUseValueOfInspection
|
||||
|
||||
import java.util.HashMap
|
||||
import android.annotation.SuppressLint
|
||||
import java.util.HashMap
|
||||
import android.content.Context
|
||||
import android.graphics.*
|
||||
import android.util.AttributeSet
|
||||
Vendored
Vendored
Vendored
Vendored
@@ -17,11 +17,7 @@
|
||||
<orderEntry type="module" module-name="idea-analysis" />
|
||||
<orderEntry type="module" module-name="backend" />
|
||||
<orderEntry type="module" module-name="frontend.java" />
|
||||
<orderEntry type="module" module-name="idea-test-framework" scope="TEST" />
|
||||
<orderEntry type="module" module-name="tests-common" scope="TEST" />
|
||||
<orderEntry type="module" module-name="android-extensions-idea" scope="TEST" />
|
||||
<orderEntry type="module" module-name="light-classes" />
|
||||
<orderEntry type="module" module-name="util.runtime" />
|
||||
<orderEntry type="module" module-name="lint-idea" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
Reference in New Issue
Block a user