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 <dsinclair@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
90f4939948
commit
cc74dc3dda
|
@ -806,7 +806,9 @@ func (r *runner) streamResults(wg *sync.WaitGroup, results chan result) {
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
fmt.Fprint(buf, statusColor[res.status])
|
fmt.Fprint(buf, statusColor[res.status])
|
||||||
if res.message != "" {
|
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 {
|
} else {
|
||||||
fmt.Fprintf(buf, "%v - %v", name, res.status)
|
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{
|
var statusColor = map[status]string{
|
||||||
pass: green,
|
pass: green,
|
||||||
warn: yellow,
|
warn: yellow,
|
||||||
skip: blue,
|
skip: cyan,
|
||||||
timeout: yellow,
|
timeout: yellow,
|
||||||
fail: red,
|
fail: red,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue