Add test on using kotlin.coroutines property in gradle

This commit is contained in:
Mikhail Zarechenskiy
2016-12-15 11:38:57 +03:00
committed by Stanislav Erokhin
parent 6697c902fc
commit c0a3d3568a
2 changed files with 32 additions and 0 deletions
@@ -1,3 +1,19 @@
/*
* Copyright 2010-2016 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.gradle
import org.gradle.api.logging.LogLevel
@@ -200,6 +216,20 @@ class KotlinGradleIT: BaseGradleIT() {
}
}
@Test
fun testCoroutinesPropertyFromLocalPropertiesFile() {
val project = Project("kotlinCoroutinesProject", GRADLE_VERSION)
project.setupWorkingDir()
val localPropertyFile = File(project.projectDir, "local.properties")
val coroutinesProperty = "kotlin.coroutines=error"
localPropertyFile.writeText(coroutinesProperty)
project.build("build") {
assertContains(coroutinesProperty)
}
}
@Test
fun testConvertJavaToKotlin() {
val project = Project("convertBetweenJavaAndKotlin", GRADLE_VERSION)
@@ -190,6 +190,8 @@ open class KotlinCompile : AbstractKotlinCompile<K2JVMCompilerArguments>(), Kotl
args.coroutinesWarn = coroutines == CoroutineSupport.ENABLED_WITH_WARNING
args.coroutinesError = coroutines == CoroutineSupport.DISABLED
logger.warn("Using kotlin.coroutines=${coroutines.compilerArgument}")
if (!incremental) {
anyClassesCompiled = true
processCompilerExitCode(compileJvmNotIncrementally(