Francois Gouget : winetest/build-patterns: Show failure counts <= 9 when over a pattern.

Alexandre Julliard julliard at winehq.org
Thu May 5 13:48:31 CDT 2022


Module: tools
Branch: master
Commit: b7387722ec5c12b237b7a597d105e92e0465de6a
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=b7387722ec5c12b237b7a597d105e92e0465de6a

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu May  5 16:57:26 2022 +0200

winetest/build-patterns: Show failure counts <= 9 when over a pattern.

The failure count can help distinguish the failure counts when there are
many different values. But this makes the patterns more noisy so only
show them when hovering over the pattern.
Also each build result only gets one character so this is only possible
if the failure count is 9 or less.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 winetest/build-patterns |  4 ++++
 winetest/patterns.js    | 21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/winetest/build-patterns b/winetest/build-patterns
index b6e5531..7acb153 100755
--- a/winetest/build-patterns
+++ b/winetest/build-patterns
@@ -975,6 +975,10 @@ sub get_status_html($$)
 
     return @{$status2html{$status}} if ($status2html{$status});
 
+    if ($status =~ /^[1-9]$/)
+    {
+        return ("F", "F", "$status failures", "t", " fcount='$status' style='background-color: $failcolors->{$status}'");
+    }
     if ($status =~ /^[0-9]+$/)
     {
         return ("F", "F", "$status failures", "t", " style='background-color: $failcolors->{$status}'");
diff --git a/winetest/patterns.js b/winetest/patterns.js
index 65e9cb8..4591903 100644
--- a/winetest/patterns.js
+++ b/winetest/patterns.js
@@ -170,6 +170,24 @@ function toggledReportCB(e)
     refreshPage(changes);
 }
 
+function showRangeCounts(e)
+{
+    const domtest = e.target.closest("div.testfile");
+    domtest.querySelectorAll(":scope [fcount]").forEach(frange => {
+        const fcount = frange.getAttribute("fcount");
+        frange.innerHTML = fcount.repeat(frange.innerHTML.length);
+    });
+}
+
+function hideRangeCounts(e)
+{
+    const domtest = e.target.closest("div.testfile");
+    domtest.querySelectorAll(":scope [fcount]").forEach(frange => {
+        const fcount = frange.getAttribute("fcount");
+        frange.innerHTML = "F".repeat(frange.innerHTML.length);
+    });
+}
+
 function init()
 {
     hide_reruns = false; /* reruns are shown by default */
@@ -225,6 +243,9 @@ function init()
                 cb.patlines.push(patline);
                 test.patlines.push(patline);
                 if (cb.checked) test.linecount++;
+                const pattern = domline.querySelector("div.pattern");
+                pattern.addEventListener('mouseenter', showRangeCounts);
+                pattern.addEventListener('mouseleave', hideRangeCounts);
             }
         });
         if (test.linecount < test.patlines.length)




More information about the wine-cvs mailing list