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(
|
||||
project: Project,
|
||||
testName: String,
|
||||
testTaskName: String,
|
||||
testedTaskNames: List<String>,
|
||||
configureCompileToBitcode: CompileToBitcode.() -> Unit = {},
|
||||
@@ -240,5 +241,14 @@ fun createTestTask(
|
||||
doFirst {
|
||||
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 ->
|
||||
createTestTask(
|
||||
project,
|
||||
"StdAlloc",
|
||||
"${targetName}StdAllocRuntimeTests",
|
||||
listOf(
|
||||
"${targetName}Runtime",
|
||||
@@ -110,6 +111,7 @@ targetList.forEach { targetName ->
|
||||
|
||||
createTestTask(
|
||||
project,
|
||||
"Mimalloc",
|
||||
"${targetName}MimallocRuntimeTests",
|
||||
listOf(
|
||||
"${targetName}Runtime",
|
||||
|
||||
Reference in New Issue
Block a user