1 /* Copyright (c) 2023 Nordic Semiconductor ASA
2 * SPDX-License-Identifier: Apache-2.0
3 */
4
5 #include "common.h"
6
7 #include "bs_cmd_line.h"
8
9 #define SAMPLE_DATA_SET_SIZE 2
10 static const struct test_sample_data *sample_data_set[] = {
11 &sample_data_1,
12 &sample_data_2,
13 };
14 BUILD_ASSERT(ARRAY_SIZE(sample_data_set) == SAMPLE_DATA_SET_SIZE);
15
16 const struct test_sample_data *sample_data;
17
18 int data_set;
19
test_args_parse(int argc,char * argv[])20 void test_args_parse(int argc, char *argv[])
21 {
22 bs_args_struct_t args_struct[] = {
23 {
24 .dest = &data_set,
25 .type = 'i',
26 .name = "{1, 2}",
27 .option = "data-set",
28 .descript = "Sample data set ID",
29 },
30 };
31
32 bs_args_parse_all_cmd_line(argc, argv, args_struct);
33
34 if (data_set < 1 || data_set > SAMPLE_DATA_SET_SIZE) {
35 data_set = 1;
36 }
37
38 sample_data = sample_data_set[data_set - 1];
39 }
40