blob: 20e6a2a113b84329778180240756ba340a5195a2 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Joe Hershberger11dd7cc2015-05-20 14:27:28 -05002/*
3 * (C) Copyright 2015
4 * Joe Hershberger, National Instruments, joe.hershberger@ni.com
Joe Hershberger11dd7cc2015-05-20 14:27:28 -05005 */
6
7#ifndef __TEST_SUITES_H__
8#define __TEST_SUITES_H__
9
Simon Glassed38aef2020-05-10 11:40:03 -060010struct cmd_tbl;
Simon Glass81cbe1c2017-11-25 11:57:29 -070011struct unit_test;
12
Simon Glass78fd76b2025-01-20 14:25:33 -070013/* 'command' functions normally called do_xxx where xxx is the command name */
14typedef int (*ut_cmd_func)(struct cmd_tbl *cmd, int flags, int argc,
15 char *const argv[]);
16
Simon Glass81cbe1c2017-11-25 11:57:29 -070017/**
18 * cmd_ut_category() - Run a category of unit tests
19 *
20 * @name: Category name
Philippe Reynes1f99f842019-12-17 19:07:04 +010021 * @prefix: Prefix of test name
Simon Glass81cbe1c2017-11-25 11:57:29 -070022 * @tests: List of tests to run
23 * @n_ents: Number of tests in @tests
Heinrich Schuchardtd41a3822018-08-27 22:04:10 +020024 * @argc: Argument count provided. Must be >= 1. If this is 1 then all
Simon Glass81cbe1c2017-11-25 11:57:29 -070025 * tests are run, otherwise only the one named @argv[1] is run.
26 * @argv: Arguments: argv[1] is the test to run (if @argc >= 2)
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010027 * Return: 0 if OK, CMD_RET_FAILURE on failure
Simon Glass81cbe1c2017-11-25 11:57:29 -070028 */
Philippe Reynes1f99f842019-12-17 19:07:04 +010029int cmd_ut_category(const char *name, const char *prefix,
30 struct unit_test *tests, int n_ents,
Simon Glassed38aef2020-05-10 11:40:03 -060031 int argc, char *const argv[]);
Simon Glass81cbe1c2017-11-25 11:57:29 -070032
Simon Glassb255efc2022-04-24 23:31:24 -060033int do_ut_bootstd(struct cmd_tbl *cmdtp, int flag, int argc,
34 char *const argv[]);
Simon Glassed38aef2020-05-10 11:40:03 -060035int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
36int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc,
37 char *const argv[]);
Joe Hershberger9dc1d712015-05-20 14:27:29 -050038
Joe Hershberger11dd7cc2015-05-20 14:27:28 -050039#endif /* __TEST_SUITES_H__ */