Guys, sorry about that. For some reason when I run sudo make kselftest
the colors don't show up, but if I run the test alone, the colors do
show up, like this: sudo
tools/testing/selftests/net/mptcp/mptcp_join.sh
I've tried sudo TERM=xterm-256color make kselftest ; sudo make kselftest | cat ;
but it didn't work.
Anyway, thanks a lot for the feedback, time and patience :D
Em qui., 13 de fev. de 2025 às 20:31, Bird, Tim <Tim.Bird@sony.com> escreveu:
I'm confused. Did you look at the implementation of
mptcp_lib_print_ok()? It looks like this:
mptcp_lib_print_ok() {
mptcp_lib_print_color "${MPTCP_LIB_COLOR_GREEN}${*}"
}
So it looks like this should already be colored.
If there's something broken here, I would take a look at 747ba8783a33
("selftests: mptcp: print test results with colors") and cc the author
when fixing it.
I'm confused about why we need this patch, but some overall hints:
Run "git log --oneline tools/testing/selftests/net/mptcp/mptcp_lib.sh"
and make your subject line match the prefixes and overall style:
$ git log --oneline tools/testing/selftests/net/mptcp/mptcp_lib.sh
5fbea888f8aa ("selftests: mptcp: add -m with ss in case of errors")
8c6bb011e188 ("selftests: mptcp: move stats info in case of errors to lib.sh")
f58817c852e9 ("selftests: mptcp: lib: add time per subtests in TAP output")
20ccc7c5f7a3 ("selftests: mptcp: join: validate event numbers")
464b99e77b3d ("selftests: mptcp: lib: fix shellcheck errors")
1af3bc912eac ("selftests: mptcp: lib: use wait_local_port_listen helper")
f265d3119a29 ("selftests: mptcp: lib: use setup/cleanup_ns helpers")
5597613fb3cf ("selftests: mptcp: lib: support flaky subtests")
...
So your subject line should probably be:
selftests: mptcp: lib: add colors to kselftest output
One could argue for "selftests: mptcp:", but generally those touch
multiple files.
This should not be done unconditionally, but based on the controlling
and COLOR variables for this library. You should also re-used the existing
color print helper function.
IOW, why is this not using MPTCP_LIB_COLOR_GREEN?
or the helper function mptcp_lib_print_color()?