[Test] Migrate IrTextTestGenerated to new infrastructure
This commit is contained in:
committed by
TeamCityServer
parent
5ae5f660f6
commit
aaa3fa5845
+8
-2
@@ -21,7 +21,13 @@ import javax.tools.ToolProvider
|
||||
|
||||
@JvmOverloads
|
||||
@Throws(IOException::class)
|
||||
fun compileJavaFiles(files: Collection<File>, options: List<String?>?, javaErrorFile: File? = null, assertions: Assertions): Boolean {
|
||||
fun compileJavaFiles(
|
||||
files: Collection<File>,
|
||||
options: List<String?>?,
|
||||
javaErrorFile: File? = null,
|
||||
assertions: Assertions,
|
||||
ignoreJavaErrors: Boolean = false
|
||||
): Boolean {
|
||||
val javaCompiler = ToolProvider.getSystemJavaCompiler()
|
||||
val diagnosticCollector = DiagnosticCollector<JavaFileObject>()
|
||||
javaCompiler.getStandardFileManager(diagnosticCollector, Locale.ENGLISH, Charset.forName("utf-8")).use { fileManager ->
|
||||
@@ -36,7 +42,7 @@ fun compileJavaFiles(files: Collection<File>, options: List<String?>?, javaError
|
||||
)
|
||||
val success = task.call() // do NOT inline this variable, call() should complete before errorsToString()
|
||||
if (javaErrorFile == null || !javaErrorFile.exists()) {
|
||||
assertions.assertTrue(success) { errorsToString(diagnosticCollector, true) }
|
||||
assertions.assertTrue(success || ignoreJavaErrors) { errorsToString(diagnosticCollector, true) }
|
||||
} else {
|
||||
assertions.assertEqualsToFile(javaErrorFile, errorsToString(diagnosticCollector, false))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user