From cb053efe77ced64b8d79e7ea8de3c47f12933bf2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 21 Oct 2025 01:36:01 +0100 Subject: [PATCH] Fix duplicate failure reporting in auto sections --- util/test/rdtest/logging.py | 3 +++ util/test/rdtest/testresults.js | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/util/test/rdtest/logging.py b/util/test/rdtest/logging.py index d450d3a91..854804003 100644 --- a/util/test/rdtest/logging.py +++ b/util/test/rdtest/logging.py @@ -129,6 +129,9 @@ class TestLogger: self.rawprint("!! " + message) def failure(self, ex): + if self.section_failed: + return + self.failed = self.section_failed = True if ex is TestFailureException: diff --git a/util/test/rdtest/testresults.js b/util/test/rdtest/testresults.js index 256eb8198..81eb3a307 100644 --- a/util/test/rdtest/testresults.js +++ b/util/test/rdtest/testresults.js @@ -79,6 +79,7 @@ document.body.onload = function() { var commit = "v1.x"; var basepath = "util/test/"; var last_test = ''; + var unwind_failure_indent = 0; for(var i=0; i < lines.length; i++) { var line = lines[i].replace(/\t/g, ' '); @@ -113,11 +114,7 @@ document.body.onload = function() { html += '
' + htmlEntityEncode(m[2]) + ''; } else if(m[1] == '!-') { html += '
'; - while(indent > 4) - { - indent -= 4; - html += ''; - } + unwind_failure_indent = indent; } else if(m[1] == '!!') { html += '
' + htmlEntityEncode(m[2]) + '
'; } else if(m[1] == '**') { @@ -191,6 +188,17 @@ document.body.onload = function() { html += start ? ''; instack = start; } else if(words[0] == 'Test') { + while(!start && unwind_failure_indent > 4) + { + unwind_failure_indent -= 4; + html += ''; + + if(!start && unwind_failure_indent <= 4) { + html += '
'; + unwind_failure_indent = 0; + } + } + test_name = words[1]; test_list.push(test_name) html += start ? '';