Modify test names in gtest xml output (#4463)
This commit is contained in:
committed by
GitHub
parent
cf9f9fe4bb
commit
bcb638cf57
@@ -153,6 +153,7 @@ open class LinkNativeTest @Inject constructor(
|
|||||||
|
|
||||||
fun createTestTask(
|
fun createTestTask(
|
||||||
project: Project,
|
project: Project,
|
||||||
|
testName: String,
|
||||||
testTaskName: String,
|
testTaskName: String,
|
||||||
testedTaskNames: List<String>,
|
testedTaskNames: List<String>,
|
||||||
configureCompileToBitcode: CompileToBitcode.() -> Unit = {},
|
configureCompileToBitcode: CompileToBitcode.() -> Unit = {},
|
||||||
@@ -240,5 +241,14 @@ fun createTestTask(
|
|||||||
doFirst {
|
doFirst {
|
||||||
workingDir.mkdirs()
|
workingDir.mkdirs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
// TODO: Better to use proper XML parsing.
|
||||||
|
var contents = xmlReport.readText()
|
||||||
|
contents = contents.replace("<testsuite name=\"", "<testsuite name=\"${testName}.")
|
||||||
|
contents = contents.replace("classname=\"", "classname=\"${testName}.")
|
||||||
|
val rewrittenReport = workingDir.resolve("report-with-prefixes.xml")
|
||||||
|
rewrittenReport.writeText(contents)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ bitcode {
|
|||||||
targetList.forEach { targetName ->
|
targetList.forEach { targetName ->
|
||||||
createTestTask(
|
createTestTask(
|
||||||
project,
|
project,
|
||||||
|
"StdAlloc",
|
||||||
"${targetName}StdAllocRuntimeTests",
|
"${targetName}StdAllocRuntimeTests",
|
||||||
listOf(
|
listOf(
|
||||||
"${targetName}Runtime",
|
"${targetName}Runtime",
|
||||||
@@ -110,6 +111,7 @@ targetList.forEach { targetName ->
|
|||||||
|
|
||||||
createTestTask(
|
createTestTask(
|
||||||
project,
|
project,
|
||||||
|
"Mimalloc",
|
||||||
"${targetName}MimallocRuntimeTests",
|
"${targetName}MimallocRuntimeTests",
|
||||||
listOf(
|
listOf(
|
||||||
"${targetName}Runtime",
|
"${targetName}Runtime",
|
||||||
|
|||||||
Reference in New Issue
Block a user