Rename compilerConfigurationForTests -> newConfiguration
This commit is contained in:
@@ -57,7 +57,7 @@ public abstract class KotlinMultiFileTestWithJava<M, F> extends KotlinTestWithEn
|
||||
protected KotlinCoreEnvironment createEnvironment() throws Exception {
|
||||
// TODO: do not create temporary directory for tests without Java sources
|
||||
javaFilesDir = KotlinTestUtils.tmpDir("java-files");
|
||||
CompilerConfiguration configuration = KotlinTestUtils.compilerConfigurationForTests(
|
||||
CompilerConfiguration configuration = KotlinTestUtils.newConfiguration(
|
||||
getConfigurationKind(),
|
||||
getTestJdkKind(),
|
||||
CollectionsKt.plus(Collections.singletonList(KotlinTestUtils.getAnnotationsJar()), getExtraClasspath()),
|
||||
|
||||
@@ -174,15 +174,12 @@ class KotlinCliJavaFileManagerTest : KotlinTestWithEnvironment() {
|
||||
TestCase.assertNull("Should not find class in empty scope", manager.findClass("foo.Test", GlobalSearchScope.EMPTY_SCOPE))
|
||||
}
|
||||
|
||||
@Throws(Exception::class)
|
||||
override fun createEnvironment(): KotlinCoreEnvironment {
|
||||
javaFilesDir = KotlinTestUtils.tmpDir("java-file-manager-test")
|
||||
|
||||
val configuration = KotlinTestUtils.compilerConfigurationForTests(
|
||||
ConfigurationKind.MOCK_RUNTIME,
|
||||
TestJdkKind.MOCK_JDK,
|
||||
emptyList(),
|
||||
listOf<File>(javaFilesDir!!))
|
||||
val configuration = KotlinTestUtils.newConfiguration(
|
||||
ConfigurationKind.MOCK_RUNTIME, TestJdkKind.MOCK_JDK, emptyList(), listOf(javaFilesDir!!)
|
||||
)
|
||||
|
||||
return KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
}
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ abstract class AbstractBlackBoxAgainstJavaCodegenTest : AbstractBlackBoxCodegenT
|
||||
CodegenTestUtil.compileJava(findJavaSourcesInDirectory(directory), emptyList(), javacOptions)
|
||||
}
|
||||
|
||||
val configuration = createCompilerConfigurationForTests(
|
||||
val configuration = createConfiguration(
|
||||
ConfigurationKind.ALL, jdkKind,
|
||||
/* classpath = */ listOf(KotlinTestUtils.getAnnotationsJar(), javaOutputDir),
|
||||
/* javaSource = */ emptyList(),
|
||||
|
||||
@@ -48,8 +48,8 @@ public class GenerateNotNullAssertionsTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
private void setUpEnvironment(boolean disableCallAssertions, boolean disableParamAssertions, File... extraClassPath) {
|
||||
CompilerConfiguration configuration = KotlinTestUtils.compilerConfigurationForTests(
|
||||
ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, extraClassPath);
|
||||
CompilerConfiguration configuration =
|
||||
KotlinTestUtils.newConfiguration(ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, extraClassPath);
|
||||
|
||||
configuration.put(JVMConfigurationKeys.DISABLE_CALL_ASSERTIONS, disableCallAssertions);
|
||||
configuration.put(JVMConfigurationKeys.DISABLE_PARAM_ASSERTIONS, disableParamAssertions);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class StdlibTest extends KotlinTestWithEnvironment {
|
||||
|
||||
@Override
|
||||
protected KotlinCoreEnvironment createEnvironment() {
|
||||
CompilerConfiguration configuration = KotlinTestUtils.compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.FULL_JDK);
|
||||
CompilerConfiguration configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.FULL_JDK);
|
||||
|
||||
File junitJar = new File("libraries/lib/junit-4.11.jar");
|
||||
assertTrue(junitJar.exists());
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public abstract class AbstractCompileJavaAgainstKotlinTest extends TestCaseWithT
|
||||
|
||||
KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForTests(
|
||||
getTestRootDisposable(),
|
||||
compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, getAnnotationsJar(), out),
|
||||
newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, getAnnotationsJar(), out),
|
||||
EnvironmentConfigFiles.JVM_CONFIG_FILES
|
||||
);
|
||||
|
||||
|
||||
+2
-2
@@ -123,8 +123,8 @@ public class CompileKotlinAgainstCustomBinariesTest extends TestCaseWithTmpdir {
|
||||
extras.addAll(extraClassPath);
|
||||
extras.add(KotlinTestUtils.getAnnotationsJar());
|
||||
|
||||
CompilerConfiguration configuration = KotlinTestUtils.compilerConfigurationForTests(
|
||||
ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, extras.toArray(new File[extras.size()]));
|
||||
CompilerConfiguration configuration =
|
||||
KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, extras.toArray(new File[extras.size()]));
|
||||
return KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class KotlinClassFinderTest : KotlinTestWithEnvironmentManagement() {
|
||||
private fun createEnvironment(tmpdir: File?): KotlinCoreEnvironment {
|
||||
return KotlinCoreEnvironment.createForTests(
|
||||
testRootDisposable,
|
||||
KotlinTestUtils.compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, tmpdir),
|
||||
KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, tmpdir),
|
||||
EnvironmentConfigFiles.JVM_CONFIG_FILES
|
||||
).apply {
|
||||
// Activate Kotlin light class finder
|
||||
|
||||
+2
-3
@@ -83,9 +83,8 @@ class MultiModuleJavaAnalysisCustomTest : KtUsefulTestCase() {
|
||||
}
|
||||
|
||||
private fun createEnvironment(moduleDirs: Array<File>): KotlinCoreEnvironment {
|
||||
val configuration = KotlinTestUtils.compilerConfigurationForTests(
|
||||
ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, emptyList(), moduleDirs.toList()
|
||||
)
|
||||
val configuration =
|
||||
KotlinTestUtils.newConfiguration(ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, emptyList(), moduleDirs.toList())
|
||||
return KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -165,15 +165,14 @@ public class ResolveDescriptorsFromExternalLibraries {
|
||||
if (jar != null) {
|
||||
environment = KotlinCoreEnvironment.createForTests(
|
||||
junk,
|
||||
KotlinTestUtils.compilerConfigurationForTests(
|
||||
KotlinTestUtils.newConfiguration(
|
||||
ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, KotlinTestUtils.getAnnotationsJar(), jar
|
||||
),
|
||||
EnvironmentConfigFiles.JVM_CONFIG_FILES
|
||||
);
|
||||
}
|
||||
else {
|
||||
CompilerConfiguration configuration =
|
||||
KotlinTestUtils.compilerConfigurationForTests(ConfigurationKind.JDK_ONLY, TestJdkKind.FULL_JDK);
|
||||
CompilerConfiguration configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.JDK_ONLY, TestJdkKind.FULL_JDK);
|
||||
environment = KotlinCoreEnvironment.createForTests(junk, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES);
|
||||
if (!findRtJar().equals(jar)) {
|
||||
throw new RuntimeException("rt.jar mismatch: " + jar + ", " + findRtJar());
|
||||
|
||||
@@ -80,8 +80,8 @@ abstract class AbstractReplInterpreterTest : KtUsefulTestCase() {
|
||||
}
|
||||
|
||||
protected fun doTest(path: String) {
|
||||
val configuration = KotlinTestUtils.compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK)
|
||||
val repl = ReplInterpreter(testRootDisposable!!, configuration, false, null)
|
||||
val configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK)
|
||||
val repl = ReplInterpreter(testRootDisposable, configuration, false, null)
|
||||
|
||||
for ((code, expected) in loadLines(File(path))) {
|
||||
val lineResult = repl.eval(code)
|
||||
|
||||
@@ -76,8 +76,7 @@ public class ScriptTest {
|
||||
|
||||
Disposable rootDisposable = Disposer.newDisposable();
|
||||
try {
|
||||
CompilerConfiguration configuration =
|
||||
KotlinTestUtils.compilerConfigurationForTests(ConfigurationKind.JDK_ONLY, TestJdkKind.FULL_JDK);
|
||||
CompilerConfiguration configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.JDK_ONLY, TestJdkKind.FULL_JDK);
|
||||
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector);
|
||||
ContentRootsKt.addKotlinSourceRoot(configuration, "compiler/testData/script/" + scriptPath);
|
||||
configuration.add(CommonConfigurationKeys.SCRIPT_DEFINITIONS_KEY, scriptDefinition);
|
||||
|
||||
@@ -52,7 +52,7 @@ abstract class AbstractLocalClassProtoTest : TestCaseWithTmpdir() {
|
||||
val clazz = classLoader.loadClass(classFile.toRelativeString(tmpdir).substringBeforeLast(".class").replace('/', '.').replace('\\', '.'))
|
||||
assertHasAnnotationData(clazz)
|
||||
|
||||
val configuration = KotlinTestUtils.compilerConfigurationForTests(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, tmpdir)
|
||||
val configuration = KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, tmpdir)
|
||||
val environment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
val moduleContext = TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(environment.project, configuration)
|
||||
val providerFactory = FileBasedDeclarationProviderFactory(moduleContext.storageManager, emptyList())
|
||||
|
||||
Reference in New Issue
Block a user