Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Also print test name in subtest status message

This patch add test name in subtest status message line, making it possible to
grep ':OK' in the output to generate a list of passed test+subtest names, which
can be processed to generate argument list to be used with "-a", "-d" exact
string matching.

Example:

#1/1 align/mov:OK
..
#1/12 align/pointer variable subtraction:OK
#1 align:OK

Signed-off-by: Yucong Sun <fallentree@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210817044732.3263066-4-fallentree@fb.com

authored by

Yucong Sun and committed by
Andrii Nakryiko
99c4fd8b f667d1d6

+2 -2
+2 -2
tools/testing/selftests/bpf/test_progs.c
··· 150 150 151 151 dump_test_log(test, sub_error_cnt); 152 152 153 - fprintf(env.stdout, "#%d/%d %s:%s\n", 154 - test->test_num, test->subtest_num, test->subtest_name, 153 + fprintf(env.stdout, "#%d/%d %s/%s:%s\n", 154 + test->test_num, test->subtest_num, test->test_name, test->subtest_name, 155 155 sub_error_cnt ? "FAIL" : (test->skip_cnt ? "SKIP" : "OK")); 156 156 157 157 if (sub_error_cnt)