diff options
author | Jesper Dangaard Brouer <brouer@redhat.com> | 2020-07-01 23:44:12 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-07-02 00:22:13 +0200 |
commit | 643e7233aa948901dce81d4573c91ed99fdd272e (patch) | |
tree | 588690946a045ae94d3d9f12f4f516015cc4dca1 /tools/testing/selftests/bpf/test_progs.h | |
parent | selftests/bpf: Test_progs indicate to shell on non-actions (diff) | |
download | linux-643e7233aa948901dce81d4573c91ed99fdd272e.tar.xz linux-643e7233aa948901dce81d4573c91ed99fdd272e.zip |
selftests/bpf: Test_progs option for getting number of tests
It can be practial to get the number of tests that test_progs contain.
This could for example be used to create a shell for-loop construct that
runs the individual tests.
Like:
for N in $(seq 1 $(./test_progs -c)); do
./test_progs -n $N 2>&1 > result_test_${N}.log &
done ; wait
V2: Add the ability to return the count for the selected tests. This is
useful for getting a count e.g. after excluding some tests with option -b.
The current beakers test script like to report the max test count upfront.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159363985244.930467.12617117873058936829.stgit@firesoul
Diffstat (limited to 'tools/testing/selftests/bpf/test_progs.h')
-rw-r--r-- | tools/testing/selftests/bpf/test_progs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h index f4503c926aca..0030584619c3 100644 --- a/tools/testing/selftests/bpf/test_progs.h +++ b/tools/testing/selftests/bpf/test_progs.h @@ -66,6 +66,7 @@ struct test_env { enum verbosity verbosity; bool jit_enabled; + bool get_test_cnt; struct prog_test_def *test; FILE *stdout; |