Modify test names in gtest xml output (#4463)

This commit is contained in:
Alexander Shabalin
2020-10-23 12:07:15 +03:00
committed by GitHub
parent cf9f9fe4bb
commit bcb638cf57
2 changed files with 12 additions and 0 deletions
@@ -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)
}
}
}
+2
View File
@@ -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",