[Gradle, K/N] Fix native test execution test on Macs

上级 8588412a
......@@ -694,11 +694,11 @@ class GeneralNativeIT : BaseGradleIT() {
assertTasksSkipped(*testsToSkip.toTypedArray())
fun assertStacktrace(taskName: String) {
fun assertStacktrace(taskName: String, targetName: String) {
val testReport = projectDir.resolve("build/test-results/$taskName/TEST-org.foo.test.TestKt.xml")
val stacktrace = SAXBuilder().build(testReport).rootElement
.getChildren("testcase")
.single { it.getAttribute("name").value == "fail" }
.single { it.getAttribute("name").value == "fail" || it.getAttribute("name").value == "fail[$targetName]" }
.getChild("failure")
.text
assertTrue(stacktrace.contains("""at org\.foo\.test#fail\(.*test\.kt:24\)""".toRegex()))
......@@ -741,7 +741,7 @@ class GeneralNativeIT : BaseGradleIT() {
expectedTestResults[1],
"iosTest"
)
assertStacktrace("iosTest")
assertStacktrace("iosTest", "ios")
}
}
}
......
......@@ -4,7 +4,7 @@
<properties/>
<testcase name="fooTest[ios]" classname="org.foo.test.TestKt" time="..."/>
<testcase name="barTest[ios]" classname="org.foo.test.TestKt" time="..."/>
<testcase name="fail[ios" classname="org.foo.test.TestKt" time="...">
<testcase name="fail[ios]" classname="org.foo.test.TestKt" time="...">
<failure message="..." type="kotlin.IllegalStateException">...</failure>
</testcase>
<system-out><![CDATA[Foo call
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册