From 94de63d69ef0e7fc8e04675cd389766f7eaf9247 Mon Sep 17 00:00:00 2001 From: Harmin Date: Sun, 8 Oct 2023 09:49:32 +0200 Subject: [PATCH] Restore EMPTY status for multi-threaded tests report --- src/com/github/report4s/Listeners.java | 12 +++++++++--- src/com/github/report4s/Status.java | 1 + src/com/github/report4s/Utils.java | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/com/github/report4s/Listeners.java b/src/com/github/report4s/Listeners.java index 14b7dea..72ff784 100644 --- a/src/com/github/report4s/Listeners.java +++ b/src/com/github/report4s/Listeners.java @@ -517,7 +517,7 @@ private void print_rows() { suite_md.status); } if (suite_md.hasMutiThreads) - print_method_row(i+1, 0, "No support for multi-threaded tests", null, "", suite_md.filename, Status.UNKNOWN, suite_md.status); + print_method_row(i+1, 0, "No support for multi-threaded tests", null, "", suite_md.filename, Status.EMPTY, suite_md.status); } } @@ -580,8 +580,14 @@ private void print_method_row( " " + "\n" + " " + name + "" + "\n" + " " + time + "" + "\n" + - " details" + "\n" + - " " + "\n" + + " details" + "\n"); + if (status == Status.EMPTY) + HtmlWriter.println( + " " + "\n"); + else + HtmlWriter.println( + " " + "\n"); + HtmlWriter.println( " "); } diff --git a/src/com/github/report4s/Status.java b/src/com/github/report4s/Status.java index c0b4748..6e1ce28 100644 --- a/src/com/github/report4s/Status.java +++ b/src/com/github/report4s/Status.java @@ -10,4 +10,5 @@ enum Status { PASSED_WITH_WARNING, FAILED_WITHIN_PERCENTAGE, UNKNOWN, + EMPTY, //for multi-threaded tests } diff --git a/src/com/github/report4s/Utils.java b/src/com/github/report4s/Utils.java index 6689128..d2f6bd5 100644 --- a/src/com/github/report4s/Utils.java +++ b/src/com/github/report4s/Utils.java @@ -436,6 +436,10 @@ protected static String getStatusIconFilename(Status status) { case PASSED_WITH_WARNING: icon = "incomplete.png"; break; + case EMPTY: + // For multi-threaded tests + icon = ""; + break; default: // Should never happen! icon = "unknown.png";