Fix GitHub workflow

pull/197/head
Koitharu 3 years ago
parent b8f0ea4690
commit da4566f82f
No known key found for this signature in database
GPG Key ID: 8E861F8CE6E7CE27

@ -69,6 +69,4 @@ dependencies {
testImplementation 'io.webfolder:quickjs:1.1.0'
}
tasks.register('generateTestsReport', ReportGenerateTask) {
dependsOn test
}
tasks.register('generateTestsReport', ReportGenerateTask)

@ -42,10 +42,13 @@ open class ReportGenerateTask : DefaultTask() {
val results = LinkedHashMap<String, LinkedHashMap<String, TestCase>>()
val tests = LinkedHashSet<String>()
for (case in testSuite.testCases) {
if (!case.isValid()) {
continue
}
tests.add(case.testName)
val map = results.getOrPut(case.source) { LinkedHashMap() }
val oldValue = map.put(case.testName, case)
check(oldValue == null)
check(oldValue == null) { "Check failed: $oldValue" }
}
val failPercent = (testSuite.failures.toDouble() / testSuite.tests * 100.0).roundToInt()

@ -19,14 +19,16 @@ class TestCase {
var failure: Failure? = null
val index by lazy {
name.split('|')[0].toInt()
name.split('|').getOrNull(0)?.toIntOrNull() ?: 0
}
val testName by lazy {
name.split('|')[1]
name.split('|').getOrNull(1).orEmpty()
}
val source by lazy {
name.split('|')[2]
name.split('|').getOrNull(2).orEmpty()
}
fun isValid() = name.count { it == '|' } == 2
}
Loading…
Cancel
Save