selftests/bpf: Extract parse_num_list into generic testing_helpers.c

Add testing_helpers.c, which will contain generic helpers for test runners and
tests needing some common generic functionality, like parsing a set of
numbers.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200512192445.2351848-2-andriin@fb.com
This commit is contained in:
Andrii Nakryiko
2020-05-12 12:24:42 -07:00
committed by Alexei Starovoitov
parent fd9eef1a13
commit cd49291ce1
5 changed files with 78 additions and 64 deletions

View File

@@ -0,0 +1,5 @@
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
/* Copyright (C) 2020 Facebook, Inc. */
#include <stdbool.h>
int parse_num_list(const char *s, bool **set, int *set_len);