From 8353b4d3e8ce268fa3ed0f21d90fe59d8a2afa8d Mon Sep 17 00:00:00 2001 From: Sergey Mashkov Date: Thu, 30 Jul 2015 13:18:26 +0300 Subject: [PATCH] Maven: integration test should remove escape sequences from build log --- libraries/tools/kotlin-maven-plugin/pom.xml | 4 ---- .../kotlin-maven-plugin/src/it/simple/verify.groovy | 10 ++++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libraries/tools/kotlin-maven-plugin/pom.xml b/libraries/tools/kotlin-maven-plugin/pom.xml index 2c2b19d64d4..ed1ad825834 100644 --- a/libraries/tools/kotlin-maven-plugin/pom.xml +++ b/libraries/tools/kotlin-maven-plugin/pom.xml @@ -102,10 +102,6 @@ install run - - - verify - diff --git a/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy b/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy index 5089786f197..4f3e3773aa3 100644 --- a/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy +++ b/libraries/tools/kotlin-maven-plugin/src/it/simple/verify.groovy @@ -15,14 +15,20 @@ def removePaths(String path, File basedir) { } def pattern = Pattern.compile(/\[INFO\] --- ([^:]+):.*:\S+ \([^)]+\) @ test-project ---/) -State state = new File(basedir, "build.log").readLines().inject(new State()) { acc, line -> +State state = new File(basedir, "build.log").readLines().collect { it.replaceAll("\\u001b[^m]*m", "") }.inject(new State()) { acc, line -> def m = pattern.matcher(line) if (m.find()) { acc.currentPlugin = m.group(1) } else if (line.startsWith("[INFO] Downloaded:") || line.startsWith("[INFO] Downloading:") || line.startsWith("Downloaded:") || line.startsWith("Downloading:")) { // ignore line } else if (acc.currentPlugin == "kotlin-maven-plugin") { - def filtered = removePaths(line, basedir).replace("\\", "/").replaceAll(/[0-9]+\s*ms/, "LLL ms").trim().replaceAll(/^\[[A-Z]+\]$/, "").replaceAll(/version [0-9\.]+/, "version @snapshot@") + def filtered = removePaths(line, basedir). + replace("\\", "/"). + replaceAll(/[0-9]+\s*ms/, "LLL ms"). + trim(). + replaceAll(/^\[[A-Z]+\]$/, ""). + replaceAll(/version [0-9\.]+/, "version @snapshot@") + if (filtered != "") { acc.lines << filtered }