@@ -7,7 +7,11 @@ import com.intellij.execution.testframework.sm.SMCustomMessagesParsing
7
7
import com .intellij .execution .testframework .sm .runner .OutputToGeneralTestEventsConverter
8
8
import com .intellij .util .ReflectionUtil
9
9
import jetbrains .buildServer .messages .serviceMessages ._
10
- import org .jetbrains .plugins .scala .testingSupport .test .{AbstractTestRunConfiguration , ScalaTestFrameworkConsoleProperties }
10
+ import org .jetbrains .plugins .scala .testingSupport .test .{
11
+ AbstractTestFramework ,
12
+ AbstractTestRunConfiguration ,
13
+ ScalaTestFrameworkConsoleProperties
14
+ }
11
15
12
16
import java .io .PrintStream
13
17
import scala .util .control .NoStackTrace
@@ -35,17 +39,26 @@ private[zio] class ZTestFrameworkConsoleProperties(configuration: AbstractTestRu
35
39
.get(self)
36
40
.asInstanceOf [ServiceMessageVisitor ]
37
41
38
- private lazy val testVisitor = new ZTestVisitor (underlyingTestVisitor)
42
+ private lazy val testVisitor = new ZTestVisitor (underlyingTestVisitor, configuration.testFramework )
39
43
40
44
override def processServiceMessage (message : ServiceMessage , visitor : ServiceMessageVisitor ): Unit =
41
45
message.visit(testVisitor)
42
46
43
47
}
44
48
45
- private class ZTestVisitor (underlying : ServiceMessageVisitor ) extends DefaultServiceMessageVisitor {
46
- private val regexFromHell =
49
+ private class ZTestVisitor (underlying : ServiceMessageVisitor , testFramework : AbstractTestFramework )
50
+ extends DefaultServiceMessageVisitor {
51
+ private val regexFromHellZio1 =
47
52
raw " \[1m.\[34m([\s\S]*).\[0m.\[0m.*\[31mwas not equal to.*\[1m.\[34m([\s\S]*?).\[0m.\[0m " .r
48
53
54
+ private val regexFromHellZio2 =
55
+ raw " \[1m.\[34m([\s\S]*).\[0m.\[0m.*\[31mwas not equal to.\[0m..\[1m.\[34m([\s\S]*).\[0m.\[0m\s+.\[1m " .r
56
+
57
+ private val regexFromHell = testFramework match {
58
+ case _ : Zio1TestFramework => regexFromHellZio1
59
+ case _ : Zio2TestFramework => regexFromHellZio2
60
+ }
61
+
49
62
override def visitTestFailed (testFailed : TestFailed ): Unit = {
50
63
val details = testFailed.getStacktrace
51
64
val tf = regexFromHell
0 commit comments