]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
c617ede0 JH |
2 | /* |
3 | * (C) Copyright 2015 | |
4 | * Joe Hershberger, National Instruments, [email protected] | |
c617ede0 JH |
5 | */ |
6 | ||
7 | #ifndef __TEST_SUITES_H__ | |
8 | #define __TEST_SUITES_H__ | |
9 | ||
09140113 | 10 | struct cmd_tbl; |
4d869c1e | 11 | struct unit_test; |
bbff0b16 | 12 | struct unit_test_state; |
4d869c1e | 13 | |
7bbf2f79 | 14 | /* 'command' functions normally called do_xxx where xxx is the command name */ |
bbff0b16 SG |
15 | typedef int (*ut_cmd_func)(struct unit_test_state *uts, struct cmd_tbl *cmd, |
16 | int flags, int argc, char *const argv[]); | |
7bbf2f79 | 17 | |
4d869c1e SG |
18 | /** |
19 | * cmd_ut_category() - Run a category of unit tests | |
20 | * | |
bbff0b16 SG |
21 | * @uts: Unit-test state, which must be ready for use, i.e. ut_init_state() |
22 | * has been called. The caller is responsible for calling | |
23 | * ut_uninit_state() after this function returns | |
4d869c1e | 24 | * @name: Category name |
4ad4edfe | 25 | * @prefix: Prefix of test name |
4d869c1e SG |
26 | * @tests: List of tests to run |
27 | * @n_ents: Number of tests in @tests | |
4b0a2d3a | 28 | * @argc: Argument count provided. Must be >= 1. If this is 1 then all |
4d869c1e SG |
29 | * tests are run, otherwise only the one named @argv[1] is run. |
30 | * @argv: Arguments: argv[1] is the test to run (if @argc >= 2) | |
185f812c | 31 | * Return: 0 if OK, CMD_RET_FAILURE on failure |
4d869c1e | 32 | */ |
bbff0b16 SG |
33 | int cmd_ut_category(struct unit_test_state *uts, const char *name, |
34 | const char *prefix, struct unit_test *tests, int n_ents, | |
09140113 | 35 | int argc, char *const argv[]); |
4d869c1e | 36 | |
bbff0b16 SG |
37 | int do_ut_bootstd(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag, |
38 | int argc, char *const argv[]); | |
09140113 | 39 | int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]); |
bbff0b16 SG |
40 | int do_ut_overlay(struct unit_test_state *uts, struct cmd_tbl *cmdtp, int flag, |
41 | int argc, char *const argv[]); | |
40441e0b | 42 | |
c617ede0 | 43 | #endif /* __TEST_SUITES_H__ */ |