selftests/bpf: Extract insert_test from parse_test_list
authorStephen Veiss <sveiss@meta.com>
Thu, 27 Apr 2023 22:53:32 +0000 (15:53 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 1 May 2023 22:30:02 +0000 (15:30 -0700)
commit0a5c0de8b66f9789422f04de7304e374a2ea8df5
treea70ff308869b998c772e29142121fc7c9ccb6fcb
parentc39028b333f3a3a765c5c0b9726b8e38aedf0ba1
selftests/bpf: Extract insert_test from parse_test_list

Split the logic to insert new tests into test filter sets out from
parse_test_list.

Fix the subtest insertion logic to reuse an existing top-level test
filter, which prevents the creation of duplicate top-level test filters
each with a single subtest.

Signed-off-by: Stephen Veiss <sveiss@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20230427225333.3506052-2-sveiss@meta.com
tools/testing/selftests/bpf/prog_tests/arg_parsing.c
tools/testing/selftests/bpf/testing_helpers.c