bpf/selftests: Add granular subtest output for prog_test
authorMykola Lysenko <mykolal@fb.com>
Wed, 27 Apr 2022 04:13:53 +0000 (21:13 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 28 Apr 2022 02:03:58 +0000 (19:03 -0700)
commit0925225956bbef863d51ee882d4d20c9a9c90db2
tree9b4e346fafe58dbfa2e60031c669455fa68a743f
parent50c6afabfd2ae91a4ff0e2feb14fe702b0688ec5
bpf/selftests: Add granular subtest output for prog_test

Implement per subtest log collection for both parallel
and sequential test execution. This allows granular
per-subtest error output in the 'All error logs' section.
Add subtest log transfer into the protocol during the
parallel test execution.

Move all test log printing logic into dump_test_log
function. One exception is the output of test names when
verbose printing is enabled. Move test name/result
printing into separate functions to avoid repetition.

Print all successful subtest results in the log. Print
only failed test logs when test does not have subtests.
Or only failed subtests' logs when test has subtests.

Disable 'All error logs' output when verbose mode is
enabled. This functionality was already broken and is
causing confusion.

Signed-off-by: Mykola Lysenko <mykolal@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220427041353.246007-1-mykolal@fb.com
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_progs.h