Compilation errors are rendered to log without "Kotlin:ERROR:" prefix and without path to file. Sometimes javac adds path to file, sometimes doesn't. This had led tests to fail on some platforms.

Original commit: 9c880de735
This commit is contained in:
Evgeny Gerashchenko
2014-11-26 18:42:24 +03:00
parent 7c0dde0233
commit eb8820f549
13 changed files with 23 additions and 24 deletions
@@ -69,10 +69,9 @@ public abstract class AbstractIncrementalJpsTest : JpsBuildTestCase() {
val errorMessages =
buildResult
.getMessages(BuildMessage.Kind.ERROR)
.map { it.getMessageText() }
.map { it.replaceAll("^[^:]+:\\d+:\\s+", "") }
.joinToString("\n")
.replace(File.separatorChar, '/')
.replace("/" + workDirPath, "\$PROJECT") // Sometimes path is rendered as "/C:/foo/bar" on Windows
.replace(workDirPath, "\$PROJECT")
return logger.log + "$COMPILATION_FAILED\n" + errorMessages + "\n"
}
else {
@@ -9,5 +9,5 @@ src/class1.kt
src/class2.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Redeclaration: Klass
Kotlin:ERROR:Redeclaration: Klass
Redeclaration: Klass
Redeclaration: Klass
@@ -6,7 +6,7 @@ Compiling files:
src/usage.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Expecting an expression
Expecting an expression
Cleaning output files:
@@ -15,4 +15,4 @@ End of files
Compiling files:
src/fun.kt
src/usage.kt
End of files
End of files
@@ -6,9 +6,9 @@ Compiling files:
src/usage.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Expecting an expression
Expecting an expression
Compiling files:
src/usage.kt
End of files
End of files
@@ -6,6 +6,6 @@ Compiling files:
src/fun2.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Platform declaration clash: The following declarations have the same JVM signature (function(Ljava/util/List;)V):
Platform declaration clash: The following declarations have the same JVM signature (function(Ljava/util/List;)V):
fun function(list: kotlin.List<kotlin.Any>): kotlin.Unit
fun function(list: kotlin.List<kotlin.String>): kotlin.Unit
fun function(list: kotlin.List<kotlin.String>): kotlin.Unit
@@ -6,6 +6,6 @@ Compiling files:
src/fun2.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Platform declaration clash: The following declarations have the same JVM signature (function()V):
Platform declaration clash: The following declarations have the same JVM signature (function()V):
fun function(): kotlin.Unit
fun function(): kotlin.Unit
@@ -6,6 +6,6 @@ Compiling files:
src/prop2.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Platform declaration clash: The following declarations have the same JVM signature (getProperty()I):
Platform declaration clash: The following declarations have the same JVM signature (getProperty()I):
fun <get-property>(): kotlin.Int
fun <get-property>(): kotlin.Int
@@ -11,5 +11,5 @@ Compiling files:
src/Sub.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Cannot weaken access privilege 'public' for 'y' in 'Super'
Kotlin:ERROR:'y' hides member of supertype 'Super' and needs 'override' modifier
Cannot weaken access privilege 'public' for 'y' in 'Super'
'y' hides member of supertype 'Super' and needs 'override' modifier
@@ -15,4 +15,4 @@ src/willBeResolvedToOther.kt
src/willBeUnresolved.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Unresolved reference: f
Unresolved reference: f
@@ -17,7 +17,7 @@ src/usageWithFunctionExpression.kt
src/usageWithFunctionLiteral.kt
End of files
COMPILATION FAILED
Kotlin:ERROR:Expression 'SamInterface' cannot be invoked as a function. The function invoke() is not found
Kotlin:ERROR:Please specify constructor invocation; classifier 'SamInterface' does not have a class object
Kotlin:ERROR:Expression 'SamInterface' cannot be invoked as a function. The function invoke() is not found
Kotlin:ERROR:Please specify constructor invocation; classifier 'SamInterface' does not have a class object
Expression 'SamInterface' cannot be invoked as a function. The function invoke() is not found
Please specify constructor invocation; classifier 'SamInterface' does not have a class object
Expression 'SamInterface' cannot be invoked as a function. The function invoke() is not found
Please specify constructor invocation; classifier 'SamInterface' does not have a class object
@@ -9,6 +9,6 @@ Compiling files:
src/WillBeUnresolved.java
End of files
COMPILATION FAILED
java:ERROR:$PROJECT/src/WillBeUnresolved.java:3: cannot find symbol
cannot find symbol
symbol : method f(java.lang.String)
location: class test.TestPackage
@@ -8,4 +8,4 @@ Compiling files:
src/Sub.java
End of files
COMPILATION FAILED
java:ERROR:$PROJECT/src/Sub.java:2: y() in Sub cannot override y() in Super; overridden method is final
y() in Sub cannot override y() in Super; overridden method is final
@@ -9,6 +9,6 @@ Compiling files:
src/WillBeUnresolved.java
End of files
COMPILATION FAILED
java:ERROR:$PROJECT/src/WillBeUnresolved.java:3: cannot find symbol
cannot find symbol
symbol : method getProp()
location: class test.TestPackage
location: class test.TestPackage