Module: tools Branch: master Commit: 40748a90e2d474243c60150193224f51ab848642 URL: https://gitlab.winehq.org/winehq/tools/-/commit/40748a90e2d474243c6015019322...
Author: Francois Gouget fgouget@codeweavers.com Date: Wed Nov 2 16:44:06 2022 +0100
winetest: Follow the link on clicks anywhere in the cells.
It's easier than hitting the (sometimes) single character in the middle of the cell to go to the results / build / test index page.
---
winetest/build-index | 6 +++--- winetest/gather | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/winetest/build-index b/winetest/build-index index 14f1ffa7..c6bc5a95 100755 --- a/winetest/build-index +++ b/winetest/build-index @@ -431,7 +431,7 @@ foreach my $build (@builds) $title .= ", $todos have todos" if ($todos); my $class = $errors ? ($successes ? "mixed" : "fail") . ($todos ? " also-todo" : "") : ($todos ? "todo" : "pass"); - printf OUT "<td class="result %s"><a title="%s" href="%s">%u</a></td>", $class, $title, $href, $errors || $todos; + printf OUT "<td class="result %s" onclick="location.href='%s'"><a title="%s" href="%s">%u</a></td>", $class, $href, $title, $href, $errors || $todos; $total_runs++; $total_tests += $tests; $total_errors += $errors; @@ -443,8 +443,8 @@ foreach my $build (@builds) my $class = $total_errors ? "fail" : $total_todos ? "pass also-todo" : "pass"; my $title = sprintf "%u test runs, %u total unit tests, %u have errors", $total_runs, $total_tests, $total_errors; $title .= ", $total_todos have todos" if $total_todos; - printf OUT "\n <td> </td><td class="result %s"><a title="%s" href="%s">%4.1f%%</a></td><td> </td>\n", - $class, $title, $build->{name}, $total_errors * 100 / $total_tests; + printf OUT "\n <td> </td><td class="result %s" onclick="location.href='%s'"><a title="%s" href="%s">%4.1f%%</a></td><td> </td>\n", + $class, $build->{name}, $title, $build->{name}, $total_errors * 100 / $total_tests; } else { diff --git a/winetest/gather b/winetest/gather index e822eec8..736f4ad8 100755 --- a/winetest/gather +++ b/winetest/gather @@ -762,14 +762,17 @@ sub singletest($$$) { $msg = $status2label{$status} || "unknown"; } $title = join(" | ", $prefix, $title); - printf OUT " <td class="%s"><a %s %s>%s</a></td>\n", - $class, $href ? "href="$href"" : "", - "title="$title"", $msg; + printf OUT " <td class="%s"%s><a%s title="%s">%s</a></td>\n", + $class, $href ? " onclick="location.href='$href'"" : "", + $href ? " href="$href"" : "", $title, $msg; if ($group->{reports}) { - printf SUMMARY "%s %s <td class="%s"><a %s %s>%s</a></td>\n", - $testname, $groupname, $class, $href ? "href="../$build/$href"" : "", - "title="$title"", $msg; + $href = "../$build/$href"; + printf SUMMARY "%s %s <td class="%s"%s><a%s title="%s">%s</a></td>\n", + $testname, $groupname, $class, + $href ? " onclick="location.href='$href'"" : "", + $href ? " href="$href"" : "", + $title, $msg; } }
@@ -856,7 +859,7 @@ EOF my $source = $alltests{$testname}; my $class = get_result_class( $test_results{$testname}->{$group_name} ); my $title = get_result_title( $testname, $test_results{$testname}->{$group_name} ); - print OUT " <tr>\n <td class="test $class">\n"; + print OUT " <tr>\n <td class="test $class" onclick="location.href='../tests/$testname.html'">\n"; print OUT " <a href="../tests/$testname.html" name="$testname" title="$title">$testname</a></td><td> </td>\n"; if (defined $group) {