mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 03:15:00 +00:00
test: Drop the _test suffix on linker lists
Most test suites have a _test suffix. This is not necessary as there is also a ut_ prefix. Drop the suffix so that (with future work) the suite name can be used as the linker-list name. Remove the suffix from the pytest regex as well, moving it to the top of the file, as it is a constant. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
c16b388ea8
commit
4ba3ab4901
36 changed files with 81 additions and 79 deletions
|
@ -143,7 +143,7 @@ extern struct unit_test_state global_dm_test_state;
|
||||||
|
|
||||||
/* Declare a new driver model test */
|
/* Declare a new driver model test */
|
||||||
#define DM_TEST(_name, _flags) \
|
#define DM_TEST(_name, _flags) \
|
||||||
UNIT_TEST(_name, UTF_DM | UTF_CONSOLE | (_flags), dm_test)
|
UNIT_TEST(_name, UTF_DM | UTF_CONSOLE | (_flags), dm)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct sandbox_sdl_plat - Platform data for the SDL video driver
|
* struct sandbox_sdl_plat - Platform data for the SDL video driver
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
|
|
||||||
/* Declare a new common function test */
|
/* Declare a new common function test */
|
||||||
#define COMMON_TEST(_name, _flags) UNIT_TEST(_name, _flags, common_test)
|
#define COMMON_TEST(_name, _flags) UNIT_TEST(_name, _flags, common)
|
||||||
|
|
||||||
#endif /* __TEST_COMMON_H__ */
|
#endif /* __TEST_COMMON_H__ */
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
|
|
||||||
/* Declare a new environment test */
|
/* Declare a new environment test */
|
||||||
#define ENV_TEST(_name, _flags) UNIT_TEST(_name, _flags, env_test)
|
#define ENV_TEST(_name, _flags) UNIT_TEST(_name, _flags, env)
|
||||||
|
|
||||||
#endif /* __TEST_ENV_H__ */
|
#endif /* __TEST_ENV_H__ */
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
|
|
||||||
/* Declare a new environment test */
|
/* Declare a new environment test */
|
||||||
#define HUSH_TEST(_name, _flags) UNIT_TEST(_name, _flags, hush_test)
|
#define HUSH_TEST(_name, _flags) UNIT_TEST(_name, _flags, hush)
|
||||||
|
|
||||||
#endif /* __TEST_HUSH_H__ */
|
#endif /* __TEST_HUSH_H__ */
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
|
|
||||||
/* Declare a new library function test */
|
/* Declare a new library function test */
|
||||||
#define LIB_TEST(_name, _flags) UNIT_TEST(_name, _flags, lib_test)
|
#define LIB_TEST(_name, _flags) UNIT_TEST(_name, _flags, lib)
|
||||||
|
|
||||||
#endif /* __TEST_LIB_H__ */
|
#endif /* __TEST_LIB_H__ */
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
#define LOGF_TEST (BIT(LOGF_FUNC) | BIT(LOGF_MSG))
|
#define LOGF_TEST (BIT(LOGF_FUNC) | BIT(LOGF_MSG))
|
||||||
|
|
||||||
/* Declare a new logging test */
|
/* Declare a new logging test */
|
||||||
#define LOG_TEST(_name) UNIT_TEST(_name, UTF_CONSOLE, log_test)
|
#define LOG_TEST(_name) UNIT_TEST(_name, UTF_CONSOLE, log)
|
||||||
#define LOG_TEST_FLAGS(_name, _flags) \
|
#define LOG_TEST_FLAGS(_name, _flags) \
|
||||||
UNIT_TEST(_name, _flags | UTF_CONSOLE, log_test)
|
UNIT_TEST(_name, _flags | UTF_CONSOLE, log)
|
||||||
|
|
||||||
#endif /* __TEST_LOG_H__ */
|
#endif /* __TEST_LOG_H__ */
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
|
|
||||||
/* Declare a new environment test */
|
/* Declare a new environment test */
|
||||||
#define OPTEE_TEST(_name, _flags) UNIT_TEST(_name, _flags, optee_test)
|
#define OPTEE_TEST(_name, _flags) UNIT_TEST(_name, _flags, optee)
|
||||||
|
|
||||||
#endif /* __TEST_OPTEE_H__ */
|
#endif /* __TEST_OPTEE_H__ */
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
|
|
||||||
/* Declare a new environment test */
|
/* Declare a new environment test */
|
||||||
#define OVERLAY_TEST(_name, _flags) UNIT_TEST(_name, _flags, overlay_test)
|
#define OVERLAY_TEST(_name, _flags) UNIT_TEST(_name, _flags, overlay)
|
||||||
|
|
||||||
#endif /* __TEST_OVERLAY_H__ */
|
#endif /* __TEST_OVERLAY_H__ */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#define BOOTM_TEST(_name, _flags) UNIT_TEST(_name, _flags, bootm_test)
|
#define BOOTM_TEST(_name, _flags) UNIT_TEST(_name, _flags, bootm)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
BUF_SIZE = 1024,
|
BUF_SIZE = 1024,
|
||||||
|
@ -252,8 +252,8 @@ BOOTM_TEST(bootm_test_subst_both, 0);
|
||||||
|
|
||||||
int do_ut_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(bootm_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(bootm);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(bootm_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(bootm);
|
||||||
|
|
||||||
return cmd_ut_category("bootm", "bootm_test_", tests, n_ents,
|
return cmd_ut_category("bootm", "bootm_test_", tests, n_ents,
|
||||||
argc, argv);
|
argc, argv);
|
||||||
|
|
|
@ -96,8 +96,8 @@ void bootstd_reset_usb(void)
|
||||||
|
|
||||||
int do_ut_bootstd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_bootstd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(bootstd_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(bootstd);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(bootstd_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(bootstd);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = bootstd_setup_for_tests();
|
ret = bootstd_setup_for_tests();
|
||||||
|
@ -106,6 +106,6 @@ int do_ut_bootstd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return cmd_ut_category("bootstd", "bootstd_test_",
|
return cmd_ut_category("bootstd", "bootstd_", tests, n_ents,
|
||||||
tests, n_ents, argc, argv);
|
argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
#include <version_string.h>
|
#include <version_string.h>
|
||||||
|
|
||||||
/* Declare a new bootdev test */
|
/* Declare a new bootdev test */
|
||||||
#define BOOTSTD_TEST(_name, _flags) \
|
#define BOOTSTD_TEST(_name, _flags) UNIT_TEST(_name, _flags, bootstd)
|
||||||
UNIT_TEST(_name, _flags, bootstd_test)
|
|
||||||
|
|
||||||
#define NVDATA_START_BLK ((0x400 + 0x400) / MMC_MAX_BLOCK_LEN)
|
#define NVDATA_START_BLK ((0x400 + 0x400) / MMC_MAX_BLOCK_LEN)
|
||||||
#define VERSION_START_BLK ((0x400 + 0x800) / MMC_MAX_BLOCK_LEN)
|
#define VERSION_START_BLK ((0x400 + 0x800) / MMC_MAX_BLOCK_LEN)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
#define MEASUREMENT_TEST(_name, _flags) \
|
#define MEASUREMENT_TEST(_name, _flags) \
|
||||||
UNIT_TEST(_name, _flags, measurement_test)
|
UNIT_TEST(_name, _flags, measurement)
|
||||||
|
|
||||||
static int measure(struct unit_test_state *uts)
|
static int measure(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
|
@ -57,8 +57,8 @@ MEASUREMENT_TEST(measure, 0);
|
||||||
int do_ut_measurement(struct cmd_tbl *cmdtp, int flag, int argc,
|
int do_ut_measurement(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char *const argv[])
|
char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(measurement_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(measurement);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(measurement_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(measurement);
|
||||||
|
|
||||||
return cmd_ut_category("measurement", "measurement_test_", tests,
|
return cmd_ut_category("measurement", "measurement_test_", tests,
|
||||||
n_ents, argc, argv);
|
n_ents, argc, argv);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "bootstd_common.h"
|
#include "bootstd_common.h"
|
||||||
|
|
||||||
/* Declare a new upl test */
|
/* Declare a new upl test */
|
||||||
#define UPL_TEST(_name, _flags) UNIT_TEST(_name, _flags, upl_test)
|
#define UPL_TEST(_name, _flags) UNIT_TEST(_name, _flags, upl)
|
||||||
|
|
||||||
static int add_region(struct unit_test_state *uts, struct alist *lst,
|
static int add_region(struct unit_test_state *uts, struct alist *lst,
|
||||||
ulong base, ulong size)
|
ulong base, ulong size)
|
||||||
|
@ -429,8 +429,8 @@ UPL_TEST(upl_test_info_norun, UTF_CONSOLE | UTF_MANUAL);
|
||||||
|
|
||||||
int do_ut_upl(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_upl(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(upl_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(upl);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(upl_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(upl);
|
||||||
|
|
||||||
return cmd_ut_category("upl", "cmd_upl_", tests, n_ents, argc, argv);
|
return cmd_ut_category("upl", "cmd_upl_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <test/ut.h>
|
#include <test/ut.h>
|
||||||
|
|
||||||
/* Declare a new addrmap test */
|
/* Declare a new addrmap test */
|
||||||
#define ADDRMAP_TEST(_name, _flags) UNIT_TEST(_name, _flags, addrmap_test)
|
#define ADDRMAP_TEST(_name, _flags) UNIT_TEST(_name, _flags, addrmap)
|
||||||
|
|
||||||
/* Test 'addrmap' command output */
|
/* Test 'addrmap' command output */
|
||||||
static int addrmap_test_basic(struct unit_test_state *uts)
|
static int addrmap_test_basic(struct unit_test_state *uts)
|
||||||
|
@ -27,8 +27,8 @@ ADDRMAP_TEST(addrmap_test_basic, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_addrmap(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_addrmap(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(addrmap_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(addrmap);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(addrmap_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(addrmap);
|
||||||
|
|
||||||
return cmd_ut_category("addrmap", "cmd_addrmap_", tests, n_ents,
|
return cmd_ut_category("addrmap", "cmd_addrmap_", tests, n_ents,
|
||||||
argc, argv);
|
argc, argv);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
/* Declare a new bdinfo test */
|
/* Declare a new bdinfo test */
|
||||||
#define BDINFO_TEST(_name, _flags) UNIT_TEST(_name, _flags, bdinfo_test)
|
#define BDINFO_TEST(_name, _flags) UNIT_TEST(_name, _flags, bdinfo)
|
||||||
|
|
||||||
static int test_num_l(struct unit_test_state *uts, const char *name,
|
static int test_num_l(struct unit_test_state *uts, const char *name,
|
||||||
ulong value)
|
ulong value)
|
||||||
|
@ -285,8 +285,8 @@ BDINFO_TEST(bdinfo_test_eth, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(bdinfo_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(bdinfo);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(bdinfo_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(bdinfo);
|
||||||
|
|
||||||
return cmd_ut_category("bdinfo", "bdinfo_test_", tests, n_ents, argc, argv);
|
return cmd_ut_category("bdinfo", "bdinfo_test_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
/* Declare a new exit test */
|
/* Declare a new exit test */
|
||||||
#define EXIT_TEST(_name, _flags) UNIT_TEST(_name, _flags, exit_test)
|
#define EXIT_TEST(_name, _flags) UNIT_TEST(_name, _flags, exit)
|
||||||
|
|
||||||
/* Test 'exit addr' getting/setting address */
|
/* Test 'exit addr' getting/setting address */
|
||||||
static int cmd_exit_test(struct unit_test_state *uts)
|
static int cmd_exit_test(struct unit_test_state *uts)
|
||||||
|
@ -113,8 +113,8 @@ EXIT_TEST(cmd_exit_test, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_exit(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_exit(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(exit_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(exit);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(exit_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(exit);
|
||||||
|
|
||||||
return cmd_ut_category("exit", "exit_test_", tests, n_ents,
|
return cmd_ut_category("exit", "exit_test_", tests, n_ents,
|
||||||
argc, argv);
|
argc, argv);
|
||||||
|
|
|
@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Declare a new fdt test */
|
/* Declare a new fdt test */
|
||||||
#define FDT_TEST(_name, _flags) UNIT_TEST(_name, _flags, fdt_test)
|
#define FDT_TEST(_name, _flags) UNIT_TEST(_name, _flags, fdt)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* make_test_fdt() - Create an FDT with just a root node
|
* make_test_fdt() - Create an FDT with just a root node
|
||||||
|
@ -1465,8 +1465,8 @@ FDT_TEST(fdt_test_apply, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(fdt_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(fdt);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(fdt_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(fdt);
|
||||||
|
|
||||||
return cmd_ut_category("fdt", "fdt_test_", tests, n_ents, argc, argv);
|
return cmd_ut_category("fdt", "fdt_test_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <test/ut.h>
|
#include <test/ut.h>
|
||||||
|
|
||||||
/* Declare a new fdt test */
|
/* Declare a new fdt test */
|
||||||
#define FONT_TEST(_name, _flags) UNIT_TEST(_name, _flags, font_test)
|
#define FONT_TEST(_name, _flags) UNIT_TEST(_name, _flags, font)
|
||||||
|
|
||||||
/* Test 'fdt addr' resizing an fdt */
|
/* Test 'fdt addr' resizing an fdt */
|
||||||
static int font_test_base(struct unit_test_state *uts)
|
static int font_test_base(struct unit_test_state *uts)
|
||||||
|
@ -88,8 +88,8 @@ FONT_TEST(font_test_base, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE |
|
||||||
|
|
||||||
int do_ut_font(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_font(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(font_Test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(font);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(font_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(font);
|
||||||
|
|
||||||
return cmd_ut_category("font", "font_test_", tests, n_ents, argc, argv);
|
return cmd_ut_category("font", "font_test_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#define BUF_SIZE 0x100
|
#define BUF_SIZE 0x100
|
||||||
|
|
||||||
#define LOADM_TEST(_name, _flags) UNIT_TEST(_name, _flags, loadm_test)
|
#define LOADM_TEST(_name, _flags) UNIT_TEST(_name, _flags, loadm)
|
||||||
|
|
||||||
static int loadm_test_params(struct unit_test_state *uts)
|
static int loadm_test_params(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
|
@ -61,8 +61,8 @@ LOADM_TEST(loadm_test_load, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_loadm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_loadm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(loadm_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(loadm);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(loadm_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(loadm);
|
||||||
|
|
||||||
return cmd_ut_category("loadm", "loadm_test_", tests, n_ents, argc,
|
return cmd_ut_category("loadm", "loadm_test_", tests, n_ents, argc,
|
||||||
argv);
|
argv);
|
||||||
|
|
|
@ -470,12 +470,12 @@ static int mbr_test_run(struct unit_test_state *uts)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Declare mbr test */
|
/* Declare mbr test */
|
||||||
UNIT_TEST(mbr_test_run, UTF_CONSOLE, mbr_test);
|
UNIT_TEST(mbr_test_run, UTF_CONSOLE, mbr);
|
||||||
|
|
||||||
int do_ut_mbr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_mbr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(mbr_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(mbr);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(mbr_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(mbr);
|
||||||
|
|
||||||
return cmd_ut_category("mbr", "mbr_test_", tests, n_ents, argc, argv);
|
return cmd_ut_category("mbr", "mbr_test_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
int do_ut_mem(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_mem(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(mem_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(mem);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(mem_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(mem);
|
||||||
|
|
||||||
return cmd_ut_category("mem", "mem_test_", tests, n_ents, argc,
|
return cmd_ut_category("mem", "mem_test_", tests, n_ents, argc,
|
||||||
argv);
|
argv);
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#define BUF_SIZE 256
|
#define BUF_SIZE 256
|
||||||
|
|
||||||
/* Declare a new mem test */
|
/* Declare a new mem test */
|
||||||
#define MEM_TEST(_name) UNIT_TEST(_name, 0, mem_test)
|
#define MEM_TEST(_name) UNIT_TEST(_name, 0, mem)
|
||||||
|
|
||||||
struct param {
|
struct param {
|
||||||
int d, s, count;
|
int d, s, count;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#define BUF_SIZE 0x100
|
#define BUF_SIZE 0x100
|
||||||
|
|
||||||
/* Declare a new mem test */
|
/* Declare a new mem test */
|
||||||
#define MEM_TEST(_name, _flags) UNIT_TEST(_name, _flags, mem_test)
|
#define MEM_TEST(_name, _flags) UNIT_TEST(_name, _flags, mem)
|
||||||
|
|
||||||
/* Test 'ms' command with bytes */
|
/* Test 'ms' command with bytes */
|
||||||
static int mem_test_ms_b(struct unit_test_state *uts)
|
static int mem_test_ms_b(struct unit_test_state *uts)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <test/suites.h>
|
#include <test/suites.h>
|
||||||
#include <test/ut.h>
|
#include <test/ut.h>
|
||||||
|
|
||||||
#define PCI_MPS_TEST(_name, _flags) UNIT_TEST(_name, _flags, pci_mps_test)
|
#define PCI_MPS_TEST(_name, _flags) UNIT_TEST(_name, _flags, pci_mps)
|
||||||
|
|
||||||
/* Test "pci_mps" command in safe "s" mode */
|
/* Test "pci_mps" command in safe "s" mode */
|
||||||
static int test_pci_mps_safe(struct unit_test_state *uts)
|
static int test_pci_mps_safe(struct unit_test_state *uts)
|
||||||
|
@ -32,8 +32,8 @@ PCI_MPS_TEST(test_pci_mps_safe, UTF_CONSOLE);
|
||||||
int do_ut_pci_mps(struct cmd_tbl *cmdtp, int flag, int argc,
|
int do_ut_pci_mps(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char * const argv[])
|
char * const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(pci_mps_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(pci_mps);
|
||||||
const int n = UNIT_TEST_SUITE_COUNT(pci_mps_test);
|
const int n = UNIT_TEST_SUITE_COUNT(pci_mps);
|
||||||
|
|
||||||
return cmd_ut_category("pci_mps", "pci_mps_test_", tests, n,
|
return cmd_ut_category("pci_mps", "pci_mps_test_", tests, n,
|
||||||
argc, argv);
|
argc, argv);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <test/test.h>
|
#include <test/test.h>
|
||||||
#include <test/ut.h>
|
#include <test/ut.h>
|
||||||
|
|
||||||
#define SEAMA_TEST(_name, _flags) UNIT_TEST(_name, _flags, seama_test)
|
#define SEAMA_TEST(_name, _flags) UNIT_TEST(_name, _flags, seama)
|
||||||
|
|
||||||
static int seama_test_noargs(struct unit_test_state *uts)
|
static int seama_test_noargs(struct unit_test_state *uts)
|
||||||
{
|
{
|
||||||
|
@ -59,8 +59,8 @@ SEAMA_TEST(seama_test_index, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_seama(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_seama(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(seama_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(seama);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(seama_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(seama);
|
||||||
|
|
||||||
return cmd_ut_category("seama", "seama_test_", tests, n_ents, argc,
|
return cmd_ut_category("seama", "seama_test_", tests, n_ents, argc,
|
||||||
argv);
|
argv);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#define BUF_SIZE 0x100
|
#define BUF_SIZE 0x100
|
||||||
|
|
||||||
/* Declare a new setexpr test */
|
/* Declare a new setexpr test */
|
||||||
#define SETEXPR_TEST(_name, _flags) UNIT_TEST(_name, _flags, setexpr_test)
|
#define SETEXPR_TEST(_name, _flags) UNIT_TEST(_name, _flags, setexpr)
|
||||||
|
|
||||||
/* Test 'setexpr' command with simply setting integers */
|
/* Test 'setexpr' command with simply setting integers */
|
||||||
static int setexpr_test_int(struct unit_test_state *uts)
|
static int setexpr_test_int(struct unit_test_state *uts)
|
||||||
|
@ -482,8 +482,8 @@ SETEXPR_TEST(setexpr_test_fmt, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_setexpr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_setexpr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(setexpr_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(setexpr);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(setexpr_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(setexpr);
|
||||||
|
|
||||||
return cmd_ut_category("setexpr", "setexpr_test_", tests, n_ents,
|
return cmd_ut_category("setexpr", "setexpr_test_", tests, n_ents,
|
||||||
argc, argv);
|
argc, argv);
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/* Declare a new bloblist test */
|
/* Declare a new bloblist test */
|
||||||
#define BLOBLIST_TEST(_name, _flags) \
|
#define BLOBLIST_TEST(_name, _flags) \
|
||||||
UNIT_TEST(_name, _flags, bloblist_test)
|
UNIT_TEST(_name, _flags, bloblist)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TEST_TAG = BLOBLISTT_U_BOOT_SPL_HANDOFF,
|
TEST_TAG = BLOBLISTT_U_BOOT_SPL_HANDOFF,
|
||||||
|
@ -606,8 +606,8 @@ BLOBLIST_TEST(bloblist_test_blob_maxsize, UFT_BLOBLIST);
|
||||||
int do_ut_bloblist(struct cmd_tbl *cmdtp, int flag, int argc,
|
int do_ut_bloblist(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char *const argv[])
|
char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(bloblist_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(bloblist);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(bloblist_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(bloblist);
|
||||||
|
|
||||||
return cmd_ut_category("bloblist", "bloblist_test_",
|
return cmd_ut_category("bloblist", "bloblist_test_",
|
||||||
tests, n_ents, argc, argv);
|
tests, n_ents, argc, argv);
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
|
|
||||||
int do_ut_common(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_common(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(common_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(common);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(common_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(common);
|
||||||
|
|
||||||
return cmd_ut_category("common", "common_test_", tests, n_ents, argc,
|
return cmd_ut_category("common", "common_test_", tests, n_ents, argc,
|
||||||
argv);
|
argv);
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(dm_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(dm);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(dm_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(dm);
|
||||||
|
|
||||||
return cmd_ut_category("dm", "dm_test_", tests, n_ents, argc, argv);
|
return cmd_ut_category("dm", "dm_test_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
4
test/env/cmd_ut_env.c
vendored
4
test/env/cmd_ut_env.c
vendored
|
@ -77,8 +77,8 @@ ENV_TEST(env_test_env_cmd, UTF_CONSOLE);
|
||||||
|
|
||||||
int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(env_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(env);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(env_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(env);
|
||||||
|
|
||||||
return cmd_ut_category("env", "env_test_", tests, n_ents, argc, argv);
|
return cmd_ut_category("env", "env_test_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
int do_ut_hush(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_hush(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(hush_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(hush);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(hush_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(hush);
|
||||||
|
|
||||||
return cmd_ut_category("hush", "hush_test_",
|
return cmd_ut_category("hush", "hush_test_",
|
||||||
tests, n_ents, argc, argv);
|
tests, n_ents, argc, argv);
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_lib(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(lib_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(lib);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(lib_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(lib);
|
||||||
|
|
||||||
return cmd_ut_category("lib", "lib_test_", tests, n_ents, argc, argv);
|
return cmd_ut_category("lib", "lib_test_", tests, n_ents, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
|
|
||||||
int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
|
int do_ut_log(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(log_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(log);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(log_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(log);
|
||||||
|
|
||||||
return cmd_ut_category("log", "log_test_",
|
return cmd_ut_category("log", "log_test_",
|
||||||
tests, n_ents, argc, argv);
|
tests, n_ents, argc, argv);
|
||||||
|
|
|
@ -93,8 +93,8 @@ OPTEE_TEST(optee_fdt_protected_memory, 0);
|
||||||
|
|
||||||
int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_optee(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(optee_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(optee);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(optee_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(optee);
|
||||||
struct unit_test_state *uts;
|
struct unit_test_state *uts;
|
||||||
void *fdt_optee = &__dtb_test_optee_optee_begin;
|
void *fdt_optee = &__dtb_test_optee_optee_begin;
|
||||||
void *fdt_no_optee = &__dtb_test_optee_no_optee_begin;
|
void *fdt_no_optee = &__dtb_test_optee_no_optee_begin;
|
||||||
|
|
|
@ -212,8 +212,8 @@ OVERLAY_TEST(fdt_overlay_stacked, 0);
|
||||||
|
|
||||||
int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_ut_overlay(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
struct unit_test *tests = UNIT_TEST_SUITE_START(overlay_test);
|
struct unit_test *tests = UNIT_TEST_SUITE_START(overlay);
|
||||||
const int n_ents = UNIT_TEST_SUITE_COUNT(overlay_test);
|
const int n_ents = UNIT_TEST_SUITE_COUNT(overlay);
|
||||||
struct unit_test_state *uts;
|
struct unit_test_state *uts;
|
||||||
void *fdt_base = &__dtb_test_fdt_base_begin;
|
void *fdt_base = &__dtb_test_fdt_base_begin;
|
||||||
void *fdt_overlay = &__dtbo_test_fdt_overlay_begin;
|
void *fdt_overlay = &__dtbo_test_fdt_overlay_begin;
|
||||||
|
|
|
@ -33,6 +33,9 @@ console = None
|
||||||
|
|
||||||
TEST_PY_DIR = os.path.dirname(os.path.abspath(__file__))
|
TEST_PY_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
# Regex for test-function symbols
|
||||||
|
RE_UT_TEST_LIST = re.compile(r'[^a-zA-Z0-9_]_u_boot_list_2_ut_(.*)_2_(.*)\s*$')
|
||||||
|
|
||||||
def mkdir_p(path):
|
def mkdir_p(path):
|
||||||
"""Create a directory path.
|
"""Create a directory path.
|
||||||
|
|
||||||
|
@ -336,7 +339,7 @@ def pytest_configure(config):
|
||||||
import u_boot_console_exec_attach
|
import u_boot_console_exec_attach
|
||||||
console = u_boot_console_exec_attach.ConsoleExecAttach(log, ubconfig)
|
console = u_boot_console_exec_attach.ConsoleExecAttach(log, ubconfig)
|
||||||
|
|
||||||
re_ut_test_list = re.compile(r'[^a-zA-Z0-9_]_u_boot_list_2_ut_(.*)_test_2_(.*)\s*$')
|
|
||||||
def generate_ut_subtest(metafunc, fixture_name, sym_path):
|
def generate_ut_subtest(metafunc, fixture_name, sym_path):
|
||||||
"""Provide parametrization for a ut_subtest fixture.
|
"""Provide parametrization for a ut_subtest fixture.
|
||||||
|
|
||||||
|
@ -363,7 +366,7 @@ def generate_ut_subtest(metafunc, fixture_name, sym_path):
|
||||||
|
|
||||||
vals = []
|
vals = []
|
||||||
for l in lines:
|
for l in lines:
|
||||||
m = re_ut_test_list.search(l)
|
m = RE_UT_TEST_LIST.search(l)
|
||||||
if not m:
|
if not m:
|
||||||
continue
|
continue
|
||||||
suite, name = m.groups()
|
suite, name = m.groups()
|
||||||
|
|
Loading…
Add table
Reference in a new issue