selftests/ftrace: Use colored output when available
authorDaniel Díaz <daniel.diaz@linaro.org>
Tue, 16 Oct 2018 17:02:20 +0000 (12:02 -0500)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 24 Oct 2018 20:49:37 +0000 (14:49 -0600)
commit8096fbcf55c0da535bdca9adab982ec0c5affb67
tree2163b004622369bec41ef9df44c042b640134497
parent0387662d1b6c5ad2950d8e94d5e380af3f15c05c
selftests/ftrace: Use colored output when available

If test is being directly executed (with stdout opened on the
terminal) and the terminal capabilities indicate enough
colors, then use the existing scheme of green, red, and blue
to show when tests pass, fail or end in a different way.

When running the tests redirecting the stdout, for instance,
to a file, then colors are not shown, thus producing a more
readable output.

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/ftrace/ftracetest