Message ID | 20210810212107.2237868-5-fallentree@fb.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | selftests/bpf: Improve the usability of test_progs | expand |
On Tue, Aug 10, 2021 at 2:21 PM Yucong Sun <fallentree@fb.com> wrote: > > 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: $sudo ./test_progs -a 'xdp*' 2>/dev/null | grep ":OK" | cut -d":" -f 1 > | cut -d" " -f2- | paste -s -d, > xdp_adjust_tail/xdp_adjust_tail_shrink,xdp,xdp_devmap_attach/Verifier check of > DEVMAP programs,xdp_info,xdp_noinline,xdp_perf This looks a bit like a mess in the commit log. I think it's a bit more useful if you just paste a few lines of the new output format as is, with no post-processing. But overall it makes sense. I remember Alexei thought that it's unnecessary verbosity, but since then I often found it useful to be able to know the full test/subtest specifier, so I'm all for it. > > Signed-off-by: Yucong Sun <fallentree@fb.com> > --- > tools/testing/selftests/bpf/test_progs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c > index af43e206a806..23e4ea51f9e7 100644 > --- a/tools/testing/selftests/bpf/test_progs.c > +++ b/tools/testing/selftests/bpf/test_progs.c > @@ -182,8 +182,8 @@ void test__end_subtest() > > dump_test_log(test, sub_error_cnt); > > - fprintf(env.stdout, "#%d/%d %s:%s\n", > - test->test_num, test->subtest_num, test->subtest_name, > + fprintf(env.stdout, "#%d/%d %s/%s:%s\n", > + test->test_num, test->subtest_num, test->test_name, test->subtest_name, > sub_error_cnt ? "FAIL" : (test->skip_cnt ? "SKIP" : "OK")); > > if (sub_error_cnt) > -- > 2.30.2 >
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index af43e206a806..23e4ea51f9e7 100644 --- a/tools/testing/selftests/bpf/test_progs.c +++ b/tools/testing/selftests/bpf/test_progs.c @@ -182,8 +182,8 @@ void test__end_subtest() dump_test_log(test, sub_error_cnt); - fprintf(env.stdout, "#%d/%d %s:%s\n", - test->test_num, test->subtest_num, test->subtest_name, + fprintf(env.stdout, "#%d/%d %s/%s:%s\n", + test->test_num, test->subtest_num, test->test_name, test->subtest_name, sub_error_cnt ? "FAIL" : (test->skip_cnt ? "SKIP" : "OK")); if (sub_error_cnt)
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: $sudo ./test_progs -a 'xdp*' 2>/dev/null | grep ":OK" | cut -d":" -f 1 | cut -d" " -f2- | paste -s -d, xdp_adjust_tail/xdp_adjust_tail_shrink,xdp,xdp_devmap_attach/Verifier check of DEVMAP programs,xdp_info,xdp_noinline,xdp_perf Signed-off-by: Yucong Sun <fallentree@fb.com> --- tools/testing/selftests/bpf/test_progs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)