From 126d6f3d4193c19efe15b86a6724f0c74a5a629f Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Thu, 2 Mar 2017 18:09:11 +0300 Subject: [PATCH] tests: Ignore diagnostics directives --- .../groovy/org/jetbrains/kotlin/KonanTest.groovy | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 339dd5fd07a..8fdbd0928db 100644 --- a/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/buildSrc/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -83,22 +83,23 @@ abstract class KonanTest extends DefaultTask { return "$outputDirectory/$exeName" } + protected String removeDiagnostics(String str) { + return str.replaceAll(~/(.*?)/) { all, text -> text } + } + // TODO refactor List buildCompileList() { def result = [] def filePattern = ~/(?m)\/\/\s*FILE:\s*(.*)$/ def srcFile = project.file(source) - def srcText = srcFile.text + def srcText = removeDiagnostics(srcFile.text) def matcher = filePattern.matcher(srcText) if (!matcher.find()) { // There is only one file in the input - project.copy{ - from srcFile.absolutePath - into outputDirectory - } - def newFile ="$outputDirectory/${srcFile.name}" - result.add(newFile) + def filePath = "$outputDirectory/${srcFile.name}" + createFile(filePath, srcText) + result.add(filePath) } else { // There are several files def processedChars = 0