Cleanup compiler warnings in compiler tests
This commit is contained in:
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.cli
|
package org.jetbrains.kotlin.cli
|
||||||
|
|
||||||
import junit.framework.Assert
|
|
||||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler
|
||||||
import org.jetbrains.kotlin.test.CompilerTestUtil
|
import org.jetbrains.kotlin.test.CompilerTestUtil
|
||||||
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
||||||
|
import org.junit.Assert
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.jar.JarFile
|
import java.util.jar.JarFile
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ package org.jetbrains.kotlin.daemon
|
|||||||
|
|
||||||
import com.intellij.openapi.util.io.FileUtil
|
import com.intellij.openapi.util.io.FileUtil
|
||||||
import com.intellij.openapi.util.io.FileUtilRt
|
import com.intellij.openapi.util.io.FileUtilRt
|
||||||
import junit.framework.Assert
|
|
||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
import org.jetbrains.kotlin.cli.AbstractCliTest
|
import org.jetbrains.kotlin.cli.AbstractCliTest
|
||||||
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
|
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
|
||||||
@@ -50,7 +49,6 @@ import kotlin.script.experimental.dependencies.asSuccess
|
|||||||
import kotlin.script.templates.ScriptTemplateDefinition
|
import kotlin.script.templates.ScriptTemplateDefinition
|
||||||
import kotlin.test.fail
|
import kotlin.test.fail
|
||||||
|
|
||||||
|
|
||||||
val TIMEOUT_DAEMON_RUNNER_EXIT_MS = 10000L
|
val TIMEOUT_DAEMON_RUNNER_EXIT_MS = 10000L
|
||||||
|
|
||||||
class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
||||||
@@ -204,12 +202,12 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
|
|
||||||
for (assertArgValue in allAssetionsArgs) {
|
for (assertArgValue in allAssetionsArgs) {
|
||||||
withDaemonJvmOptionsSetTo(assertArgValue) {
|
withDaemonJvmOptionsSetTo(assertArgValue) {
|
||||||
Assert.assertEquals(assertArgValue, assertionsJvmArgs())
|
assertEquals(assertArgValue, assertionsJvmArgs())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
withDaemonJvmOptionsSetTo(null) {
|
withDaemonJvmOptionsSetTo(null) {
|
||||||
Assert.assertEquals("-ea", assertionsJvmArgs())
|
assertEquals("-ea", assertionsJvmArgs())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -757,6 +755,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
}
|
}
|
||||||
}, port = SOCKET_ANY_FREE_PORT)
|
}, port = SOCKET_ANY_FREE_PORT)
|
||||||
val strm = ByteArrayOutputStream()
|
val strm = ByteArrayOutputStream()
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
val code = daemon!!.remoteCompile(CompileService.NO_SESSION,
|
val code = daemon!!.remoteCompile(CompileService.NO_SESSION,
|
||||||
CompileService.TargetPlatform.JVM,
|
CompileService.TargetPlatform.JVM,
|
||||||
arrayOf("-include-runtime", file.absolutePath, "-d", jar),
|
arrayOf("-include-runtime", file.absolutePath, "-d", jar),
|
||||||
|
|||||||
+1
-1
@@ -186,7 +186,7 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
|
|||||||
run(getHelloAppBaseDir(), "hello.run", "-cp", jar, "Hello.HelloKt")
|
run(getHelloAppBaseDir(), "hello.run", "-cp", jar, "Hello.HelloKt")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun terminate(daemonOptions: DaemonOptions) {
|
private fun terminate(@Suppress("UNUSED_PARAMETER") daemonOptions: DaemonOptions) {
|
||||||
println("\n\nkillall -9 Console && open ${logFiles.joinToString(" ")}\n\n")
|
println("\n\nkillall -9 Console && open ${logFiles.joinToString(" ")}\n\n")
|
||||||
log.info("in finally")
|
log.info("in finally")
|
||||||
// runBlocking {
|
// runBlocking {
|
||||||
|
|||||||
+4
-3
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.daemon.experimental.integration
|
package org.jetbrains.kotlin.daemon.experimental.integration
|
||||||
|
|
||||||
import junit.framework.Assert
|
|
||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import org.jetbrains.kotlin.cli.AbstractCliTest
|
import org.jetbrains.kotlin.cli.AbstractCliTest
|
||||||
@@ -281,12 +280,12 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
|
|
||||||
for (assertArgValue in allAssetionsArgs) {
|
for (assertArgValue in allAssetionsArgs) {
|
||||||
withDaemonJvmOptionsSetTo(assertArgValue) {
|
withDaemonJvmOptionsSetTo(assertArgValue) {
|
||||||
Assert.assertEquals(assertArgValue, assertionsJvmArgs())
|
assertEquals(assertArgValue, assertionsJvmArgs())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
withDaemonJvmOptionsSetTo(null) {
|
withDaemonJvmOptionsSetTo(null) {
|
||||||
Assert.assertEquals("-ea", assertionsJvmArgs())
|
assertEquals("-ea", assertionsJvmArgs())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -778,6 +777,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
private val PARALLEL_THREADS_TO_COMPILE = 10
|
private val PARALLEL_THREADS_TO_COMPILE = 10
|
||||||
private val PARALLEL_WAIT_TIMEOUT_S = 60L
|
private val PARALLEL_WAIT_TIMEOUT_S = 60L
|
||||||
|
|
||||||
|
@UseExperimental(ObsoleteCoroutinesApi::class)
|
||||||
private fun runCompile(
|
private fun runCompile(
|
||||||
daemon: CompileServiceAsync,
|
daemon: CompileServiceAsync,
|
||||||
resultCodes: Array<Int?>,
|
resultCodes: Array<Int?>,
|
||||||
@@ -877,6 +877,7 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
|
|||||||
const val connectionFailedErr = -100
|
const val connectionFailedErr = -100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@UseExperimental(ObsoleteCoroutinesApi::class)
|
||||||
fun ignore_testParallelDaemonStart() {
|
fun ignore_testParallelDaemonStart() {
|
||||||
|
|
||||||
val doneLatch = CountDownLatch(ParallelStartParams.threads)
|
val doneLatch = CountDownLatch(ParallelStartParams.threads)
|
||||||
|
|||||||
+3
-3
@@ -31,7 +31,7 @@ class TestServer(val serverPort: Int = 6999) {
|
|||||||
log.info("accepting clientSocket...")
|
log.info("accepting clientSocket...")
|
||||||
val client = serverSocket.accept()
|
val client = serverSocket.accept()
|
||||||
log.info("client accepted! (${client.remoteAddress})")
|
log.info("client accepted! (${client.remoteAddress})")
|
||||||
val (input, output) = client.openIO(log)
|
client.openIO(log)
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ class ClientSerializationTest : KotlinIntegrationTestBase() {
|
|||||||
fun ignore_testDefaultClient() = abstractSerializationTest(
|
fun ignore_testDefaultClient() = abstractSerializationTest(
|
||||||
{ DefaultClient<ServerBase>(testServer.serverPort) },
|
{ DefaultClient<ServerBase>(testServer.serverPort) },
|
||||||
{ client, client2 -> assert(client.serverPort == client2.serverPort) },
|
{ client, client2 -> assert(client.serverPort == client2.serverPort) },
|
||||||
{ client, client2 ->
|
{ _, client2 ->
|
||||||
client2.log.info("abacaba (2)")
|
client2.log.info("abacaba (2)")
|
||||||
log.info("test passed")
|
log.info("test passed")
|
||||||
}
|
}
|
||||||
@@ -90,4 +90,4 @@ class ClientSerializationTest : KotlinIntegrationTestBase() {
|
|||||||
|
|
||||||
fun ignore_testRMIWrapper() = abstractSerializationTest({ CompilerServicesFacadeBaseClientSideImpl(testServer.serverPort).toRMI() })
|
fun ignore_testRMIWrapper() = abstractSerializationTest({ CompilerServicesFacadeBaseClientSideImpl(testServer.serverPort).toRMI() })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ class ConnectionsTest : KotlinIntegrationTestBase() {
|
|||||||
{ daemons -> daemons[0].daemon },
|
{ daemons -> daemons[0].daemon },
|
||||||
{ d -> d.getDaemonInfo() },
|
{ d -> d.getDaemonInfo() },
|
||||||
{ d -> d.registerClient(generateClient()) },
|
{ d -> d.registerClient(generateClient()) },
|
||||||
{ d -> -1 },
|
{ _ -> -1 },
|
||||||
1.takeIf { shouldCheckNumber },
|
1.takeIf { shouldCheckNumber },
|
||||||
extraAction
|
extraAction
|
||||||
)
|
)
|
||||||
@@ -351,6 +351,7 @@ class ConnectionsTest : KotlinIntegrationTestBase() {
|
|||||||
val servicesClient = services.clientSide
|
val servicesClient = services.clientSide
|
||||||
val compResultsClient = kotlinCompilerClient.createCompResults().clientSide
|
val compResultsClient = kotlinCompilerClient.createCompResults().clientSide
|
||||||
val threadCount = 10
|
val threadCount = 10
|
||||||
|
@UseExperimental(ObsoleteCoroutinesApi::class)
|
||||||
fun runThread(i: Int) =
|
fun runThread(i: Int) =
|
||||||
async(newSingleThreadContext("thread_$i")) {
|
async(newSingleThreadContext("thread_$i")) {
|
||||||
val jar = tmpdir.absolutePath + File.separator + "hello.$i.jar"
|
val jar = tmpdir.absolutePath + File.separator + "hello.$i.jar"
|
||||||
@@ -386,4 +387,4 @@ class ConnectionsTest : KotlinIntegrationTestBase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -557,7 +557,7 @@ abstract class ScriptWithBaseClass(val num: Int, passthrough: Int) : TestDSLClas
|
|||||||
@ScriptTemplateDefinition(
|
@ScriptTemplateDefinition(
|
||||||
scriptFilePattern =".*\\.kts",
|
scriptFilePattern =".*\\.kts",
|
||||||
resolver = TestKotlinScriptDependenciesResolver::class)
|
resolver = TestKotlinScriptDependenciesResolver::class)
|
||||||
abstract class ScriptWithoutParams(num: Int)
|
abstract class ScriptWithoutParams(@Suppress("UNUSED_PARAMETER") num: Int)
|
||||||
|
|
||||||
@ScriptTemplateDefinition(
|
@ScriptTemplateDefinition(
|
||||||
scriptFilePattern =".*\\.kts",
|
scriptFilePattern =".*\\.kts",
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.kotlin.util
|
package org.jetbrains.kotlin.util
|
||||||
|
|
||||||
import com.intellij.openapi.util.io.FileUtil
|
import com.intellij.openapi.util.io.FileUtil
|
||||||
import com.intellij.util.Processor
|
|
||||||
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
|
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
|
||||||
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
import org.jetbrains.kotlin.config.KotlinCompilerVersion
|
||||||
import org.jetbrains.kotlin.config.LanguageVersion
|
import org.jetbrains.kotlin.config.LanguageVersion
|
||||||
@@ -27,7 +26,6 @@ import org.junit.Assert
|
|||||||
import org.xml.sax.Attributes
|
import org.xml.sax.Attributes
|
||||||
import org.xml.sax.helpers.DefaultHandler
|
import org.xml.sax.helpers.DefaultHandler
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.*
|
|
||||||
import javax.xml.parsers.SAXParserFactory
|
import javax.xml.parsers.SAXParserFactory
|
||||||
|
|
||||||
class KotlinVersionsTest : KtUsefulTestCase() {
|
class KotlinVersionsTest : KtUsefulTestCase() {
|
||||||
@@ -89,16 +87,17 @@ class KotlinVersionsTest : KtUsefulTestCase() {
|
|||||||
|
|
||||||
val poms = arrayListOf<Pom>()
|
val poms = arrayListOf<Pom>()
|
||||||
|
|
||||||
FileUtil.processFilesRecursively(File("libraries"), Processor { file ->
|
FileUtil.processFilesRecursively(File("libraries")) { file ->
|
||||||
if (file.name == "pom.xml") {
|
if (file.name == "pom.xml" && file.toPath().none { it.fileName.toString() == "target" }) {
|
||||||
|
println(file.path)
|
||||||
if (loadValueFromPomXml(file.path, listOf("project", "parent", "artifactId")) == "kotlin-project") {
|
if (loadValueFromPomXml(file.path, listOf("project", "parent", "artifactId")) == "kotlin-project") {
|
||||||
val version = loadValueFromPomXml(file.path, listOf("project", "parent", "version"))
|
val version = loadValueFromPomXml(file.path, listOf("project", "parent", "version"))
|
||||||
?: error("No version found in pom.xml at $file")
|
?: error("No version found in pom.xml at $file")
|
||||||
poms.add(Pom(file.path, version))
|
poms.add(Pom(file.path, version))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}, Processor { file -> file.name != "target" })
|
}
|
||||||
|
|
||||||
Assert.assertTrue(
|
Assert.assertTrue(
|
||||||
"Too few (<= 10) pom.xml files found. Something must be wrong in the test or in the project structure",
|
"Too few (<= 10) pom.xml files found. Something must be wrong in the test or in the project structure",
|
||||||
|
|||||||
Reference in New Issue
Block a user