From cc74dc3dda8c45f66c891a6f4983f4ce772a00ea Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 25 Apr 2022 12:15:44 +0000 Subject: [PATCH] run-cts split output to only colour titles. Currently the entire block of output gets coloured in the CTS output. This can lead to giant blocks of red and green on the screen which is hard to read. This PR changes the output to only colour the title and leave the message the default colour. The skip colour of blue was changed to cyan as the blue was showing as red on my terminal which makes it appear as an error instead of a skip. Change-Id: Idb4fc053bb83c710871f75b997e1fc3e3fdea695 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/87679 Auto-Submit: Dan Sinclair Kokoro: Kokoro Reviewed-by: Ben Clayton Commit-Queue: Ben Clayton --- src/dawn/node/tools/src/cmd/run-cts/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dawn/node/tools/src/cmd/run-cts/main.go b/src/dawn/node/tools/src/cmd/run-cts/main.go index b83824fef7..4df63aabf8 100644 --- a/src/dawn/node/tools/src/cmd/run-cts/main.go +++ b/src/dawn/node/tools/src/cmd/run-cts/main.go @@ -806,7 +806,9 @@ func (r *runner) streamResults(wg *sync.WaitGroup, results chan result) { buf := &bytes.Buffer{} fmt.Fprint(buf, statusColor[res.status]) if res.message != "" { - fmt.Fprintf(buf, "%v - %v:\n%v", name, res.status, res.message) + fmt.Fprintf(buf, "%v - %v:\n", name, res.status) + fmt.Fprintf(buf, ansiReset) + fmt.Fprintf(buf, "%v", res.message) } else { fmt.Fprintf(buf, "%v - %v", name, res.status) } @@ -908,7 +910,7 @@ var statuses = []status{pass, warn, fail, skip, timeout} var statusColor = map[status]string{ pass: green, warn: yellow, - skip: blue, + skip: cyan, timeout: yellow, fail: red, }