Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
23e704f3
K
kotlin
项目概览
硅谷海盗
/
kotlin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
23e704f3
编写于
12月 09, 2020
作者:
D
Dmitriy Novozhilov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TEST] Migrate AbstractDiagnosticsWithExplicitApi to new test runners
上级
c0e4452c
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
373 addition
and
104 deletion
+373
-104
compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt
...ns/kotlin/test/builders/LanguageVersionSettingsBuilder.kt
+1
-0
compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/LanguageSettingsDirectives.kt
...ains/kotlin/test/directives/LanguageSettingsDirectives.kt
+7
-1
compiler/testData/diagnostics/tests/testsWithExplicitApi/annotations.fir.kt
...diagnostics/tests/testsWithExplicitApi/annotations.fir.kt
+47
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/annotations.kt
...ata/diagnostics/tests/testsWithExplicitApi/annotations.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/classes.fir.kt
...ata/diagnostics/tests/testsWithExplicitApi/classes.fir.kt
+47
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/classes.kt
...estData/diagnostics/tests/testsWithExplicitApi/classes.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/companionObject.fir.kt
...nostics/tests/testsWithExplicitApi/companionObject.fir.kt
+20
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/companionObject.kt
...diagnostics/tests/testsWithExplicitApi/companionObject.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/constructors.fir.kt
...iagnostics/tests/testsWithExplicitApi/constructors.fir.kt
+17
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/constructors.kt
...ta/diagnostics/tests/testsWithExplicitApi/constructors.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/inlineClasses.fir.kt
...agnostics/tests/testsWithExplicitApi/inlineClasses.fir.kt
+7
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/inlineClasses.kt
...a/diagnostics/tests/testsWithExplicitApi/inlineClasses.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/interfaces.fir.kt
.../diagnostics/tests/testsWithExplicitApi/interfaces.fir.kt
+35
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/interfaces.kt
...Data/diagnostics/tests/testsWithExplicitApi/interfaces.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/mustBeEffectivelyPublic.kt
...ics/tests/testsWithExplicitApi/mustBeEffectivelyPublic.kt
+1
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/properties.fir.kt
.../diagnostics/tests/testsWithExplicitApi/properties.fir.kt
+23
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/properties.kt
...Data/diagnostics/tests/testsWithExplicitApi/properties.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/publishedApi.fir.kt
...iagnostics/tests/testsWithExplicitApi/publishedApi.fir.kt
+7
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/publishedApi.kt
...ta/diagnostics/tests/testsWithExplicitApi/publishedApi.kt
+0
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/toplevel.fir.kt
...ta/diagnostics/tests/testsWithExplicitApi/toplevel.fir.kt
+12
-0
compiler/testData/diagnostics/tests/testsWithExplicitApi/toplevel.kt
...stData/diagnostics/tests/testsWithExplicitApi/toplevel.kt
+0
-0
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java
...etbrains/kotlin/test/runners/DiagnosticTestGenerated.java
+70
-0
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java
.../test/runners/FirOldFrontendDiagnosticsTestGenerated.java
+70
-0
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractDiagnosticTest.kt
...g/jetbrains/kotlin/test/runners/AbstractDiagnosticTest.kt
+9
-0
compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractDiagnosticsWithExplicitApi.kt
...ins/kotlin/checkers/AbstractDiagnosticsWithExplicitApi.kt
+0
-19
compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsWithExplicitApiGenerated.java
.../kotlin/checkers/DiagnosticsWithExplicitApiGenerated.java
+0
-80
compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt
...etbrains/kotlin/generators/tests/GenerateCompilerTests.kt
+0
-4
未找到文件。
compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt
浏览文件 @
23e704f3
...
...
@@ -64,6 +64,7 @@ class LanguageVersionSettingsBuilder {
analysisFlag
(
AnalysisFlags
.
ignoreDataFlowInAssert
,
trueOrNull
(
LanguageSettingsDirectives
.
IGNORE_DATA_FLOW_IN_ASSERT
in
directives
)),
analysisFlag
(
AnalysisFlags
.
constraintSystemForOverloadResolution
,
directives
.
singleOrZeroValue
(
LanguageSettingsDirectives
.
CONSTRAINT_SYSTEM_FOR_OVERLOAD_RESOLUTION
)),
analysisFlag
(
AnalysisFlags
.
allowResultReturnType
,
trueOrNull
(
LanguageSettingsDirectives
.
ALLOW_RESULT_RETURN_TYPE
in
directives
)),
analysisFlag
(
AnalysisFlags
.
explicitApiMode
,
directives
.
singleOrZeroValue
(
LanguageSettingsDirectives
.
EXPLICIT_API_MODE
)),
analysisFlag
(
JvmAnalysisFlags
.
jvmDefaultMode
,
directives
.
singleOrZeroValue
(
LanguageSettingsDirectives
.
JVM_DEFAULT_MODE
)),
analysisFlag
(
JvmAnalysisFlags
.
inheritMultifileParts
,
trueOrNull
(
LanguageSettingsDirectives
.
INHERIT_MULTIFILE_PARTS
in
directives
)),
...
...
compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/LanguageSettingsDirectives.kt
浏览文件 @
23e704f3
...
...
@@ -7,9 +7,11 @@ package org.jetbrains.kotlin.test.directives
import
org.jetbrains.kotlin.config.ApiVersion
import
org.jetbrains.kotlin.config.ConstraintSystemForOverloadResolutionMode
import
org.jetbrains.kotlin.config.ExplicitApiMode
import
org.jetbrains.kotlin.config.JvmDefaultMode
import
org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer
@Suppress
(
"RemoveExplicitTypeArguments"
)
object
LanguageSettingsDirectives
:
SimpleDirectivesContainer
()
{
val
LANGUAGE
by
stringDirective
(
description
=
"""
...
...
@@ -45,9 +47,13 @@ object LanguageSettingsDirectives : SimpleDirectivesContainer() {
description
=
"Allow using Result in return type position"
)
val
EXPLICIT_API_MODE
by
enumDirective
<
ExplicitApiMode
>(
"Configures explicit API mode (AnalysisFlags.explicitApiMode)"
,
additionalParser
=
ExplicitApiMode
.
Companion
::
fromString
)
// --------------------- Jvm Analysis Flags ---------------------
@Suppress
(
"RemoveExplicitTypeArguments"
)
val
JVM_DEFAULT_MODE
by
enumDirective
<
JvmDefaultMode
>(
description
=
"Configures corresponding analysis flag (JvmAnalysisFlags.jvmDefaultMode)"
,
additionalParser
=
JvmDefaultMode
.
Companion
::
fromStringOrNull
...
...
compiler/testData/diagnostics/tests/testsWithExplicitApi/annotations.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
annotation
class
A
@Target
(
AnnotationTarget
.
CLASS
,
AnnotationTarget
.
PROPERTY
,
AnnotationTarget
.
CONSTRUCTOR
,
AnnotationTarget
.
FUNCTION
)
public
annotation
class
B
annotation
class
C
(
val
a
:
String
)
/**
* Foo1 KDoc
*/
@B
class
Foo1
()
{}
public
class
Foo2
()
{
/**
* KDoc for methodWithAnnotations
*/
@B
fun
methodWithAnnotations
()
{}
/**
* Property KDoc
*/
@B
var
simple
:
Int
=
10
}
public
open
class
ClassWithOpen
{
/**
* constructor KDoc
*/
@B
constructor
()
{}
/**
* KDoc for openAnnotatedMethod
*/
@B
open
fun
openAnnotatedMethod
()
{}
}
\ No newline at end of file
compiler/testData/diagnostics/testsWithExplicitApi/annotations.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/annotations.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/tests/testsWithExplicitApi/classes.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
/**
* KDoc for Foo1
*/
class
Foo1
()
{}
public
class
Foo2
()
{
/**
* KDoc for method
*/
fun
method
()
{}
/**
* KDoc for method2
*/
public
fun
method2
()
{}
private
fun
method3
()
{}
fun
implicit
()
=
10
public
fun
implicit2
()
=
10
public
fun
implicit3
():
Int
=
10
}
public
open
class
ClassWithOpen
()
{
/**
* KDoc for method
*/
fun
method
()
{}
/**
* KDoc for openMethod
*/
open
fun
openMethod
()
{}
}
public
data class
FooData
(
val
i
:
Int
,
val
s
:
String
)
data class
FooData2
(
val
i
:
Int
,
val
s
:
String
)
public
class
WithNested
{
class
Nested
{}
inner
class
Inner
{}
}
enum
class
Foo
{
A
,
B
}
public
enum
class
Bar
{
A
,
B
}
\ No newline at end of file
compiler/testData/diagnostics/testsWithExplicitApi/classes.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/classes.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/tests/testsWithExplicitApi/companionObject.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
public
class
Bar
{
companion
object
{}
}
public
class
Bar2
{
companion
object
MyCompanion
{}
}
public
class
Bar3
{
/**
* Nested object KDoc
*/
object
NestedObject
{}
}
data class
FooData2
(
val
i
:
Int
,
val
s
:
String
)
{
object
NestedObject
{}
}
\ No newline at end of file
compiler/testData/diagnostics/testsWithExplicitApi/companionObject.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/companionObject.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/tests/testsWithExplicitApi/constructors.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
public
class
Foo1
()
{}
public
class
Foo2
constructor
()
{}
public
class
Foo3
public
constructor
()
{}
public
class
Foo4
private
constructor
()
{}
public
class
Foo5
{
/**
* constructor KDoc
*/
constructor
()
{}
}
public
class
Foo6
{
public
constructor
()
{}
}
\ No newline at end of file
compiler/testData/diagnostics/testsWithExplicitApi/constructors.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/constructors.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/tests/testsWithExplicitApi/inlineClasses.fir.kt
0 → 100644
浏览文件 @
23e704f3
// !DIAGNOSTICS: -EXPERIMENTAL_FEATURE_WARNING
// SKIP_TXT
inline
class
Value1
(
val
inner
:
Int
)
public
inline
class
Value2
(
val
inner
:
Int
)
inline
class
Value3
(
public
val
inner
:
Int
)
public
inline
class
Value4
(
public
val
inner
:
Int
)
\ No newline at end of file
compiler/testData/diagnostics/testsWithExplicitApi/inlineClasses.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/inlineClasses.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/tests/testsWithExplicitApi/interfaces.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
interface
I1
{
fun
i
()
}
public
interface
I2
{
fun
i
()
}
public
interface
I3
{
public
fun
i
()
public
val
v
:
Int
}
public
interface
I4
{
public
fun
i
():
Int
public
val
v
:
Int
}
public
class
Impl
:
I3
{
override
fun
i
()
{}
override
val
v
:
Int
get
()
=
10
}
public
class
Impl2
:
I4
{
override
fun
i
()
=
10
override
val
v
=
10
}
private
class
PrivateImpl
:
I4
{
override
fun
i
()
=
10
override
val
v
=
10
}
compiler/testData/diagnostics/testsWithExplicitApi/interfaces.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/interfaces.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/testsWithExplicitApi/mustBeEffectivelyPublic.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/mustBeEffectivelyPublic.kt
浏览文件 @
23e704f3
// FIR_IDENTICAL
// SKIP_TXT
private
class
Foo
{
...
...
compiler/testData/diagnostics/tests/testsWithExplicitApi/properties.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
public
class
Foo
(
val
bar
:
Int
,
private
var
bar2
:
String
,
internal
var
bar3
:
Long
,
public
var
bar4
:
Int
)
{
/**
* Property KDoc
*/
var
simple
:
Int
=
10
public
var
simple2
:
Int
=
10
val
withGetter
:
Int
get
()
=
10
public
val
withGetter2
:
Int
get
()
=
10
var
getterAndSetter
:
Int
=
10
get
()
=
field
set
(
v
)
{
field
=
v
}
public
var
getterAndSetter2
:
Int
=
10
get
()
=
field
set
(
v
)
{
field
=
v
}
}
\ No newline at end of file
compiler/testData/diagnostics/testsWithExplicitApi/properties.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/properties.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/tests/testsWithExplicitApi/publishedApi.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
// WITH_RUNTIME
public
class
A
{
@PublishedApi
internal
fun
foo
()
=
1
}
\ No newline at end of file
compiler/testData/diagnostics/testsWithExplicitApi/publishedApi.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/publishedApi.kt
浏览文件 @
23e704f3
文件已移动
compiler/testData/diagnostics/tests/testsWithExplicitApi/toplevel.fir.kt
0 → 100644
浏览文件 @
23e704f3
// SKIP_TXT
/**
* foo KDoc
*/
fun
foo
()
{}
public
fun
foo2
()
{}
fun
bar
()
=
10
public
fun
bar2
()
=
10
public
fun
bar3
():
Int
=
10
compiler/testData/diagnostics/testsWithExplicitApi/toplevel.kt
→
compiler/testData/diagnostics/tests
/tests
WithExplicitApi/toplevel.kt
浏览文件 @
23e704f3
文件已移动
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java
浏览文件 @
23e704f3
...
...
@@ -28200,6 +28200,76 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/testsWithExplicitApi")
@TestDataPath("$PROJECT_ROOT")
public class TestsWithExplicitApi extends AbstractDiagnosticTest {
@Test
public void testAllFilesPresentInTestsWithExplicitApi() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/testsWithExplicitApi"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("annotations.kt")
public void testAnnotations() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/annotations.kt");
}
@Test
@TestMetadata("classes.kt")
public void testClasses() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/classes.kt");
}
@Test
@TestMetadata("companionObject.kt")
public void testCompanionObject() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/companionObject.kt");
}
@Test
@TestMetadata("constructors.kt")
public void testConstructors() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/constructors.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/inlineClasses.kt");
}
@Test
@TestMetadata("interfaces.kt")
public void testInterfaces() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/interfaces.kt");
}
@Test
@TestMetadata("mustBeEffectivelyPublic.kt")
public void testMustBeEffectivelyPublic() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/mustBeEffectivelyPublic.kt");
}
@Test
@TestMetadata("properties.kt")
public void testProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/properties.kt");
}
@Test
@TestMetadata("publishedApi.kt")
public void testPublishedApi() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/publishedApi.kt");
}
@Test
@TestMetadata("toplevel.kt")
public void testToplevel() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/toplevel.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/thisAndSuper")
@TestDataPath("$PROJECT_ROOT")
compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java
浏览文件 @
23e704f3
...
...
@@ -28104,6 +28104,76 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/testsWithExplicitApi")
@TestDataPath("$PROJECT_ROOT")
public class TestsWithExplicitApi extends AbstractFirDiagnosticTest {
@Test
public void testAllFilesPresentInTestsWithExplicitApi() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/testsWithExplicitApi"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("annotations.kt")
public void testAnnotations() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/annotations.kt");
}
@Test
@TestMetadata("classes.kt")
public void testClasses() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/classes.kt");
}
@Test
@TestMetadata("companionObject.kt")
public void testCompanionObject() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/companionObject.kt");
}
@Test
@TestMetadata("constructors.kt")
public void testConstructors() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/constructors.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/inlineClasses.kt");
}
@Test
@TestMetadata("interfaces.kt")
public void testInterfaces() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/interfaces.kt");
}
@Test
@TestMetadata("mustBeEffectivelyPublic.kt")
public void testMustBeEffectivelyPublic() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/mustBeEffectivelyPublic.kt");
}
@Test
@TestMetadata("properties.kt")
public void testProperties() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/properties.kt");
}
@Test
@TestMetadata("publishedApi.kt")
public void testPublishedApi() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/publishedApi.kt");
}
@Test
@TestMetadata("toplevel.kt")
public void testToplevel() throws Exception {
runTest("compiler/testData/diagnostics/tests/testsWithExplicitApi/toplevel.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/thisAndSuper")
@TestDataPath("$PROJECT_ROOT")
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractDiagnosticTest.kt
浏览文件 @
23e704f3
...
...
@@ -5,10 +5,13 @@
package
org.jetbrains.kotlin.test.runners
import
org.jetbrains.kotlin.config.ExplicitApiMode
import
org.jetbrains.kotlin.platform.jvm.JvmPlatforms
import
org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import
org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.USE_PSI_CLASS_FILES_READING
import
org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_STDLIB
import
org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives
import
org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.EXPLICIT_API_MODE
import
org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade
import
org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler
import
org.jetbrains.kotlin.test.frontend.classic.handlers.DeclarationsDumpHandler
...
...
@@ -61,5 +64,11 @@ abstract class AbstractDiagnosticTest : AbstractKotlinCompilerTest() {
+
WITH_STDLIB
}
}
forTestsMatching
(
"compiler/testData/diagnostics/tests/testsWithExplicitApi/*"
)
{
defaultDirectives
{
EXPLICIT_API_MODE
with
ExplicitApiMode
.
STRICT
}
}
}
}
compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractDiagnosticsWithExplicitApi.kt
已删除
100644 → 0
浏览文件 @
c0e4452c
/*
* Copyright 2010-2019 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.checkers
import
org.jetbrains.kotlin.config.*
import
org.jetbrains.kotlin.test.ConfigurationKind
abstract
class
AbstractDiagnosticsWithExplicitApi
:
AbstractDiagnosticsTest
()
{
override
fun
defaultLanguageVersionSettings
():
LanguageVersionSettings
=
CompilerTestLanguageVersionSettings
(
DEFAULT_DIAGNOSTIC_TESTS_FEATURES
,
LanguageVersionSettingsImpl
.
DEFAULT
.
apiVersion
,
LanguageVersionSettingsImpl
.
DEFAULT
.
languageVersion
,
mapOf
(
AnalysisFlags
.
explicitApiMode
to
ExplicitApiMode
.
STRICT
)
)
}
\ No newline at end of file
compiler/tests-gen/org/jetbrains/kotlin/checkers/DiagnosticsWithExplicitApiGenerated.java
已删除
100644 → 0
浏览文件 @
c0e4452c
/*
* Copyright 2010-2020 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.checkers
;
import
com.intellij.testFramework.TestDataPath
;
import
org.jetbrains.kotlin.test.JUnit3RunnerWithInners
;
import
org.jetbrains.kotlin.test.KotlinTestUtils
;
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.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
@SuppressWarnings
(
"all"
)
@TestMetadata
(
"compiler/testData/diagnostics/testsWithExplicitApi"
)
@TestDataPath
(
"$PROJECT_ROOT"
)
@RunWith
(
JUnit3RunnerWithInners
.
class
)
public
class
DiagnosticsWithExplicitApiGenerated
extends
AbstractDiagnosticsWithExplicitApi
{
private
void
runTest
(
String
testDataFilePath
)
throws
Exception
{
KotlinTestUtils
.
runTest
(
this
::
doTest
,
this
,
testDataFilePath
);
}
public
void
testAllFilesPresentInTestsWithExplicitApi
()
throws
Exception
{
KotlinTestUtils
.
assertAllTestsPresentByMetadataWithExcluded
(
this
.
getClass
(),
new
File
(
"compiler/testData/diagnostics/testsWithExplicitApi"
),
Pattern
.
compile
(
"^(.+)\\.kt$"
),
null
,
true
);
}
@TestMetadata
(
"annotations.kt"
)
public
void
testAnnotations
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/annotations.kt"
);
}
@TestMetadata
(
"classes.kt"
)
public
void
testClasses
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/classes.kt"
);
}
@TestMetadata
(
"companionObject.kt"
)
public
void
testCompanionObject
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/companionObject.kt"
);
}
@TestMetadata
(
"constructors.kt"
)
public
void
testConstructors
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/constructors.kt"
);
}
@TestMetadata
(
"inlineClasses.kt"
)
public
void
testInlineClasses
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/inlineClasses.kt"
);
}
@TestMetadata
(
"interfaces.kt"
)
public
void
testInterfaces
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/interfaces.kt"
);
}
@TestMetadata
(
"mustBeEffectivelyPublic.kt"
)
public
void
testMustBeEffectivelyPublic
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/mustBeEffectivelyPublic.kt"
);
}
@TestMetadata
(
"properties.kt"
)
public
void
testProperties
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/properties.kt"
);
}
@TestMetadata
(
"publishedApi.kt"
)
public
void
testPublishedApi
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/publishedApi.kt"
);
}
@TestMetadata
(
"toplevel.kt"
)
public
void
testToplevel
()
throws
Exception
{
runTest
(
"compiler/testData/diagnostics/testsWithExplicitApi/toplevel.kt"
);
}
}
compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt
浏览文件 @
23e704f3
...
...
@@ -92,10 +92,6 @@ fun main(args: Array<String>) {
model
(
"diagnostics/testsWithUnsignedTypes"
)
}
testClass
<
AbstractDiagnosticsWithExplicitApi
>
{
model
(
"diagnostics/testsWithExplicitApi"
)
}
testClass
<
AbstractDiagnosticsTestWithOldJvmBackend
>
{
model
(
"diagnostics/testsWithJvmBackend"
,
targetBackend
=
TargetBackend
.
JVM_OLD
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录