Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
硅谷海盗
kotlin
提交
a932f69b
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,发现更多精彩内容 >>
提交
a932f69b
编写于
2月 09, 2021
作者:
D
Dmitriy Novozhilov
提交者:
TeamCityServer
2月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Test] Don't pass MockProject to environment configurators
上级
bd37badf
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
21 deletion
+11
-21
compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/services/EnvironmentConfigurator.kt
...jetbrains/kotlin/test/services/EnvironmentConfigurator.kt
+3
-5
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/CompilerConfigurationProvider.kt
...ins/kotlin/test/services/CompilerConfigurationProvider.kt
+2
-3
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/CommonEnvironmentConfigurator.kt
...t/services/configuration/CommonEnvironmentConfigurator.kt
+1
-2
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JsEnvironmentConfigurator.kt
.../test/services/configuration/JsEnvironmentConfigurator.kt
+1
-2
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt
...test/services/configuration/JvmEnvironmentConfigurator.kt
+1
-2
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt
...rvices/configuration/JvmForeignAnnotationsConfigurator.kt
+2
-5
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/ScriptingEnvironmentConfigurator.kt
...ervices/configuration/ScriptingEnvironmentConfigurator.kt
+1
-2
未找到文件。
compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/services/EnvironmentConfigurator.kt
浏览文件 @
a932f69b
...
...
@@ -5,7 +5,6 @@
package
org.jetbrains.kotlin.test.services
import
com.intellij.mock.MockProject
import
org.jetbrains.kotlin.config.AnalysisFlag
import
org.jetbrains.kotlin.config.CompilerConfiguration
import
org.jetbrains.kotlin.config.CompilerConfigurationKey
...
...
@@ -22,20 +21,19 @@ abstract class EnvironmentConfigurator(protected val testServices: TestServices)
protected
val
moduleStructure
:
TestModuleStructure
get
()
=
testServices
.
moduleStructure
protected
open
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{}
protected
open
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
)
{}
fun
configureCompileConfigurationWithAdditionalConfigurationKeys
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{
configureCompilerConfiguration
(
configuration
,
module
,
project
)
configureCompilerConfiguration
(
configuration
,
module
)
val
extractor
=
DirectiveToConfigurationKeyExtractor
()
extractor
.
provideConfigurationKeys
()
extractor
.
configure
(
configuration
,
module
.
directives
)
}
protected
open
fun
DirectiveToConfigurationKeyExtractor
.
provideConfigurationKeys
()
{}
open
fun
DirectiveToConfigurationKeyExtractor
.
provideConfigurationKeys
()
{}
open
fun
provideAdditionalAnalysisFlags
(
directives
:
RegisteredDirectives
):
Map
<
AnalysisFlag
<
*
>,
Any
?
>
{
return
emptyMap
()
...
...
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/CompilerConfigurationProvider.kt
浏览文件 @
a932f69b
...
...
@@ -5,7 +5,6 @@
package
org.jetbrains.kotlin.test.services
import
com.intellij.mock.MockProject
import
com.intellij.openapi.Disposable
import
com.intellij.openapi.project.Project
import
com.intellij.psi.search.GlobalSearchScope
...
...
@@ -90,7 +89,7 @@ open class CompilerConfigurationProviderImpl(
)
}
private
fun
createCompilerConfiguration
(
module
:
TestModule
,
project
:
MockProject
):
CompilerConfiguration
{
fun
createCompilerConfiguration
(
module
:
TestModule
):
CompilerConfiguration
{
val
configuration
=
CompilerConfiguration
()
configuration
[
CommonConfigurationKeys
.
MODULE_NAME
]
=
module
.
name
...
...
@@ -108,7 +107,7 @@ open class CompilerConfigurationProviderImpl(
}
configuration
.
languageVersionSettings
=
module
.
languageVersionSettings
configurators
.
forEach
{
it
.
configureCompileConfigurationWithAdditionalConfigurationKeys
(
configuration
,
module
,
project
)
}
configurators
.
forEach
{
it
.
configureCompileConfigurationWithAdditionalConfigurationKeys
(
configuration
,
module
)
}
return
configuration
}
...
...
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/CommonEnvironmentConfigurator.kt
浏览文件 @
a932f69b
...
...
@@ -5,7 +5,6 @@
package
org.jetbrains.kotlin.test.services.configuration
import
com.intellij.mock.MockProject
import
org.jetbrains.kotlin.config.CompilerConfiguration
import
org.jetbrains.kotlin.config.CompilerConfigurationKey
import
org.jetbrains.kotlin.test.directives.ConfigurationDirectives
...
...
@@ -19,7 +18,7 @@ class CommonEnvironmentConfigurator(testServices: TestServices) : EnvironmentCon
override
val
directivesContainers
:
List
<
DirectivesContainer
>
get
()
=
listOf
(
ConfigurationDirectives
)
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
)
{
val
rawFlags
=
module
.
directives
[
ConfigurationDirectives
.
KOTLIN_CONFIGURATION_FLAGS
]
parseAnalysisFlags
(
rawFlags
).
forEach
{
(
key
,
value
)
->
@Suppress
(
"UNCHECKED_CAST"
)
...
...
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JsEnvironmentConfigurator.kt
浏览文件 @
a932f69b
...
...
@@ -5,7 +5,6 @@
package
org.jetbrains.kotlin.test.services.configuration
import
com.intellij.mock.MockProject
import
org.jetbrains.kotlin.config.CompilerConfiguration
import
org.jetbrains.kotlin.js.config.JSConfigurationKeys
import
org.jetbrains.kotlin.js.config.JsConfig
...
...
@@ -21,7 +20,7 @@ class JsEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigu
override
val
directivesContainers
:
List
<
DirectivesContainer
>
get
()
=
listOf
(
JsEnvironmentConfigurationDirectives
)
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
)
{
val
moduleKinds
=
module
.
directives
[
JsEnvironmentConfigurationDirectives
.
MODULE_KIND
]
val
moduleKind
=
when
(
moduleKinds
.
size
)
{
0
->
ModuleKind
.
PLAIN
...
...
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt
浏览文件 @
a932f69b
...
...
@@ -5,7 +5,6 @@
package
org.jetbrains.kotlin.test.services.configuration
import
com.intellij.mock.MockProject
import
com.intellij.openapi.util.SystemInfo
import
org.jetbrains.kotlin.cli.jvm.config.addJavaSourceRoot
import
org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot
...
...
@@ -62,7 +61,7 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig
register
(
USE_OLD_INLINE_CLASSES_MANGLING_SCHEME
,
JVMConfigurationKeys
.
USE_OLD_INLINE_CLASSES_MANGLING_SCHEME
)
}
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
)
{
if
(
module
.
targetPlatform
!
in
JvmPlatforms
.
allJvmPlatforms
)
return
val
registeredDirectives
=
module
.
directives
val
targets
=
registeredDirectives
[
JvmEnvironmentConfigurationDirectives
.
JVM_TARGET
]
...
...
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmForeignAnnotationsConfigurator.kt
浏览文件 @
a932f69b
...
...
@@ -5,8 +5,6 @@
package
org.jetbrains.kotlin.test.services.configuration
import
com.intellij.mock.MockProject
import
org.jetbrains.kotlin.cli.jvm.config.JvmContentRoot
import
org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots
import
org.jetbrains.kotlin.codegen.CodegenTestUtil
import
org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
...
...
@@ -24,7 +22,6 @@ import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives
import
org.jetbrains.kotlin.test.directives.model.singleOrZeroValue
import
org.jetbrains.kotlin.test.model.TestModule
import
org.jetbrains.kotlin.test.services.*
import
org.jetbrains.kotlin.test.util.KtTestUtil
import
org.jetbrains.kotlin.utils.JavaTypeEnhancementState
import
org.jetbrains.kotlin.utils.ReportLevel
import
java.io.File
...
...
@@ -48,7 +45,7 @@ open class JvmForeignAnnotationsConfigurator(testServices: TestServices) : Envir
get
()
=
listOf
(
ForeignAnnotationsDirectives
)
@OptIn
(
ExperimentalStdlibApi
::
class
)
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
)
{
val
extraClassPath
=
buildList
{
val
foreignAnnotations
=
createJarWithForeignAnnotations
(
module
)
addAll
(
foreignAnnotations
)
...
...
@@ -102,7 +99,7 @@ open class JvmForeignAnnotationsConfigurator(testServices: TestServices) : Envir
class
JvmForeignAnnotationsAgainstCompiledJavaConfigurator
(
testServices
:
TestServices
)
:
JvmForeignAnnotationsConfigurator
(
testServices
)
{
@OptIn
(
ExperimentalStdlibApi
::
class
)
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
)
{
val
compiledJavaPath
=
testServices
.
createTempDirectory
(
"java-compiled-files"
)
val
foreignAnnotations
=
createJarWithForeignAnnotations
(
module
)
...
...
compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/ScriptingEnvironmentConfigurator.kt
浏览文件 @
a932f69b
...
...
@@ -5,7 +5,6 @@
package
org.jetbrains.kotlin.test.services.configuration
import
com.intellij.mock.MockProject
import
org.jetbrains.kotlin.config.CompilerConfiguration
import
org.jetbrains.kotlin.script.loadScriptingPlugin
import
org.jetbrains.kotlin.test.model.TestModule
...
...
@@ -14,7 +13,7 @@ import org.jetbrains.kotlin.test.services.TestServices
import
org.jetbrains.kotlin.test.services.isKtsFile
class
ScriptingEnvironmentConfigurator
(
testServices
:
TestServices
)
:
EnvironmentConfigurator
(
testServices
)
{
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
,
project
:
MockProject
)
{
override
fun
configureCompilerConfiguration
(
configuration
:
CompilerConfiguration
,
module
:
TestModule
)
{
if
(
module
.
files
.
any
{
it
.
isKtsFile
})
{
loadScriptingPlugin
(
configuration
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录