diff --git a/cmd/mmc.c b/cmd/mmc.c index 7244a90f4dc..ff7b8e555ba 100644 --- a/cmd/mmc.c +++ b/cmd/mmc.c @@ -238,7 +238,7 @@ static int do_mmcrpmb_read(struct cmd_tbl *cmdtp, int flag, if (argc == 5) key_addr = (void *)hextoul(argv[4], NULL); - printf("\nMMC RPMB read: dev # %d, block # %d, count %d ... ", + printf("MMC RPMB read: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); n = mmc_rpmb_read(mmc, addr, blk, cnt, key_addr); @@ -265,7 +265,7 @@ static int do_mmcrpmb_write(struct cmd_tbl *cmdtp, int flag, cnt = hextoul(argv[3], NULL); key_addr = (void *)hextoul(argv[4], NULL); - printf("\nMMC RPMB write: dev # %d, block # %d, count %d ... ", + printf("MMC RPMB write: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); n = mmc_rpmb_write(mmc, addr, blk, cnt, key_addr); @@ -362,7 +362,7 @@ static int do_mmc_read(struct cmd_tbl *cmdtp, int flag, if (!mmc) return CMD_RET_FAILURE; - printf("\nMMC read: dev # %d, block # %d, count %d ... ", + printf("MMC read: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); n = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr); @@ -411,7 +411,7 @@ static int do_mmc_sparse_write(struct cmd_tbl *cmdtp, int flag, if (!mmc) return CMD_RET_FAILURE; - printf("\nMMC Sparse write: dev # %d, block # %d ... ", + printf("MMC Sparse write: dev # %d, block # %d ... ", curr_device, blk); if (mmc_getwp(mmc) == 1) { @@ -455,7 +455,7 @@ static int do_mmc_write(struct cmd_tbl *cmdtp, int flag, if (!mmc) return CMD_RET_FAILURE; - printf("\nMMC write: dev # %d, block # %d, count %d ... ", + printf("MMC write: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); if (mmc_getwp(mmc) == 1) { @@ -484,7 +484,7 @@ static int do_mmc_erase(struct cmd_tbl *cmdtp, int flag, if (!mmc) return CMD_RET_FAILURE; - printf("\nMMC erase: dev # %d, block # %d, count %d ... ", + printf("MMC erase: dev # %d, block # %d, count %d ... ", curr_device, blk, cnt); if (mmc_getwp(mmc) == 1) { diff --git a/common/console.c b/common/console.c index f39821385bb..52d6df8150f 100644 --- a/common/console.c +++ b/common/console.c @@ -846,6 +846,8 @@ int console_record_readline(char *str, int maxlen) { if (gd->flags & GD_FLG_RECORD_OVF) return -ENOSPC; + if (console_record_isempty()) + return -ENOENT; return membuff_readline((struct membuff *)&gd->console_out, str, maxlen, '\0', false); diff --git a/doc/develop/commands.rst b/doc/develop/commands.rst index 5ad4e59c838..77a7a4d9c02 100644 --- a/doc/develop/commands.rst +++ b/doc/develop/commands.rst @@ -197,7 +197,6 @@ Here is an example: ctx.current = buf; ut_assertok(acpi_fill_ssdt(&ctx)); - console_record_reset(); run_command("acpi items", 0); ut_assert_nextline("dev 'acpi-test', type 1, size 2"); ut_assert_nextline("dev 'acpi-test2', type 1, size 2"); @@ -205,13 +204,11 @@ Here is an example: ctx.current = buf; ut_assertok(acpi_inject_dsdt(&ctx)); - console_record_reset(); run_command("acpi items", 0); ut_assert_nextline("dev 'acpi-test', type 2, size 2"); ut_assert_nextline("dev 'acpi-test2', type 2, size 2"); ut_assert_console_end(); - console_record_reset(); run_command("acpi items -d", 0); ut_assert_nextline("dev 'acpi-test', type 2, size 2"); ut_assert_nextlines_are_dump(2); @@ -223,4 +220,8 @@ Here is an example: return 0; } - DM_TEST(dm_test_acpi_cmd_items, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + DM_TEST(dm_test_acpi_cmd_items, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); + +Note that it is not necessary to call console_record_reset() unless you are +trying to drop some unchecked output. Consider using ut_check_skip_to_line() +instead. diff --git a/doc/develop/tests_writing.rst b/doc/develop/tests_writing.rst index 44b544fa78b..a328ebfef33 100644 --- a/doc/develop/tests_writing.rst +++ b/doc/develop/tests_writing.rst @@ -81,7 +81,7 @@ The best of both worlds is sometimes to have a Python test set things up and perform some operations, with a 'checker' C unit test doing the checks afterwards. This can be achieved with these steps: -- Add the `UT_TESTF_MANUAL` flag to the checker test so that the `ut` command +- Add the `UTF_MANUAL` flag to the checker test so that the `ut` command does not run it by default - Add a `_norun` suffix to the name so that pytest knows to skip it too @@ -95,7 +95,7 @@ test to run it, e.g.:: # Run the checker to make sure that everything worked ut -f bootstd vbe_test_fixup_norun -Note that apart from the `UT_TESTF_MANUAL` flag, the code in a 'manual' C test +Note that apart from the `UTF_MANUAL` flag, the code in a 'manual' C test is just like any other C test. It still uses ut_assert...() and other such constructs, in this case to check that the expected things happened in the Python test. @@ -151,7 +151,6 @@ There is no exactly equivalent C test, but here is a similar one that tests 'ms' buf[0x31] = 0x12; buf[0xff] = 0x12; buf[0x100] = 0x12; - ut_assertok(console_record_reset_enable()); run_command("ms.b 1 ff 12", 0); ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................"); ut_assert_nextline("--"); @@ -167,7 +166,7 @@ There is no exactly equivalent C test, but here is a similar one that tests 'ms' return 0; } - MEM_TEST(mem_test_ms_b, UT_TESTF_CONSOLE_REC); + MEM_TEST(mem_test_ms_b, UTF_CONSOLE); This runs the command directly in U-Boot, then checks the console output, also directly in U-Boot. If run by itself this takes 100ms. For 1000 runs it takes @@ -226,14 +225,17 @@ Declare the test with:: return 0; } - DM_TEST(dm_test_uclassname_what, UT_TESTF_SCAN_FDT); + DM_TEST(dm_test_uclassname_what, UTF_SCAN_FDT); + +Note that the convention is to NOT add a blank line before the macro, so that +the function it relates to is more obvious. Replace 'uclassname' with the name of your uclass, if applicable. Replace 'what' with what you are testing. The flags for DM_TEST() are defined in test/test.h and you typically want -UT_TESTF_SCAN_FDT so that the devicetree is scanned and all devices are bound -and ready for use. The DM_TEST macro adds UT_TESTF_DM automatically so that +UTF_SCAN_FDT so that the devicetree is scanned and all devices are bound +and ready for use. The DM_TEST macro adds UTF_DM automatically so that the test runner knows it is a driver model test. Driver model tests are special in that the entire driver model state is @@ -263,7 +265,7 @@ with the suite. For example, to add a new mem_search test:: return 0; } - MEM_TEST(mem_test_ms_new_thing, UT_TESTF_CONSOLE_REC); + MEM_TEST(mem_test_ms_new_thing, UTF_CONSOLE); Note that the MEM_TEST() macros is defined at the top of the file. diff --git a/doc/usage/cmd/ut.rst b/doc/usage/cmd/ut.rst index 45bc9ffbdc5..afeafa824d6 100644 --- a/doc/usage/cmd/ut.rst +++ b/doc/usage/cmd/ut.rst @@ -32,7 +32,7 @@ to run some tests on real boards. For a list of available test suites, type `ut` by itself. -Each test is normally run once, although those marked with `UT_TESTF_DM` are +Each test is normally run once, although those marked with `UTF_DM` are run with livetree and flattree where possible. To run a test more than once, use the `-r` flag. diff --git a/include/console.h b/include/console.h index 2617e160073..6b6d0f9de73 100644 --- a/include/console.h +++ b/include/console.h @@ -73,7 +73,7 @@ int console_record_reset_enable(void); * @str: Place to put string * @maxlen: Maximum length of @str including nul terminator * Return: length of string returned, or -ENOSPC if the console buffer was - * overflowed by the output + * overflowed by the output, or -ENOENT if there was nothing to read */ int console_record_readline(char *str, int maxlen); diff --git a/include/dm/test.h b/include/dm/test.h index 02737411a16..3cbf2c740d4 100644 --- a/include/dm/test.h +++ b/include/dm/test.h @@ -143,7 +143,7 @@ extern struct unit_test_state global_dm_test_state; /* Declare a new driver model test */ #define DM_TEST(_name, _flags) \ - UNIT_TEST(_name, UT_TESTF_DM | UT_TESTF_CONSOLE_REC | (_flags), dm_test) + UNIT_TEST(_name, UTF_DM | UTF_CONSOLE | (_flags), dm_test) /* * struct sandbox_sdl_plat - Platform data for the SDL video driver diff --git a/include/test/log.h b/include/test/log.h index e9028914500..e3362b85e99 100644 --- a/include/test/log.h +++ b/include/test/log.h @@ -13,7 +13,8 @@ #define LOGF_TEST (BIT(LOGF_FUNC) | BIT(LOGF_MSG)) /* Declare a new logging test */ -#define LOG_TEST(_name) UNIT_TEST(_name, 0, log_test) -#define LOG_TEST_FLAGS(_name, _flags) UNIT_TEST(_name, _flags, log_test) +#define LOG_TEST(_name) UNIT_TEST(_name, UTF_CONSOLE, log_test) +#define LOG_TEST_FLAGS(_name, _flags) \ + UNIT_TEST(_name, _flags | UTF_CONSOLE, log_test) #endif /* __TEST_LOG_H__ */ diff --git a/include/test/spl.h b/include/test/spl.h index a2a5f33e328..5fd28d92706 100644 --- a/include/test/spl.h +++ b/include/test/spl.h @@ -154,6 +154,6 @@ SPL_TEST(func##_##type, flags) #define SPL_TEST_DATA_SIZE 4099 /* Flags necessary for accessing DM devices */ -#define DM_FLAGS (UT_TESTF_DM | UT_TESTF_SCAN_FDT) +#define DM_FLAGS (UTF_DM | UTF_SCAN_FDT) #endif /* TEST_SPL_H */ diff --git a/include/test/test.h b/include/test/test.h index 838e3ce8a8f..92eec2eb6f9 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -24,11 +24,11 @@ * @fdt_chksum: crc8 of the device tree contents * @fdt_copy: Copy of the device tree * @fdt_size: Size of the device-tree copy - * @other_fdt: Buffer for the other FDT (UT_TESTF_OTHER_FDT) - * @other_fdt_size: Size of the other FDT (UT_TESTF_OTHER_FDT) + * @other_fdt: Buffer for the other FDT (UTF_OTHER_FDT) + * @other_fdt_size: Size of the other FDT (UTF_OTHER_FDT) * @of_other: Live tree for the other FDT * @runs_per_test: Number of times to run each test (typically 1) - * @force_run: true to run tests marked with the UT_TESTF_MANUAL flag + * @force_run: true to run tests marked with the UTF_MANUAL flag * @expect_str: Temporary string used to hold expected string value * @actual_str: Temporary string used to hold actual string value */ @@ -55,24 +55,24 @@ struct unit_test_state { }; /* Test flags for each test */ -enum { - UT_TESTF_SCAN_PDATA = BIT(0), /* test needs platform data */ - UT_TESTF_PROBE_TEST = BIT(1), /* probe test uclass */ - UT_TESTF_SCAN_FDT = BIT(2), /* scan device tree */ - UT_TESTF_FLAT_TREE = BIT(3), /* test needs flat DT */ - UT_TESTF_LIVE_TREE = BIT(4), /* needs live device tree */ - UT_TESTF_CONSOLE_REC = BIT(5), /* needs console recording */ +enum ut_flags { + UTF_SCAN_PDATA = BIT(0), /* test needs platform data */ + UTF_PROBE_TEST = BIT(1), /* probe test uclass */ + UTF_SCAN_FDT = BIT(2), /* scan device tree */ + UTF_FLAT_TREE = BIT(3), /* test needs flat DT */ + UTF_LIVE_TREE = BIT(4), /* needs live device tree */ + UTF_CONSOLE = BIT(5), /* needs console recording */ /* do extra driver model init and uninit */ - UT_TESTF_DM = BIT(6), - UT_TESTF_OTHER_FDT = BIT(7), /* read in other device tree */ + UTF_DM = BIT(6), + UTF_OTHER_FDT = BIT(7), /* read in other device tree */ /* * Only run if explicitly requested with 'ut -f '. The * test name must end in "_norun" so that pytest detects this also, * since it cannot access the flags. */ - UT_TESTF_MANUAL = BIT(8), - UT_TESTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */ - UT_TESTF_SF_BOOTDEV = BIT(10), /* enable SPI flash bootdevs */ + UTF_MANUAL = BIT(8), + UTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */ + UTF_SF_BOOTDEV = BIT(10), /* enable SPI flash bootdevs */ }; /** @@ -109,7 +109,7 @@ struct unit_test { * @_name: concatenation of name of the test suite, "_test_", and the name * of the test * @_flags: an integer field that can be evaluated by the test suite - * implementation + * implementation (see enum ut_flags) * @_suite: name of the test suite concatenated with "_test" */ #define UNIT_TEST(_name, _flags, _suite) \ diff --git a/include/test/ut.h b/include/test/ut.h index d3172af8083..c8838dad096 100644 --- a/include/test/ut.h +++ b/include/test/ut.h @@ -495,7 +495,7 @@ void test_set_state(struct unit_test_state *uts); * @select_name: Name of a single test to run (from the list provided). If NULL * then all tests are run * @runs_per_test: Number of times to run each test (typically 1) - * @force_run: Run tests that are marked as manual-only (UT_TESTF_MANUAL) + * @force_run: Run tests that are marked as manual-only (UTF_MANUAL) * @test_insert: String describing a test to run after n other tests run, in the * format n:name where n is the number of tests to run before this one and * name is the name of the test to run. This is used to find which test causes diff --git a/test/bloblist.c b/test/bloblist.c index 7c63682908a..fd85c7ab79e 100644 --- a/test/bloblist.c +++ b/test/bloblist.c @@ -270,20 +270,15 @@ static int bloblist_test_cmd_info(struct unit_test_state *uts) data = bloblist_ensure(TEST_TAG, TEST_SIZE); data2 = bloblist_ensure(TEST_TAG2, TEST_SIZE2); - console_record_reset_enable(); - ut_silence_console(uts); - console_record_reset(); run_command("bloblist info", 0); ut_assert_nextline("base: %lx", (ulong)map_to_sysmem(hdr)); ut_assert_nextline("total size: 400 1 KiB"); ut_assert_nextline("used size: 50 80 Bytes"); ut_assert_nextline("free: 3b0 944 Bytes"); - ut_assert_console_end(); - ut_unsilence_console(uts); return 0; } -BLOBLIST_TEST(bloblist_test_cmd_info, 0); +BLOBLIST_TEST(bloblist_test_cmd_info, UTF_CONSOLE); /* Test the 'bloblist list' command */ static int bloblist_test_cmd_list(struct unit_test_state *uts) @@ -296,21 +291,16 @@ static int bloblist_test_cmd_list(struct unit_test_state *uts) data = bloblist_ensure(TEST_TAG, TEST_SIZE); data2 = bloblist_ensure(TEST_TAG2, TEST_SIZE2); - console_record_reset_enable(); - ut_silence_console(uts); - console_record_reset(); run_command("bloblist list", 0); ut_assert_nextline("Address Size Tag Name"); ut_assert_nextline("%08lx %8x fff000 SPL hand-off", (ulong)map_to_sysmem(data), TEST_SIZE); ut_assert_nextline("%08lx %8x 202 Chrome OS vboot context", (ulong)map_to_sysmem(data2), TEST_SIZE2); - ut_assert_console_end(); - ut_unsilence_console(uts); return 0; } -BLOBLIST_TEST(bloblist_test_cmd_list, 0); +BLOBLIST_TEST(bloblist_test_cmd_list, UTF_CONSOLE); /* Test alignment of bloblist blobs */ static int bloblist_test_align(struct unit_test_state *uts) diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c index 1bf5929c396..23ebc61ff52 100644 --- a/test/boot/bootdev.c +++ b/test/boot/bootdev.c @@ -28,7 +28,6 @@ static int bootdev_test_cmd_list(struct unit_test_state *uts) { int probed; - console_record_reset_enable(); for (probed = 0; probed < 2; probed++) { int probe_ch = probed ? '+' : ' '; @@ -49,7 +48,7 @@ static int bootdev_test_cmd_list(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_cmd_list, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_cmd_list, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootdev select' and 'info' commands */ static int bootdev_test_cmd_select(struct unit_test_state *uts) @@ -59,7 +58,6 @@ static int bootdev_test_cmd_select(struct unit_test_state *uts) /* get access to the CLI's cur_bootdev */ ut_assertok(bootstd_get_priv(&std)); - console_record_reset_enable(); ut_asserteq(1, run_command("bootdev info", 0)); ut_assert_nextlinen("Please use"); ut_assert_console_end(); @@ -99,7 +97,7 @@ static int bootdev_test_cmd_select(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_cmd_select, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_cmd_select, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check bootdev labels */ static int bootdev_test_labels(struct unit_test_state *uts) @@ -131,8 +129,7 @@ static int bootdev_test_labels(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_labels, UT_TESTF_DM | UT_TESTF_SCAN_FDT | - UT_TESTF_ETH_BOOTDEV); +BOOTSTD_TEST(bootdev_test_labels, UTF_DM | UTF_SCAN_FDT | UTF_ETH_BOOTDEV); /* Check bootdev_find_by_any() */ static int bootdev_test_any(struct unit_test_state *uts) @@ -158,7 +155,6 @@ static int bootdev_test_any(struct unit_test_state *uts) * 9 [ + ] OK mmc mmc1.bootdev * a [ ] OK mmc mmc0.bootdev */ - console_record_reset_enable(); ut_assertok(bootdev_find_by_any("8", &dev, &mflags)); ut_asserteq(UCLASS_BOOTDEV, device_get_uclass_id(dev)); ut_asserteq(BOOTFLOW_METHF_SINGLE_DEV, mflags); @@ -186,8 +182,8 @@ static int bootdev_test_any(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_any, UT_TESTF_DM | UT_TESTF_SCAN_FDT | - UT_TESTF_ETH_BOOTDEV); +BOOTSTD_TEST(bootdev_test_any, UTF_DM | UTF_SCAN_FDT | UTF_ETH_BOOTDEV | + UTF_CONSOLE); /* * Check bootdev ordering with the bootdev-order property and boot_targets @@ -274,7 +270,7 @@ static int bootdev_test_order(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_order, UTF_DM | UTF_SCAN_FDT); /* Check default bootdev ordering */ static int bootdev_test_order_default(struct unit_test_state *uts) @@ -301,7 +297,7 @@ static int bootdev_test_order_default(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_order_default, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_order_default, UTF_DM | UTF_SCAN_FDT); /* Check bootdev ordering with the uclass priority */ static int bootdev_test_prio(struct unit_test_state *uts) @@ -323,7 +319,6 @@ static int bootdev_test_prio(struct unit_test_state *uts) ut_assertok(bootstd_test_drop_bootdev_order(uts)); /* 3 MMC and 3 USB bootdevs: MMC should come before USB */ - console_record_reset_enable(); ut_assertok(bootflow_scan_first(NULL, NULL, &iter, 0, &bflow)); ut_asserteq(-ENODEV, bootflow_scan_next(&iter, &bflow)); ut_asserteq(6, iter.num_devs); @@ -350,7 +345,7 @@ static int bootdev_test_prio(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_prio, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_prio, UTF_DM | UTF_SCAN_FDT); /* Check listing hunters */ static int bootdev_test_hunter(struct unit_test_state *uts) @@ -363,7 +358,6 @@ static int bootdev_test_hunter(struct unit_test_state *uts) /* get access to the used hunters */ ut_assertok(bootstd_get_priv(&std)); - console_record_reset_enable(); bootdev_list_hunters(std); ut_assert_nextline("Prio Used Uclass Hunter"); ut_assert_nextlinen("----"); @@ -390,7 +384,7 @@ static int bootdev_test_hunter(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_hunter, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_hunter, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootdev hunt' command */ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) @@ -403,7 +397,6 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) /* get access to the used hunters */ ut_assertok(bootstd_get_priv(&std)); - console_record_reset_enable(); ut_assertok(run_command("bootdev hunt -l", 0)); ut_assert_nextline("Prio Used Uclass Hunter"); ut_assert_nextlinen("----"); @@ -464,8 +457,8 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_cmd_hunt, UT_TESTF_DM | UT_TESTF_SCAN_FDT | - UT_TESTF_ETH_BOOTDEV); +BOOTSTD_TEST(bootdev_test_cmd_hunt, UTF_DM | UTF_SCAN_FDT | UTF_ETH_BOOTDEV | + UTF_CONSOLE); /* Check searching for bootdevs using the hunters */ static int bootdev_test_hunt_scan(struct unit_test_state *uts) @@ -485,7 +478,7 @@ static int bootdev_test_hunt_scan(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_hunt_scan, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_hunt_scan, UTF_DM | UTF_SCAN_FDT); /* Check that only bootable partitions are processed */ static int bootdev_test_bootable(struct unit_test_state *uts) @@ -522,7 +515,7 @@ static int bootdev_test_bootable(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_bootable, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_bootable, UTF_DM | UTF_SCAN_FDT); /* Check hunting for bootdev of a particular priority */ static int bootdev_test_hunt_prio(struct unit_test_state *uts) @@ -530,7 +523,6 @@ static int bootdev_test_hunt_prio(struct unit_test_state *uts) usb_started = false; test_set_skip_delays(true); - console_record_reset_enable(); ut_assertok(bootdev_hunt_prio(BOOTDEVP_4_SCAN_FAST, false)); ut_assert_nextline("scanning bus for devices..."); ut_assert_skip_to_line(" Type: Hard Disk"); @@ -547,7 +539,7 @@ static int bootdev_test_hunt_prio(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_hunt_prio, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_hunt_prio, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check hunting for bootdevs with a particular label */ static int bootdev_test_hunt_label(struct unit_test_state *uts) @@ -562,7 +554,6 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts) ut_assertok(bootstd_get_priv(&std)); /* scan an unknown uclass */ - console_record_reset_enable(); old = (void *)&mflags; /* arbitrary pointer to check against dev */ dev = old; mflags = 123; @@ -600,7 +591,7 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_hunt_label, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootdev_test_hunt_label, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check iterating to the next label in a list */ static int bootdev_test_next_label(struct unit_test_state *uts) @@ -627,7 +618,6 @@ static int bootdev_test_next_label(struct unit_test_state *uts) dev = NULL; mflags = 123; ut_assertok(bootdev_next_label(&iter, &dev, &mflags)); - console_record_reset_enable(); ut_assert_console_end(); ut_assertnonnull(dev); ut_asserteq_str("mmc0.bootdev", dev->name); @@ -677,8 +667,8 @@ static int bootdev_test_next_label(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_next_label, UT_TESTF_DM | UT_TESTF_SCAN_FDT | - UT_TESTF_ETH_BOOTDEV | UT_TESTF_SF_BOOTDEV); +BOOTSTD_TEST(bootdev_test_next_label, UTF_DM | UTF_SCAN_FDT | UTF_ETH_BOOTDEV | + UTF_SF_BOOTDEV | UTF_CONSOLE); /* Check iterating to the next prioirty in a list */ static int bootdev_test_next_prio(struct unit_test_state *uts) @@ -703,7 +693,6 @@ static int bootdev_test_next_prio(struct unit_test_state *uts) iter.flags = BOOTFLOWIF_SHOW; dev = NULL; - console_record_reset_enable(); ut_assertok(bootdev_next_prio(&iter, &dev)); ut_assertnonnull(dev); ut_asserteq_str("mmc2.bootdev", dev->name); @@ -762,5 +751,5 @@ static int bootdev_test_next_prio(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootdev_test_next_prio, UT_TESTF_DM | UT_TESTF_SCAN_FDT | - UT_TESTF_SF_BOOTDEV); +BOOTSTD_TEST(bootdev_test_next_prio, UTF_DM | UTF_SCAN_FDT | UTF_SF_BOOTDEV | + UTF_CONSOLE); diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c index 8b46256fa48..6ad63afe90a 100644 --- a/test/boot/bootflow.c +++ b/test/boot/bootflow.c @@ -50,7 +50,6 @@ static int inject_response(struct unit_test_state *uts) /* Check 'bootflow scan/list' commands */ static int bootflow_cmd(struct unit_test_state *uts) { - console_record_reset_enable(); ut_assertok(run_command("bootdev select 1", 0)); ut_assert_console_end(); ut_assertok(run_command("bootflow scan -lH", 0)); @@ -76,14 +75,13 @@ static int bootflow_cmd(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootflow scan' with a label / seq */ static int bootflow_cmd_label(struct unit_test_state *uts) { test_set_eth_enable(false); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan -lH mmc1", 0)); ut_assert_nextline("Scanning for bootflows with label 'mmc1'"); ut_assert_skip_to_line("(1 bootflow, 1 valid)"); @@ -123,15 +121,14 @@ static int bootflow_cmd_label(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_label, UT_TESTF_DM | UT_TESTF_SCAN_FDT | - UT_TESTF_ETH_BOOTDEV); +BOOTSTD_TEST(bootflow_cmd_label, UTF_DM | UTF_SCAN_FDT | UTF_ETH_BOOTDEV | + UTF_CONSOLE); /* Check 'bootflow scan/list' commands using all bootdevs */ static int bootflow_cmd_glob(struct unit_test_state *uts) { ut_assertok(bootstd_test_drop_bootdev_order(uts)); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan -lGH", 0)); ut_assert_nextline("Scanning for bootflows in all bootdevs"); ut_assert_nextline("Seq Method State Uclass Part Name Filename"); @@ -156,14 +153,13 @@ static int bootflow_cmd_glob(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_glob, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd_glob, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootflow scan -e' */ static int bootflow_cmd_scan_e(struct unit_test_state *uts) { ut_assertok(bootstd_test_drop_bootdev_order(uts)); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan -aleGH", 0)); ut_assert_nextline("Scanning for bootflows in all bootdevs"); ut_assert_nextline("Seq Method State Uclass Part Name Filename"); @@ -207,12 +203,11 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_scan_e, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd_scan_e, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootflow info' */ static int bootflow_cmd_info(struct unit_test_state *uts) { - console_record_reset_enable(); ut_assertok(run_command("bootdev select 1", 0)); ut_assert_console_end(); ut_assertok(run_command("bootflow scan", 0)); @@ -248,12 +243,11 @@ static int bootflow_cmd_info(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_info, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd_info, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootflow scan -b' to boot the first available bootdev */ static int bootflow_scan_boot(struct unit_test_state *uts) { - console_record_reset_enable(); ut_assertok(inject_response(uts)); ut_assertok(run_command("bootflow scan -b", 0)); ut_assert_nextline( @@ -270,7 +264,7 @@ static int bootflow_scan_boot(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_scan_boot, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_scan_boot, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check iterating through available bootflows */ static int bootflow_iter(struct unit_test_state *uts) @@ -368,7 +362,7 @@ static int bootflow_iter(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_iter, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_iter, UTF_DM | UTF_SCAN_FDT); #if defined(CONFIG_SANDBOX) && defined(CONFIG_BOOTMETH_GLOBAL) /* Check using the system bootdev */ @@ -386,7 +380,6 @@ static int bootflow_system(struct unit_test_state *uts) /* We should get a single 'bootmgr' method right at the end */ bootstd_clear_glob(); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan -lH", 0)); ut_assert_skip_to_line( " 0 efi_mgr ready (none) 0 "); @@ -396,8 +389,8 @@ static int bootflow_system(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_system, UT_TESTF_DM | UT_TESTF_SCAN_PDATA | - UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_system, UTF_DM | UTF_SCAN_PDATA | UTF_SCAN_FDT | + UTF_CONSOLE); #endif /* Check disabling a bootmethod if it requests it */ @@ -416,7 +409,6 @@ static int bootflow_iter_disable(struct unit_test_state *uts) ut_assertok(bootstd_test_drop_bootdev_order(uts)); bootstd_clear_glob(); - console_record_reset_enable(); ut_assertok(inject_response(uts)); ut_assertok(run_command("bootflow scan -lbH", 0)); @@ -438,7 +430,7 @@ static int bootflow_iter_disable(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_iter_disable, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_iter_disable, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootflow scan' with a bootmeth ordering including a global bootmeth */ static int bootflow_scan_glob_bootmeth(struct unit_test_state *uts) @@ -452,7 +444,6 @@ static int bootflow_scan_glob_bootmeth(struct unit_test_state *uts) * Make sure that the -G flag makes the scan fail, since this is not * supported when an ordering is provided */ - console_record_reset_enable(); ut_assertok(bootmeth_set_order("efi firmware0")); ut_assertok(run_command("bootflow scan -lGH", 0)); ut_assert_nextline("Scanning for bootflows in all bootdevs"); @@ -479,12 +470,12 @@ static int bootflow_scan_glob_bootmeth(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_scan_glob_bootmeth, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_scan_glob_bootmeth, UTF_DM | UTF_SCAN_FDT | + UTF_CONSOLE); /* Check 'bootflow boot' to boot a selected bootflow */ static int bootflow_cmd_boot(struct unit_test_state *uts) { - console_record_reset_enable(); ut_assertok(run_command("bootdev select 1", 0)); ut_assert_console_end(); ut_assertok(run_command("bootflow scan", 0)); @@ -508,7 +499,7 @@ static int bootflow_cmd_boot(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_boot, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd_boot, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /** * prep_mmc_bootdev() - Set up an mmc bootdev so we can access other distros @@ -585,7 +576,6 @@ static int scan_mmc_bootdev(struct unit_test_state *uts, const char *mmc_dev, ut_assertok(prep_mmc_bootdev(uts, mmc_dev, bind_cros, &old_order)); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan", 0)); ut_assert_console_end(); @@ -613,7 +603,6 @@ static int scan_mmc_android_bootdev(struct unit_test_state *uts, const char *mmc ut_assertok(prep_mmc_bootdev(uts, mmc_dev, true, &old_order)); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan", 0)); /* Android bootflow might print one or two 'ANDROID:*' logs */ ut_check_skipline(uts); @@ -675,7 +664,7 @@ static int bootflow_cmd_menu(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_menu, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd_menu, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootflow scan -m' to select a bootflow using a menu */ static int bootflow_scan_menu(struct unit_test_state *uts) @@ -723,8 +712,7 @@ static int bootflow_scan_menu(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_scan_menu, - UT_TESTF_DM | UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +BOOTSTD_TEST(bootflow_scan_menu, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootflow scan -mb' to select and boot a bootflow using a menu */ static int bootflow_scan_menu_boot(struct unit_test_state *uts) @@ -770,8 +758,7 @@ static int bootflow_scan_menu_boot(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_scan_menu_boot, - UT_TESTF_DM | UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +BOOTSTD_TEST(bootflow_scan_menu_boot, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check searching for a single bootdev using the hunters */ static int bootflow_cmd_hunt_single(struct unit_test_state *uts) @@ -783,7 +770,6 @@ static int bootflow_cmd_hunt_single(struct unit_test_state *uts) ut_assertok(bootstd_test_drop_bootdev_order(uts)); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan -l mmc1", 0)); ut_assert_nextline("Scanning for bootflows with label 'mmc1'"); ut_assert_skip_to_line("(1 bootflow, 1 valid)"); @@ -794,7 +780,8 @@ static int bootflow_cmd_hunt_single(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_hunt_single, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd_hunt_single, UTF_DM | UTF_SCAN_FDT | + UTF_CONSOLE); /* Check searching for a uclass label using the hunters */ static int bootflow_cmd_hunt_label(struct unit_test_state *uts) @@ -808,7 +795,6 @@ static int bootflow_cmd_hunt_label(struct unit_test_state *uts) test_set_eth_enable(false); ut_assertok(bootstd_test_drop_bootdev_order(uts)); - console_record_reset_enable(); ut_assertok(run_command("bootflow scan -l mmc", 0)); /* check that the hunter was used */ @@ -831,7 +817,7 @@ static int bootflow_cmd_hunt_label(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cmd_hunt_label, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_cmd_hunt_label, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /** * check_font() - Check that the font size for an item matches expectations @@ -891,7 +877,7 @@ static int bootflow_menu_theme(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_menu_theme, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootflow_menu_theme, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /** * check_arg() - Check both the normal case and the buffer-overflow case @@ -1127,7 +1113,6 @@ static int bootflow_cmdline(struct unit_test_state *uts) { ut_assertok(run_command("bootflow scan mmc", 0)); ut_assertok(run_command("bootflow sel 0", 0)); - console_record_reset_enable(); ut_asserteq(1, run_command("bootflow cmdline get fred", 0)); ut_assert_nextline("Argument not found"); @@ -1151,13 +1136,11 @@ static int bootflow_cmdline(struct unit_test_state *uts) ut_asserteq(0, run_command("bootflow cmdline set mary abc", 0)); ut_asserteq(0, run_command("bootflow cmdline set mary", 0)); - ut_assert_nextline_empty(); - ut_assert_console_end(); return 0; } -BOOTSTD_TEST(bootflow_cmdline, 0); +BOOTSTD_TEST(bootflow_cmdline, UTF_CONSOLE); /* test a few special changes to a long command line */ static int bootflow_cmdline_special(struct unit_test_state *uts) @@ -1198,7 +1181,7 @@ static int bootflow_cros(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_cros, 0); +BOOTSTD_TEST(bootflow_cros, UTF_CONSOLE); /* Test Android bootmeth */ static int bootflow_android(struct unit_test_state *uts) @@ -1221,4 +1204,4 @@ static int bootflow_android(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootflow_android, 0); +BOOTSTD_TEST(bootflow_android, UTF_CONSOLE); diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c index 113b789ea79..518d99c4a27 100644 --- a/test/boot/bootmeth.c +++ b/test/boot/bootmeth.c @@ -16,7 +16,6 @@ /* Check 'bootmeth list' command */ static int bootmeth_cmd_list(struct unit_test_state *uts) { - console_record_reset_enable(); ut_assertok(run_command("bootmeth list", 0)); ut_assert_nextline("Order Seq Name Description"); ut_assert_nextlinen("---"); @@ -31,13 +30,12 @@ static int bootmeth_cmd_list(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootmeth_cmd_list, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootmeth_cmd_list, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootmeth order' command */ static int bootmeth_cmd_order(struct unit_test_state *uts) { /* Select just one bootmethod */ - console_record_reset_enable(); ut_assertok(run_command("bootmeth order extlinux", 0)); ut_assert_console_end(); ut_assertnonnull(env_get("bootmeths")); @@ -104,7 +102,7 @@ static int bootmeth_cmd_order(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootmeth_cmd_order, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootmeth_cmd_order, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootmeth order' command with global bootmeths */ static int bootmeth_cmd_order_glob(struct unit_test_state *uts) @@ -112,7 +110,6 @@ static int bootmeth_cmd_order_glob(struct unit_test_state *uts) if (!IS_ENABLED(CONFIG_BOOTMETH_GLOBAL)) return -EAGAIN; - console_record_reset_enable(); ut_assertok(run_command("bootmeth order \"efi firmware0\"", 0)); ut_assert_console_end(); ut_assertok(run_command("bootmeth list", 0)); @@ -128,7 +125,7 @@ static int bootmeth_cmd_order_glob(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootmeth_cmd_order_glob, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootmeth_cmd_order_glob, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check 'bootmeths' env var */ static int bootmeth_env(struct unit_test_state *uts) @@ -138,7 +135,6 @@ static int bootmeth_env(struct unit_test_state *uts) ut_assertok(bootstd_get_priv(&std)); /* Select just one bootmethod */ - console_record_reset_enable(); ut_assertok(env_set("bootmeths", "extlinux")); ut_asserteq(1, std->bootmeth_count); @@ -154,7 +150,7 @@ static int bootmeth_env(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootmeth_env, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootmeth_env, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check the get_state_desc() method */ static int bootmeth_state(struct unit_test_state *uts) @@ -170,4 +166,4 @@ static int bootmeth_state(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(bootmeth_state, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(bootmeth_state, UTF_DM | UTF_SCAN_FDT); diff --git a/test/boot/cedit.c b/test/boot/cedit.c index fd19da0a0c0..1f7af8e5d79 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -25,8 +25,6 @@ static int cedit_base(struct unit_test_state *uts) ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0)); - console_record_reset_enable(); - /* * ^N Move down to second menu * ^M Open menu @@ -52,7 +50,7 @@ static int cedit_base(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(cedit_base, 0); +BOOTSTD_TEST(cedit_base, UTF_CONSOLE); /* Check the cedit write_fdt and read_fdt commands */ static int cedit_fdt(struct unit_test_state *uts) @@ -70,7 +68,6 @@ static int cedit_fdt(struct unit_test_state *uts) void *fdt; int i; - console_record_reset_enable(); ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0)); ut_asserteq(ID_SCENE1, cedit_prepare(cur_exp, &vid_priv, &scn)); @@ -122,7 +119,7 @@ static int cedit_fdt(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(cedit_fdt, 0); +BOOTSTD_TEST(cedit_fdt, UTF_CONSOLE); /* Check the cedit write_env and read_env commands */ static int cedit_env(struct unit_test_state *uts) @@ -134,7 +131,6 @@ static int cedit_env(struct unit_test_state *uts) struct scene *scn; char *str; - console_record_reset_enable(); ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0)); ut_asserteq(ID_SCENE1, cedit_prepare(cur_exp, &vid_priv, &scn)); @@ -177,7 +173,7 @@ static int cedit_env(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(cedit_env, 0); +BOOTSTD_TEST(cedit_env, UTF_CONSOLE); /* Check the cedit write_cmos and read_cmos commands */ static int cedit_cmos(struct unit_test_state *uts) @@ -187,7 +183,6 @@ static int cedit_cmos(struct unit_test_state *uts) extern struct expo *cur_exp; struct scene *scn; - console_record_reset_enable(); ut_assertok(run_command("cedit load hostfs - cedit.dtb", 0)); ut_asserteq(ID_SCENE1, cedit_prepare(cur_exp, &vid_priv, &scn)); @@ -218,4 +213,4 @@ static int cedit_cmos(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(cedit_cmos, 0); +BOOTSTD_TEST(cedit_cmos, UTF_CONSOLE); diff --git a/test/boot/expo.c b/test/boot/expo.c index 6ea0184373d..4b24f504e21 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -114,7 +114,7 @@ static int expo_base(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(expo_base, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(expo_base, UTF_DM | UTF_SCAN_FDT); /* Check creating a scene */ static int expo_scene(struct unit_test_state *uts) @@ -165,7 +165,7 @@ static int expo_scene(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(expo_scene, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(expo_scene, UTF_DM | UTF_SCAN_FDT); /* Check creating a scene with objects */ static int expo_object(struct unit_test_state *uts) @@ -225,7 +225,7 @@ static int expo_object(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(expo_object, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(expo_object, UTF_DM | UTF_SCAN_FDT); /* Check setting object attributes and using themes */ static int expo_object_attr(struct unit_test_state *uts) @@ -286,7 +286,7 @@ static int expo_object_attr(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(expo_object_attr, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(expo_object_attr, UTF_DM | UTF_SCAN_FDT); /** * struct test_iter_priv - private data for expo-iterator test @@ -432,7 +432,7 @@ static int expo_object_menu(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(expo_object_menu, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(expo_object_menu, UTF_DM | UTF_SCAN_FDT); /* Check rendering a scene */ static int expo_render_image(struct unit_test_state *uts) @@ -445,7 +445,6 @@ static int expo_render_image(struct unit_test_state *uts) struct expo *exp; int id; - console_record_reset_enable(); ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev)); ut_assertok(expo_new(EXPO_NAME, NULL, &exp)); @@ -633,7 +632,7 @@ static int expo_render_image(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(expo_render_image, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(expo_render_image, UTF_DM | UTF_SCAN_FDT | UTF_CONSOLE); /* Check building an expo from a devicetree description */ static int expo_test_build(struct unit_test_state *uts) @@ -712,4 +711,4 @@ static int expo_test_build(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(expo_test_build, UT_TESTF_DM); +BOOTSTD_TEST(expo_test_build, UTF_DM); diff --git a/test/boot/upl.c b/test/boot/upl.c index 364fb0526e4..99f02b7951b 100644 --- a/test/boot/upl.c +++ b/test/boot/upl.c @@ -374,7 +374,7 @@ static int upl_test_info(struct unit_test_state *uts) return 0; } -UPL_TEST(upl_test_info, UT_TESTF_CONSOLE_REC); +UPL_TEST(upl_test_info, UTF_CONSOLE); /* Test 'upl read' and 'upl_write' commands */ static int upl_test_read_write(struct unit_test_state *uts) @@ -396,7 +396,7 @@ static int upl_test_read_write(struct unit_test_state *uts) return 0; } -UPL_TEST(upl_test_read_write, UT_TESTF_CONSOLE_REC); +UPL_TEST(upl_test_read_write, UTF_CONSOLE); /* Test UPL passthrough */ static int upl_test_info_norun(struct unit_test_state *uts) @@ -425,7 +425,7 @@ static int upl_test_info_norun(struct unit_test_state *uts) return 0; } -UPL_TEST(upl_test_info_norun, UT_TESTF_CONSOLE_REC | UT_TESTF_MANUAL); +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[]) { diff --git a/test/boot/vbe_fixup.c b/test/boot/vbe_fixup.c index 540816e42b0..5bc026dbb59 100644 --- a/test/boot/vbe_fixup.c +++ b/test/boot/vbe_fixup.c @@ -51,5 +51,5 @@ static int vbe_test_fixup_norun(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(vbe_test_fixup_norun, UT_TESTF_DM | UT_TESTF_SCAN_FDT | - UT_TESTF_FLAT_TREE | UT_TESTF_MANUAL); +BOOTSTD_TEST(vbe_test_fixup_norun, UTF_DM | UTF_SCAN_FDT | UTF_FLAT_TREE | + UTF_MANUAL); diff --git a/test/boot/vbe_simple.c b/test/boot/vbe_simple.c index 3672b744e5f..4fe4323b401 100644 --- a/test/boot/vbe_simple.c +++ b/test/boot/vbe_simple.c @@ -85,4 +85,4 @@ static int vbe_simple_test_base(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(vbe_simple_test_base, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +BOOTSTD_TEST(vbe_simple_test_base, UTF_DM | UTF_SCAN_FDT); diff --git a/test/cmd/addrmap.c b/test/cmd/addrmap.c index 7b8f49fd375..b34be895f5d 100644 --- a/test/cmd/addrmap.c +++ b/test/cmd/addrmap.c @@ -15,7 +15,6 @@ /* Test 'addrmap' command output */ static int addrmap_test_basic(struct unit_test_state *uts) { - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("addrmap", 0)); ut_assert_nextline(" vaddr paddr size"); ut_assert_nextline("================ ================ ================"); @@ -24,7 +23,7 @@ static int addrmap_test_basic(struct unit_test_state *uts) return 0; } -ADDRMAP_TEST(addrmap_test_basic, UT_TESTF_CONSOLE_REC); +ADDRMAP_TEST(addrmap_test_basic, UTF_CONSOLE); int do_ut_addrmap(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/cmd/armffa.c b/test/cmd/armffa.c index 38f40b72f5e..fd578f3087f 100644 --- a/test/cmd/armffa.c +++ b/test/cmd/armffa.c @@ -28,5 +28,4 @@ static int dm_test_armffa_cmd(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_armffa_cmd, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_armffa_cmd, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/cmd/bdinfo.c b/test/cmd/bdinfo.c index 591390560b7..e624226cacf 100644 --- a/test/cmd/bdinfo.c +++ b/test/cmd/bdinfo.c @@ -232,22 +232,19 @@ static int bdinfo_test_all(struct unit_test_state *uts) static int bdinfo_test_full(struct unit_test_state *uts) { /* Test BDINFO full print */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("bdinfo")); ut_assertok(bdinfo_test_all(uts)); ut_assertok(run_commandf("bdinfo -a")); ut_assertok(bdinfo_test_all(uts)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } - -BDINFO_TEST(bdinfo_test_full, UT_TESTF_CONSOLE_REC); +BDINFO_TEST(bdinfo_test_full, UTF_CONSOLE); static int bdinfo_test_help(struct unit_test_state *uts) { /* Test BDINFO unknown option help text print */ - ut_assertok(console_record_reset_enable()); if (!CONFIG_IS_ENABLED(GETOPT)) { ut_asserteq(0, run_commandf("bdinfo -h")); ut_assertok(bdinfo_test_all(uts)); @@ -259,44 +256,39 @@ static int bdinfo_test_help(struct unit_test_state *uts) ut_assert_nextlinen("Usage:"); ut_assert_nextlinen("bdinfo"); } - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } - -BDINFO_TEST(bdinfo_test_help, UT_TESTF_CONSOLE_REC); +BDINFO_TEST(bdinfo_test_help, UTF_CONSOLE); static int bdinfo_test_memory(struct unit_test_state *uts) { /* Test BDINFO memory layout only print */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("bdinfo -m")); if (!CONFIG_IS_ENABLED(GETOPT)) ut_assertok(bdinfo_test_all(uts)); else ut_assertok(bdinfo_check_mem(uts)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } - -BDINFO_TEST(bdinfo_test_memory, UT_TESTF_CONSOLE_REC); +BDINFO_TEST(bdinfo_test_memory, UTF_CONSOLE); static int bdinfo_test_eth(struct unit_test_state *uts) { /* Test BDINFO ethernet settings only print */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("bdinfo -e")); if (!CONFIG_IS_ENABLED(GETOPT)) ut_assertok(bdinfo_test_all(uts)); else if (IS_ENABLED(CONFIG_CMD_NET)) ut_assertok(test_eth(uts)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } - -BDINFO_TEST(bdinfo_test_eth, UT_TESTF_CONSOLE_REC); +BDINFO_TEST(bdinfo_test_eth, UTF_CONSOLE); int do_ut_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/cmd/exit.c b/test/cmd/exit.c index d310ec8531b..af58a57fca7 100644 --- a/test/cmd/exit.c +++ b/test/cmd/exit.c @@ -33,96 +33,83 @@ static int cmd_exit_test(struct unit_test_state *uts) * - return value can be printed outside of 'run' command */ for (i = -3; i <= 3; i++) { - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; exit %d ; echo baz' ; run foo ; echo $?", i)); ut_assert_nextline("bar"); ut_assert_nextline("%d", i > 0 ? i : 0); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; exit %d ; echo baz' ; run foo && echo quux ; echo $?", i)); ut_assert_nextline("bar"); if (i <= 0) ut_assert_nextline("quux"); ut_assert_nextline("%d", i > 0 ? i : 0); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; exit %d ; echo baz' ; run foo || echo quux ; echo $?", i)); ut_assert_nextline("bar"); if (i > 0) ut_assert_nextline("quux"); /* Either 'exit' returns 0, or 'echo quux' returns 0 */ ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); } /* Validate that 'exit' behaves the same way as 'exit 0' */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; exit ; echo baz' ; run foo ; echo $?")); ut_assert_nextline("bar"); ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; exit ; echo baz' ; run foo && echo quux ; echo $?")); ut_assert_nextline("bar"); ut_assert_nextline("quux"); ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; exit ; echo baz' ; run foo || echo quux ; echo $?")); ut_assert_nextline("bar"); /* Either 'exit' returns 0, or 'echo quux' returns 0 */ ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Validate that return value still propagates from 'run' command */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; true' ; run foo ; echo $?")); ut_assert_nextline("bar"); ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; true' ; run foo && echo quux ; echo $?")); ut_assert_nextline("bar"); ut_assert_nextline("quux"); ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; true' ; run foo || echo quux ; echo $?")); ut_assert_nextline("bar"); /* The 'true' returns 0 */ ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; false' ; run foo ; echo $?")); ut_assert_nextline("bar"); ut_assert_nextline("1"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; false' ; run foo && echo quux ; echo $?")); ut_assert_nextline("bar"); ut_assert_nextline("1"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("setenv foo 'echo bar ; false' ; run foo || echo quux ; echo $?")); ut_assert_nextline("bar"); ut_assert_nextline("quux"); /* The 'echo quux' returns 0 */ ut_assert_nextline("0"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } - -EXIT_TEST(cmd_exit_test, UT_TESTF_CONSOLE_REC); +EXIT_TEST(cmd_exit_test, UTF_CONSOLE); int do_ut_exit(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/cmd/fdt.c b/test/cmd/fdt.c index e09a929a5e4..e64785101cd 100644 --- a/test/cmd/fdt.c +++ b/test/cmd/fdt.c @@ -28,35 +28,49 @@ DECLARE_GLOBAL_DATA_PTR; /** * make_test_fdt() - Create an FDT with just a root node * - * The size is set to the minimum needed + * The size is set to the minimum needed. This also sets the working FDT and + * checks that the expected output is received from doing so. * * @uts: Test state * @fdt: Place to write FDT * @size: Maximum size of space for fdt + * @addrp: Returns address of the devicetree */ -static int make_test_fdt(struct unit_test_state *uts, void *fdt, int size) +static int make_test_fdt(struct unit_test_state *uts, void *fdt, int size, + ulong *addrp) { + ulong addr; + ut_assertok(fdt_create(fdt, size)); ut_assertok(fdt_finish_reservemap(fdt)); ut_assert(fdt_begin_node(fdt, "") >= 0); ut_assertok(fdt_end_node(fdt)); ut_assertok(fdt_finish(fdt)); + addr = map_to_sysmem(fdt); + set_working_fdt_addr(addr); + ut_assert_nextline("Working FDT set to %lx", addr); + *addrp = addr; + return 0; } /** * make_fuller_fdt() - Create an FDT with root node and properties * - * The size is set to the minimum needed + * The size is set to the minimum needed. This also sets the working FDT and + * checks that the expected output is received from doing so. * * @uts: Test state * @fdt: Place to write FDT * @size: Maximum size of space for fdt + * @addrp: Returns address of the devicetree */ -static int make_fuller_fdt(struct unit_test_state *uts, void *fdt, int size) +static int make_fuller_fdt(struct unit_test_state *uts, void *fdt, int size, + ulong *addrp) { fdt32_t regs[2] = { cpu_to_fdt32(0x1234), cpu_to_fdt32(0x1000) }; + ulong addr; /* * Assemble the following DT for test purposes: @@ -138,6 +152,11 @@ static int make_fuller_fdt(struct unit_test_state *uts, void *fdt, int size) ut_assertok(fdt_end_node(fdt)); ut_assertok(fdt_finish(fdt)); + addr = map_to_sysmem(fdt); + set_working_fdt_addr(addr); + ut_assert_nextline("Working FDT set to %lx", addr); + *addrp = addr; + return 0; } @@ -149,11 +168,10 @@ static int fdt_test_addr(struct unit_test_state *uts) ulong addr; int ret; - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("fdt addr -c", 0)); ut_assert_nextline("Control fdt: %08lx", (ulong)map_to_sysmem(gd->fdt_blob)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* The working fdt is not set, so this should fail */ set_working_fdt_addr(0); @@ -166,16 +184,13 @@ static int fdt_test_addr(struct unit_test_state *uts) */ if (IS_ENABLED(CONFIG_SANDBOX)) ut_assert_nextline("libfdt fdt_check_header(): FDT_ERR_BADMAGIC"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Set up a working FDT and try again */ - ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); - ut_assert_nextline("Working FDT set to %lx", addr); + ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr)); ut_assertok(run_command("fdt addr", 0)); ut_assert_nextline("Working fdt: %08lx", (ulong)map_to_sysmem(fdt)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Set the working FDT */ set_working_fdt_addr(0); @@ -183,7 +198,7 @@ static int fdt_test_addr(struct unit_test_state *uts) ut_assertok(run_commandf("fdt addr %08lx", addr)); ut_assert_nextline("Working FDT set to %lx", addr); ut_asserteq(addr, map_to_sysmem(working_fdt)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); set_working_fdt_addr(0); ut_assert_nextline("Working FDT set to 0"); @@ -195,13 +210,13 @@ static int fdt_test_addr(struct unit_test_state *uts) gd->fdt_blob = fdt_blob; ut_assertok(ret); ut_asserteq(addr, map_to_sysmem(new_fdt)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test setting an invalid FDT */ fdt[0] = 123; ut_asserteq(1, run_commandf("fdt addr %08lx", addr)); ut_assert_nextline("libfdt fdt_check_header(): FDT_ERR_BADMAGIC"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test detecting an invalid FDT */ fdt[0] = 123; @@ -209,11 +224,11 @@ static int fdt_test_addr(struct unit_test_state *uts) ut_assert_nextline("Working FDT set to %lx", addr); ut_asserteq(1, run_commandf("fdt addr")); ut_assert_nextline("libfdt fdt_check_header(): FDT_ERR_BADMAGIC"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_addr, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_addr, UTF_CONSOLE); /* Test 'fdt addr' resizing an fdt */ static int fdt_test_addr_resize(struct unit_test_state *uts) @@ -222,32 +237,29 @@ static int fdt_test_addr_resize(struct unit_test_state *uts) const int newsize = sizeof(fdt) / 2; ulong addr; - ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test setting and resizing the working FDT to a larger size */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt addr %08lx %x", addr, newsize)); ut_assert_nextline("Working FDT set to %lx", addr); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Try shrinking it */ ut_assertok(run_commandf("fdt addr %08lx %zx", addr, sizeof(fdt) / 4)); ut_assert_nextline("Working FDT set to %lx", addr); ut_assert_nextline("New length %d < existing length %d, ignoring", (int)sizeof(fdt) / 4, newsize); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* ...quietly */ ut_assertok(run_commandf("fdt addr -q %08lx %zx", addr, sizeof(fdt) / 4)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* We cannot easily provoke errors in fdt_open_into(), so ignore that */ return 0; } -FDT_TEST(fdt_test_addr_resize, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_addr_resize, UTF_CONSOLE); static int fdt_test_move(struct unit_test_state *uts) { @@ -258,30 +270,26 @@ static int fdt_test_move(struct unit_test_state *uts) void *buf; /* Original source DT */ - ut_assertok(make_test_fdt(uts, fdt, size)); + ut_assertok(make_test_fdt(uts, fdt, size, &addr)); ts = fdt_totalsize(fdt); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); /* Moved target DT location */ buf = map_sysmem(newaddr, size); memset(buf, 0, size); /* Test moving the working FDT to a new location */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt move %08lx %08lx %x", addr, newaddr, ts)); ut_assert_nextline("Working FDT set to %lx", newaddr); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Compare the source and destination DTs */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("cmp.b %08lx %08lx %x", addr, newaddr, ts)); ut_assert_nextline("Total of %d byte(s) were the same", ts); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_move, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_move, UTF_CONSOLE); static int fdt_test_resize(struct unit_test_state *uts) { @@ -291,21 +299,18 @@ static int fdt_test_resize(struct unit_test_state *uts) ulong addr; /* Original source DT */ - ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); + ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr)); fdt_shrink_to_minimum(fdt, 0); /* Resize with 0 extra bytes */ ts = fdt_totalsize(fdt); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); /* Test resizing the working FDT and verify the new space was added */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt resize %x", newsize)); ut_asserteq(ts + newsize, fdt_totalsize(fdt)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_resize, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_resize, UTF_CONSOLE); static int fdt_test_print_list_common(struct unit_test_state *uts, const char *opc, const char *node) @@ -314,56 +319,50 @@ static int fdt_test_print_list_common(struct unit_test_state *uts, * Test printing/listing the working FDT * subnode $node/subnode */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s %s/subnode", opc, node)); ut_assert_nextline("subnode {"); ut_assert_nextline("\t#address-cells = <0x00000000>;"); ut_assert_nextline("\t#size-cells = <0x00000000>;"); ut_assert_nextline("\tcompatible = \"u-boot,fdt-subnode-test-device\";"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Test printing/listing the working FDT * path / string property model */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s / model", opc)); ut_assert_nextline("model = \"U-Boot FDT test\""); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Test printing/listing the working FDT * path $node string property compatible */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s %s compatible", opc, node)); ut_assert_nextline("compatible = \"u-boot,fdt-test-device1\""); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Test printing/listing the working FDT * path $node stringlist property clock-names */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s %s clock-names", opc, node)); ut_assert_nextline("clock-names = \"fixed\", \"i2c\", \"spi\", \"uart2\", \"uart1\""); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Test printing/listing the working FDT * path $node u32 property clock-frequency */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s %s clock-frequency", opc, node)); ut_assert_nextline("clock-frequency = <0x00fde800>"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Test printing/listing the working FDT * path $node empty property u-boot,empty-property */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s %s u-boot,empty-property", opc, node)); /* * This is the only 'fdt print' / 'fdt list' incantation which @@ -371,16 +370,15 @@ static int fdt_test_print_list_common(struct unit_test_state *uts, * since the beginning of the command 'fdt', keep it. */ ut_assert_nextline("%s u-boot,empty-property", node); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Test printing/listing the working FDT * path $node prop-encoded array property regs */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s %s regs", opc, node)); ut_assert_nextline("regs = <0x00001234 0x00001000>"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -393,12 +391,9 @@ static int fdt_test_print_list(struct unit_test_state *uts, bool print) int ret; /* Original source DT */ - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test printing/listing the working FDT -- node / */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt %s", opc)); ut_assert_nextline("/ {"); ut_assert_nextline("\t#address-cells = <0x00000001>;"); @@ -429,7 +424,7 @@ static int fdt_test_print_list(struct unit_test_state *uts, bool print) } ut_assert_nextline("\t};"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); ret = fdt_test_print_list_common(uts, opc, "/test-node@1234"); if (!ret) @@ -442,13 +437,13 @@ static int fdt_test_print(struct unit_test_state *uts) { return fdt_test_print_list(uts, true); } -FDT_TEST(fdt_test_print, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_print, UTF_CONSOLE); static int fdt_test_list(struct unit_test_state *uts) { return fdt_test_print_list(uts, false); } -FDT_TEST(fdt_test_list, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_list, UTF_CONSOLE); /* Test 'fdt get value' reading an fdt */ static int fdt_test_get_value_string(struct unit_test_state *uts, @@ -456,15 +451,13 @@ static int fdt_test_get_value_string(struct unit_test_state *uts, const char *idx, const char *strres, const int intres) { - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt get value var %s %s %s", node, prop, idx ? : "")); - if (strres) { + if (strres) ut_asserteq_str(strres, env_get("var")); - } else { + else ut_asserteq(intres, env_get_hex("var", 0x1234)); - } - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -473,16 +466,20 @@ static int fdt_test_get_value_common(struct unit_test_state *uts, const char *node) { /* Test getting default element of $node node clock-names property */ - fdt_test_get_value_string(uts, node, "clock-names", NULL, "fixed", 0); + ut_assertok(fdt_test_get_value_string(uts, node, "clock-names", NULL, + "fixed", 0)); /* Test getting 0th element of $node node clock-names property */ - fdt_test_get_value_string(uts, node, "clock-names", "0", "fixed", 0); + ut_assertok(fdt_test_get_value_string(uts, node, "clock-names", "0", + "fixed", 0)); /* Test getting 1st element of $node node clock-names property */ - fdt_test_get_value_string(uts, node, "clock-names", "1", "i2c", 0); + ut_assertok(fdt_test_get_value_string(uts, node, "clock-names", "1", + "i2c", 0)); /* Test getting 2nd element of $node node clock-names property */ - fdt_test_get_value_string(uts, node, "clock-names", "2", "spi", 0); + ut_assertok(fdt_test_get_value_string(uts, node, "clock-names", "2", + "spi", 0)); /* * Test getting default element of $node node regs property. @@ -491,29 +488,29 @@ static int fdt_test_get_value_common(struct unit_test_state *uts, * but only if the array is shorter than 40 characters. Anything * longer is an error. This is a special case for handling hashes. */ - fdt_test_get_value_string(uts, node, "regs", NULL, "3412000000100000", 0); + ut_assertok(fdt_test_get_value_string(uts, node, "regs", NULL, + "3412000000100000", 0)); /* Test getting 0th element of $node node regs property */ - fdt_test_get_value_string(uts, node, "regs", "0", NULL, 0x1234); + ut_assertok(fdt_test_get_value_string(uts, node, "regs", "0", NULL, + 0x1234)); /* Test getting 1st element of $node node regs property */ - fdt_test_get_value_string(uts, node, "regs", "1", NULL, 0x1000); + ut_assertok(fdt_test_get_value_string(uts, node, "regs", "1", NULL, + 0x1000)); /* Test missing 10th element of $node node clock-names property */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt get value ften %s clock-names 10", node)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test missing 10th element of $node node regs property */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt get value ften %s regs 10", node)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting default element of $node node nonexistent property */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt get value fnone %s nonexistent", node)); ut_assert_nextline("libfdt fdt_getprop(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -522,118 +519,97 @@ static int fdt_test_get_value(struct unit_test_state *uts) { char fdt[4096]; ulong addr; - int ret; - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); - ret = fdt_test_get_value_common(uts, "/test-node@1234"); - if (!ret) - ret = fdt_test_get_value_common(uts, "testnodealias"); - if (ret) - return ret; + ut_assertok(fdt_test_get_value_common(uts, "/test-node@1234")); + ut_assertok(fdt_test_get_value_common(uts, "testnodealias")); /* Test getting default element of /nonexistent node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get value fnode /nonexistent nonexistent", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting default element of bad alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get value vbadalias badalias nonexistent", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting default element of nonexistent alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get value vnoalias noalias nonexistent", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_BADPATH"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_get_value, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_get_value, UTF_CONSOLE); static int fdt_test_get_name(struct unit_test_state *uts) { char fdt[4096]; ulong addr; - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test getting name of node 0 in /, which is /aliases node */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("fdt get name nzero / 0", 0)); ut_asserteq_str("aliases", env_get("nzero")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of node 1 in /, which is /test-node@1234 node */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("fdt get name none / 1", 0)); ut_asserteq_str("test-node@1234", env_get("none")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of node -1 in /, which is /aliases node, same as 0 */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("fdt get name nmone / -1", 0)); ut_asserteq_str("aliases", env_get("nmone")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of node 2 in /, which does not exist */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get name ntwo / 2", 1)); ut_assert_nextline("libfdt node not found"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of node 0 in /test-node@1234, which is /subnode node */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("fdt get name snzero /test-node@1234 0", 0)); ut_asserteq_str("subnode", env_get("snzero")); ut_assertok(run_command("fdt get name asnzero testnodealias 0", 0)); ut_asserteq_str("subnode", env_get("asnzero")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of node 1 in /test-node@1234, which does not exist */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get name snone /test-node@1234 1", 1)); ut_assert_nextline("libfdt node not found"); ut_asserteq(1, run_command("fdt get name asnone testnodealias 1", 1)); ut_assert_nextline("libfdt node not found"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of node -1 in /test-node@1234, which is /subnode node, same as 0 */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("fdt get name snmone /test-node@1234 -1", 0)); ut_asserteq_str("subnode", env_get("snmone")); ut_assertok(run_command("fdt get name asnmone testnodealias -1", 0)); ut_asserteq_str("subnode", env_get("asnmone")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of nonexistent node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get name nonode /nonexistent 0", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of bad alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get name vbadalias badalias 0", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting name of nonexistent alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get name vnoalias noalias 0", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_BADPATH"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_get_name, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_get_name, UTF_CONSOLE); static int fdt_test_get_addr_common(struct unit_test_state *uts, char *fdt, const char *path, const char *prop) @@ -649,11 +625,10 @@ static int fdt_test_get_addr_common(struct unit_test_state *uts, char *fdt, ut_assertnonnull(prop_ptr); offset = (char *)prop_ptr - fdt; - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt get addr pstr %s %s", path, prop)); ut_asserteq((ulong)map_sysmem(env_get_hex("fdtaddr", 0x1234), 0), (ulong)(map_sysmem(env_get_hex("pstr", 0x1234), 0) - offset)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -663,57 +638,60 @@ static int fdt_test_get_addr(struct unit_test_state *uts) char fdt[4096]; ulong addr; - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test getting address of root node / string property "compatible" */ - fdt_test_get_addr_common(uts, fdt, "/", "compatible"); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "/", "compatible")); /* Test getting address of node /test-node@1234 stringlist property "clock-names" */ - fdt_test_get_addr_common(uts, fdt, "/test-node@1234", "clock-names"); - fdt_test_get_addr_common(uts, fdt, "testnodealias", "clock-names"); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "/test-node@1234", + "clock-names")); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "testnodealias", + "clock-names")); /* Test getting address of node /test-node@1234 u32 property "clock-frequency" */ - fdt_test_get_addr_common(uts, fdt, "/test-node@1234", "clock-frequency"); - fdt_test_get_addr_common(uts, fdt, "testnodealias", "clock-frequency"); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "/test-node@1234", + "clock-frequency")); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "testnodealias", + "clock-frequency")); /* Test getting address of node /test-node@1234 empty property "u-boot,empty-property" */ - fdt_test_get_addr_common(uts, fdt, "/test-node@1234", "u-boot,empty-property"); - fdt_test_get_addr_common(uts, fdt, "testnodealias", "u-boot,empty-property"); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "/test-node@1234", + "u-boot,empty-property")); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "testnodealias", + "u-boot,empty-property")); /* Test getting address of node /test-node@1234 array property "regs" */ - fdt_test_get_addr_common(uts, fdt, "/test-node@1234", "regs"); - fdt_test_get_addr_common(uts, fdt, "testnodealias", "regs"); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "/test-node@1234", + "regs")); + ut_assertok(fdt_test_get_addr_common(uts, fdt, "testnodealias", + "regs")); /* Test getting address of node /test-node@1234/subnode non-existent property "noprop" */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get addr pnoprop /test-node@1234/subnode noprop", 1)); ut_assert_nextline("libfdt fdt_getprop(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting address of non-existent node /test-node@1234/nonode@1 property "noprop" */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get addr pnonode /test-node@1234/nonode@1 noprop", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_get_addr, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_get_addr, UTF_CONSOLE); static int fdt_test_get_size_common(struct unit_test_state *uts, const char *path, const char *prop, const unsigned int val) { - ut_assertok(console_record_reset_enable()); if (prop) { ut_assertok(run_commandf("fdt get size sstr %s %s", path, prop)); } else { ut_assertok(run_commandf("fdt get size sstr %s", path)); } ut_asserteq(val, env_get_hex("sstr", 0x1234)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -723,71 +701,72 @@ static int fdt_test_get_size(struct unit_test_state *uts) char fdt[4096]; ulong addr; - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test getting size of root node / string property "compatible" */ - fdt_test_get_size_common(uts, "/", "compatible", 16); + ut_assertok(fdt_test_get_size_common(uts, "/", "compatible", 16)); /* Test getting size of node /test-node@1234 stringlist property "clock-names" */ - fdt_test_get_size_common(uts, "/test-node@1234", "clock-names", 26); - fdt_test_get_size_common(uts, "testnodealias", "clock-names", 26); + ut_assertok(fdt_test_get_size_common(uts, "/test-node@1234", + "clock-names", 26)); + ut_assertok(fdt_test_get_size_common(uts, "testnodealias", + "clock-names", 26)); /* Test getting size of node /test-node@1234 u32 property "clock-frequency" */ - fdt_test_get_size_common(uts, "/test-node@1234", "clock-frequency", 4); - fdt_test_get_size_common(uts, "testnodealias", "clock-frequency", 4); + ut_assertok(fdt_test_get_size_common(uts, "/test-node@1234", + "clock-frequency", 4)); + ut_assertok(fdt_test_get_size_common(uts, "testnodealias", + "clock-frequency", 4)); /* Test getting size of node /test-node@1234 empty property "u-boot,empty-property" */ - fdt_test_get_size_common(uts, "/test-node@1234", "u-boot,empty-property", 0); - fdt_test_get_size_common(uts, "testnodealias", "u-boot,empty-property", 0); + ut_assertok(fdt_test_get_size_common(uts, "/test-node@1234", + "u-boot,empty-property", 0)); + ut_assertok(fdt_test_get_size_common(uts, "testnodealias", + "u-boot,empty-property", 0)); /* Test getting size of node /test-node@1234 array property "regs" */ - fdt_test_get_size_common(uts, "/test-node@1234", "regs", 8); - fdt_test_get_size_common(uts, "testnodealias", "regs", 8); + ut_assertok(fdt_test_get_size_common(uts, "/test-node@1234", "regs", + 8)); + ut_assertok(fdt_test_get_size_common(uts, "testnodealias", "regs", 8)); /* Test getting node count of node / */ - fdt_test_get_size_common(uts, "/", NULL, 2); + ut_assertok(fdt_test_get_size_common(uts, "/", NULL, 2)); /* Test getting node count of node /test-node@1234/subnode */ - fdt_test_get_size_common(uts, "/test-node@1234/subnode", NULL, 0); - fdt_test_get_size_common(uts, "subnodealias", NULL, 0); + ut_assertok(fdt_test_get_size_common(uts, "/test-node@1234/subnode", + NULL, 0)); + ut_assertok(fdt_test_get_size_common(uts, "subnodealias", NULL, 0)); /* Test getting size of node /test-node@1234/subnode non-existent property "noprop" */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get size pnoprop /test-node@1234/subnode noprop", 1)); ut_assert_nextline("libfdt fdt_getprop(): FDT_ERR_NOTFOUND"); ut_asserteq(1, run_command("fdt get size pnoprop subnodealias noprop", 1)); ut_assert_nextline("libfdt fdt_getprop(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting size of non-existent node /test-node@1234/nonode@1 property "noprop" */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get size pnonode /test-node@1234/nonode@1 noprop", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting node count of non-existent node /test-node@1234/nonode@1 */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get size pnonode /test-node@1234/nonode@1", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting node count of bad alias badalias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get size pnonode badalias noprop", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting node count of non-existent alias noalias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt get size pnonode noalias", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_BADPATH"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_get_size, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_get_size, UTF_CONSOLE); static int fdt_test_set_single(struct unit_test_state *uts, const char *path, const char *prop, @@ -799,7 +778,6 @@ static int fdt_test_set_single(struct unit_test_state *uts, * => fdt set /path property integer * => fdt set /path property */ - ut_assertok(console_record_reset_enable()); if (sval) ut_assertok(run_commandf("fdt set %s %s %s", path, prop, sval)); else if (integer) @@ -815,7 +793,7 @@ static int fdt_test_set_single(struct unit_test_state *uts, ut_asserteq(ival, env_get_hex("svar", 0x1234)); else ut_assertnull(env_get("svar")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -837,7 +815,6 @@ static int fdt_test_set_multi(struct unit_test_state *uts, * new array is correctly sized and read past the new array length * triggers failure. */ - ut_assertok(console_record_reset_enable()); if (sval1 && sval2) { ut_assertok(run_commandf("fdt set %s %s %s %s end", path, prop, sval1, sval2)); ut_assertok(run_commandf("fdt set %s %s %s %s", path, prop, sval1, sval2)); @@ -865,7 +842,7 @@ static int fdt_test_set_multi(struct unit_test_state *uts, ut_asserteq(ival2, env_get_hex("svar2", 0x1234)); ut_assertnull(env_get("svarn")); } - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -873,14 +850,14 @@ static int fdt_test_set_multi(struct unit_test_state *uts, static int fdt_test_set_node(struct unit_test_state *uts, const char *path, const char *prop) { - fdt_test_set_single(uts, path, prop, "new", 0, false); - fdt_test_set_single(uts, path, prop, "rewrite", 0, false); - fdt_test_set_single(uts, path, prop, NULL, 42, true); - fdt_test_set_single(uts, path, prop, NULL, 0, false); - fdt_test_set_multi(uts, path, prop, NULL, NULL, 42, 1701); - fdt_test_set_multi(uts, path, prop, NULL, NULL, 74656, 9); - fdt_test_set_multi(uts, path, prop, "42", "1701", 0, 0); - fdt_test_set_multi(uts, path, prop, "74656", "9", 0, 0); + ut_assertok(fdt_test_set_single(uts, path, prop, "new", 0, false)); + ut_assertok(fdt_test_set_single(uts, path, prop, "rewrite", 0, false)); + ut_assertok(fdt_test_set_single(uts, path, prop, NULL, 42, true)); + ut_assertok(fdt_test_set_single(uts, path, prop, NULL, 0, false)); + ut_assertok(fdt_test_set_multi(uts, path, prop, NULL, NULL, 42, 1701)); + ut_assertok(fdt_test_set_multi(uts, path, prop, NULL, NULL, 74656, 9)); + ut_assertok(fdt_test_set_multi(uts, path, prop, "42", "1701", 0, 0)); + ut_assertok(fdt_test_set_multi(uts, path, prop, "74656", "9", 0, 0)); return 0; } @@ -890,198 +867,173 @@ static int fdt_test_set(struct unit_test_state *uts) char fdt[8192]; ulong addr; - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); fdt_shrink_to_minimum(fdt, 4096); /* Resize with 4096 extra bytes */ - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); /* Test setting of root node / existing property "compatible" */ - fdt_test_set_node(uts, "/", "compatible"); + ut_assertok(fdt_test_set_node(uts, "/", "compatible")); /* Test setting of root node / new property "newproperty" */ - fdt_test_set_node(uts, "/", "newproperty"); + ut_assertok(fdt_test_set_node(uts, "/", "newproperty")); /* Test setting of subnode existing property "compatible" */ - fdt_test_set_node(uts, "/test-node@1234/subnode", "compatible"); - fdt_test_set_node(uts, "subnodealias", "compatible"); + ut_assertok(fdt_test_set_node(uts, "/test-node@1234/subnode", + "compatible")); + ut_assertok(fdt_test_set_node(uts, "subnodealias", "compatible")); /* Test setting of subnode new property "newproperty" */ - fdt_test_set_node(uts, "/test-node@1234/subnode", "newproperty"); - fdt_test_set_node(uts, "subnodealias", "newproperty"); + ut_assertok(fdt_test_set_node(uts, "/test-node@1234/subnode", + "newproperty")); + ut_assertok(fdt_test_set_node(uts, "subnodealias", "newproperty")); /* Test setting property of non-existent node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt set /no-node noprop", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test setting property of non-existent alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt set noalias noprop", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_BADPATH"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test setting property of bad alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_command("fdt set badalias noprop", 1)); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_set, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_set, UTF_CONSOLE); static int fdt_test_mknode(struct unit_test_state *uts) { char fdt[8192]; ulong addr; - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); fdt_shrink_to_minimum(fdt, 4096); /* Resize with 4096 extra bytes */ - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); /* Test creation of new node in / */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt mknode / newnode")); ut_assertok(run_commandf("fdt list /newnode")); ut_assert_nextline("newnode {"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test creation of new node in /test-node@1234 */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt mknode /test-node@1234 newsubnode")); ut_assertok(run_commandf("fdt list /test-node@1234/newsubnode")); ut_assert_nextline("newsubnode {"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test creation of new node in /test-node@1234 by alias */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt mknode testnodealias newersubnode")); ut_assertok(run_commandf("fdt list testnodealias/newersubnode")); ut_assert_nextline("newersubnode {"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test creation of new node in /test-node@1234 over existing node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt mknode testnodealias newsubnode")); ut_assert_nextline("libfdt fdt_add_subnode(): FDT_ERR_EXISTS"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test creation of new node in /test-node@1234 by alias over existing node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt mknode testnodealias newersubnode")); ut_assert_nextline("libfdt fdt_add_subnode(): FDT_ERR_EXISTS"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test creation of new node in non-existent node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt mknode /no-node newnosubnode")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test creation of new node in non-existent alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt mknode noalias newfailsubnode")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_BADPATH"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test creation of new node in bad alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt mknode badalias newbadsubnode")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_mknode, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_mknode, UTF_CONSOLE); static int fdt_test_rm(struct unit_test_state *uts) { char fdt[4096]; ulong addr; - ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_fuller_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test removal of property in root node / */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt print / compatible")); ut_assert_nextline("compatible = \"u-boot,fdt-test\""); ut_assertok(run_commandf("fdt rm / compatible")); ut_asserteq(1, run_commandf("fdt print / compatible")); ut_assert_nextline("libfdt fdt_getprop(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of property clock-names in subnode /test-node@1234 */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt print /test-node@1234 clock-names")); ut_assert_nextline("clock-names = \"fixed\", \"i2c\", \"spi\", \"uart2\", \"uart1\""); ut_assertok(run_commandf("fdt rm /test-node@1234 clock-names")); ut_asserteq(1, run_commandf("fdt print /test-node@1234 clock-names")); ut_assert_nextline("libfdt fdt_getprop(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of property u-boot,empty-property in subnode /test-node@1234 by alias */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt print testnodealias u-boot,empty-property")); ut_assert_nextline("testnodealias u-boot,empty-property"); ut_assertok(run_commandf("fdt rm testnodealias u-boot,empty-property")); ut_asserteq(1, run_commandf("fdt print testnodealias u-boot,empty-property")); ut_assert_nextline("libfdt fdt_getprop(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of non-existent property noprop in subnode /test-node@1234 */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt rm /test-node@1234 noprop")); ut_assert_nextline("libfdt fdt_delprop(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of non-existent node /no-node@5678 */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt rm /no-node@5678")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of subnode /test-node@1234/subnode by alias */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt rm subnodealias")); ut_asserteq(1, run_commandf("fdt print /test-node@1234/subnode")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of node by non-existent alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt rm noalias")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_BADPATH"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of node by bad alias */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt rm noalias")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_BADPATH"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of node /test-node@1234 */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt rm /test-node@1234")); ut_asserteq(1, run_commandf("fdt print /test-node@1234")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test removal of node / */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt rm /")); ut_asserteq(1, run_commandf("fdt print /")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_rm, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_rm, UTF_CONSOLE); static int fdt_test_bootcpu(struct unit_test_state *uts) { @@ -1089,46 +1041,39 @@ static int fdt_test_bootcpu(struct unit_test_state *uts) ulong addr; int i; - ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test getting default bootcpu entry */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt header get bootcpu boot_cpuid_phys")); ut_asserteq(0, env_get_ulong("bootcpu", 10, 0x1234)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test setting and getting new bootcpu entry, twice, to test overwrite */ for (i = 42; i <= 43; i++) { - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt bootcpu %d", i)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting new bootcpu entry */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt header get bootcpu boot_cpuid_phys")); ut_asserteq(i, env_get_ulong("bootcpu", 10, 0x1234)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); } return 0; } -FDT_TEST(fdt_test_bootcpu, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_bootcpu, UTF_CONSOLE); static int fdt_test_header_get(struct unit_test_state *uts, const char *field, const unsigned long val) { /* Test getting valid header entry */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt header get fvar %s", field)); ut_asserteq(val, env_get_hex("fvar", 0x1234)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test getting malformed header entry */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt header get fvar typo%stypo", field)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -1138,12 +1083,9 @@ static int fdt_test_header(struct unit_test_state *uts) char fdt[256]; ulong addr; - ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); + ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr)); /* Test header print */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt header")); ut_assert_nextline("magic:\t\t\t0x%x", fdt_magic(fdt)); ut_assert_nextline("totalsize:\t\t0x%x (%d)", fdt_totalsize(fdt), fdt_totalsize(fdt)); @@ -1157,23 +1099,30 @@ static int fdt_test_header(struct unit_test_state *uts) ut_assert_nextline("size_dt_struct:\t\t0x%x", fdt_size_dt_struct(fdt)); ut_assert_nextline("number mem_rsv:\t\t0x%x", fdt_num_mem_rsv(fdt)); ut_assert_nextline_empty(); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test header get */ - fdt_test_header_get(uts, "magic", fdt_magic(fdt)); - fdt_test_header_get(uts, "totalsize", fdt_totalsize(fdt)); - fdt_test_header_get(uts, "off_dt_struct", fdt_off_dt_struct(fdt)); - fdt_test_header_get(uts, "off_dt_strings", fdt_off_dt_strings(fdt)); - fdt_test_header_get(uts, "off_mem_rsvmap", fdt_off_mem_rsvmap(fdt)); - fdt_test_header_get(uts, "version", fdt_version(fdt)); - fdt_test_header_get(uts, "last_comp_version", fdt_last_comp_version(fdt)); - fdt_test_header_get(uts, "boot_cpuid_phys", fdt_boot_cpuid_phys(fdt)); - fdt_test_header_get(uts, "size_dt_strings", fdt_size_dt_strings(fdt)); - fdt_test_header_get(uts, "size_dt_struct", fdt_size_dt_struct(fdt)); + ut_assertok(fdt_test_header_get(uts, "magic", fdt_magic(fdt))); + ut_assertok(fdt_test_header_get(uts, "totalsize", fdt_totalsize(fdt))); + ut_assertok(fdt_test_header_get(uts, "off_dt_struct", + fdt_off_dt_struct(fdt))); + ut_assertok(fdt_test_header_get(uts, "off_dt_strings", + fdt_off_dt_strings(fdt))); + ut_assertok(fdt_test_header_get(uts, "off_mem_rsvmap", + fdt_off_mem_rsvmap(fdt))); + ut_assertok(fdt_test_header_get(uts, "version", fdt_version(fdt))); + ut_assertok(fdt_test_header_get(uts, "last_comp_version", + fdt_last_comp_version(fdt))); + ut_assertok(fdt_test_header_get(uts, "boot_cpuid_phys", + fdt_boot_cpuid_phys(fdt))); + ut_assertok(fdt_test_header_get(uts, "size_dt_strings", + fdt_size_dt_strings(fdt))); + ut_assertok(fdt_test_header_get(uts, "size_dt_struct", + fdt_size_dt_struct(fdt))); return 0; } -FDT_TEST(fdt_test_header, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_header, UTF_CONSOLE); static int fdt_test_memory_cells(struct unit_test_state *uts, const unsigned int cells) @@ -1217,16 +1166,16 @@ static int fdt_test_memory_cells(struct unit_test_state *uts, fdt_shrink_to_minimum(fdt, 4096); /* Resize with 4096 extra bytes */ addr = map_to_sysmem(fdt); set_working_fdt_addr(addr); + ut_assert_nextline("Working FDT set to %lx", addr); /* Test updating the memory node */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt memory 0x%s 0x%s", seta, sets)); ut_assertok(run_commandf("fdt print /memory")); ut_assert_nextline("memory {"); ut_assert_nextline("\tdevice_type = \"memory\";"); ut_assert_nextline("\treg = <%s %s>;", pada, pads); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); free(sets); free(seta); @@ -1244,8 +1193,8 @@ static int fdt_test_memory(struct unit_test_state *uts) * so far unsupported and fails because of simple_stroull() being * 64bit tops in the 'fdt memory' command implementation. */ - fdt_test_memory_cells(uts, 1); - fdt_test_memory_cells(uts, 2); + ut_assertok(fdt_test_memory_cells(uts, 1)); + ut_assertok(fdt_test_memory_cells(uts, 2)); /* * The 'fdt memory' command is limited to /memory node, it does @@ -1256,31 +1205,27 @@ static int fdt_test_memory(struct unit_test_state *uts) return 0; } -FDT_TEST(fdt_test_memory, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_memory, UTF_CONSOLE); static int fdt_test_rsvmem(struct unit_test_state *uts) { char fdt[8192]; ulong addr; - ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); + ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr)); fdt_shrink_to_minimum(fdt, 4096); /* Resize with 4096 extra bytes */ fdt_add_mem_rsv(fdt, 0x42, 0x1701); fdt_add_mem_rsv(fdt, 0x74656, 0x9); - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); /* Test default reserved memory node presence */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt rsvmem print")); ut_assert_nextline("index\t\t start\t\t size"); ut_assert_nextline("------------------------------------------------"); ut_assert_nextline(" %x\t%016x\t%016x", 0, 0x42, 0x1701); ut_assert_nextline(" %x\t%016x\t%016x", 1, 0x74656, 0x9); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test add new reserved memory node */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt rsvmem add 0x1234 0x5678")); ut_assertok(run_commandf("fdt rsvmem print")); ut_assert_nextline("index\t\t start\t\t size"); @@ -1288,20 +1233,18 @@ static int fdt_test_rsvmem(struct unit_test_state *uts) ut_assert_nextline(" %x\t%016x\t%016x", 0, 0x42, 0x1701); ut_assert_nextline(" %x\t%016x\t%016x", 1, 0x74656, 0x9); ut_assert_nextline(" %x\t%016x\t%016x", 2, 0x1234, 0x5678); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test delete reserved memory node */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt rsvmem delete 0")); ut_assertok(run_commandf("fdt rsvmem print")); ut_assert_nextline("index\t\t start\t\t size"); ut_assert_nextline("------------------------------------------------"); ut_assert_nextline(" %x\t%016x\t%016x", 0, 0x74656, 0x9); ut_assert_nextline(" %x\t%016x\t%016x", 1, 0x1234, 0x5678); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test re-add new reserved memory node */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt rsvmem add 0x42 0x1701")); ut_assertok(run_commandf("fdt rsvmem print")); ut_assert_nextline("index\t\t start\t\t size"); @@ -1309,17 +1252,16 @@ static int fdt_test_rsvmem(struct unit_test_state *uts) ut_assert_nextline(" %x\t%016x\t%016x", 0, 0x74656, 0x9); ut_assert_nextline(" %x\t%016x\t%016x", 1, 0x1234, 0x5678); ut_assert_nextline(" %x\t%016x\t%016x", 2, 0x42, 0x1701); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test delete nonexistent reserved memory node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt rsvmem delete 10")); ut_assert_nextline("libfdt fdt_del_mem_rsv(): FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_rsvmem, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_rsvmem, UTF_CONSOLE); static int fdt_test_chosen(struct unit_test_state *uts) { @@ -1327,19 +1269,15 @@ static int fdt_test_chosen(struct unit_test_state *uts) char fdt[8192]; ulong addr; - ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt))); + ut_assertok(make_test_fdt(uts, fdt, sizeof(fdt), &addr)); fdt_shrink_to_minimum(fdt, 4096); /* Resize with 4096 extra bytes */ - addr = map_to_sysmem(fdt); - set_working_fdt_addr(addr); /* Test default chosen node presence, fail as there is no /chosen node */ - ut_assertok(console_record_reset_enable()); ut_asserteq(1, run_commandf("fdt print /chosen")); ut_assert_nextline("libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test add new chosen node without initrd */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt chosen")); ut_assertok(run_commandf("fdt print /chosen")); ut_assert_nextline("chosen {"); @@ -1351,10 +1289,9 @@ static int fdt_test_chosen(struct unit_test_state *uts) !IS_ENABLED(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT)) ut_assert_nextlinen("\tkaslr-seed = "); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test add new chosen node with initrd */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt chosen 0x1234 0x5678")); ut_assertok(run_commandf("fdt print /chosen")); ut_assert_nextline("chosen {"); @@ -1371,11 +1308,11 @@ static int fdt_test_chosen(struct unit_test_state *uts) !IS_ENABLED(CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT)) ut_assert_nextlinen("\tkaslr-seed = "); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_chosen, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_chosen, UTF_CONSOLE); static int fdt_test_apply(struct unit_test_state *uts) { @@ -1393,6 +1330,7 @@ static int fdt_test_apply(struct unit_test_state *uts) fdt_shrink_to_minimum(fdt, 4096); /* Resize with 4096 extra bytes */ addr = map_to_sysmem(fdt); set_working_fdt_addr(addr); + ut_assert_nextline("Working FDT set to %lx", addr); /* Create DTO which adds single property to root node / */ ut_assertok(fdt_create(fdto, sizeof(fdto))); @@ -1408,16 +1346,14 @@ static int fdt_test_apply(struct unit_test_state *uts) addro = map_to_sysmem(fdto); /* Test default DT print */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt print /")); ut_assert_nextline("/ {"); ut_assert_nextline("\t__symbols__ {"); ut_assert_nextline("\t};"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test simple DTO application */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt apply 0x%08lx", addro)); ut_assertok(run_commandf("fdt print /")); ut_assert_nextline("/ {"); @@ -1425,7 +1361,7 @@ static int fdt_test_apply(struct unit_test_state *uts) ut_assert_nextline("\t__symbols__ {"); ut_assert_nextline("\t};"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Create complex DTO which: @@ -1462,7 +1398,6 @@ static int fdt_test_apply(struct unit_test_state *uts) addro = map_to_sysmem(fdto); /* Test complex DTO application */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt apply 0x%08lx", addro)); ut_assertok(run_commandf("fdt print /")); ut_assert_nextline("/ {"); @@ -1479,7 +1414,7 @@ static int fdt_test_apply(struct unit_test_state *uts) ut_assert_nextline("\t\tsubnodephandle = \"/subnode\";"); ut_assert_nextline("\t};"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* * Create complex DTO which: @@ -1506,7 +1441,6 @@ static int fdt_test_apply(struct unit_test_state *uts) addro = map_to_sysmem(fdto); /* Test complex DTO application */ - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("fdt apply 0x%08lx", addro)); ut_assertok(run_commandf("fdt print /")); ut_assert_nextline("/ {"); @@ -1523,11 +1457,11 @@ static int fdt_test_apply(struct unit_test_state *uts) ut_assert_nextline("\t\tsubnodephandle = \"/subnode\";"); ut_assert_nextline("\t};"); ut_assert_nextline("};"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } -FDT_TEST(fdt_test_apply, UT_TESTF_CONSOLE_REC); +FDT_TEST(fdt_test_apply, UTF_CONSOLE); int do_ut_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/cmd/font.c b/test/cmd/font.c index a8905ce617e..25d365dedd2 100644 --- a/test/cmd/font.c +++ b/test/cmd/font.c @@ -26,12 +26,11 @@ static int font_test_base(struct unit_test_state *uts) ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev)); ut_assertok(uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)); - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("font list", 0)); ut_assert_nextline("nimbus_sans_l_regular"); if (IS_ENABLED(CONFIG_CONSOLE_TRUETYPE_CANTORAONE)) ut_assert_nextline("cantoraone_regular"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); ut_assertok(vidconsole_get_font_size(dev, &name, &size)); ut_asserteq_str("nimbus_sans_l_regular", name); @@ -49,19 +48,19 @@ static int font_test_base(struct unit_test_state *uts) if (max_metrics < 2) { ut_asserteq(1, ret); ut_assert_nextline("Failed (error -7)"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } ut_assertok(ret); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); ut_assertok(vidconsole_get_font_size(dev, &name, &size)); ut_asserteq_str("cantoraone_regular", name); ut_asserteq(40, size); ut_assertok(run_command("font size 30", 0)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); ut_assertok(vidconsole_get_font_size(dev, &name, &size)); ut_asserteq_str("cantoraone_regular", name); @@ -69,8 +68,8 @@ static int font_test_base(struct unit_test_state *uts) return 0; } -FONT_TEST(font_test_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | - UT_TESTF_CONSOLE_REC | UT_TESTF_DM); +FONT_TEST(font_test_base, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE | + UTF_DM); int do_ut_font(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/cmd/history.c b/test/cmd/history.c index 6964bfa9e1e..6d9d2288483 100644 --- a/test/cmd/history.c +++ b/test/cmd/history.c @@ -45,4 +45,4 @@ static int lib_test_history(struct unit_test_state *uts) return 0; } -LIB_TEST(lib_test_history, UT_TESTF_CONSOLE_REC); +LIB_TEST(lib_test_history, UTF_CONSOLE); diff --git a/test/cmd/loadm.c b/test/cmd/loadm.c index dff8a97d139..dedb4f7683e 100644 --- a/test/cmd/loadm.c +++ b/test/cmd/loadm.c @@ -23,7 +23,6 @@ static int loadm_test_params(struct unit_test_state *uts) { - ut_assertok(console_record_reset_enable()); run_command("loadm", 0); ut_assert_nextline("loadm - load binary blob from source address to destination address"); @@ -41,7 +40,7 @@ static int loadm_test_params(struct unit_test_state *uts) return 0; } -LOADM_TEST(loadm_test_params, UT_TESTF_CONSOLE_REC); +LOADM_TEST(loadm_test_params, UTF_CONSOLE); static int loadm_test_load (struct unit_test_state *uts) { @@ -51,7 +50,6 @@ static int loadm_test_load (struct unit_test_state *uts) memset(buf, '\0', BUF_SIZE); memset(buf, 0xaa, BUF_SIZE / 2); - ut_assertok(console_record_reset_enable()); run_command("loadm 0x0 0x80 0x80", 0); ut_assert_nextline("loaded bin to memory: size: 128"); @@ -59,7 +57,7 @@ static int loadm_test_load (struct unit_test_state *uts) return 0; } -LOADM_TEST(loadm_test_load, UT_TESTF_CONSOLE_REC); +LOADM_TEST(loadm_test_load, UTF_CONSOLE); int do_ut_loadm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c index 235b363290e..e1a9cdffb04 100644 --- a/test/cmd/mbr.c +++ b/test/cmd/mbr.c @@ -261,11 +261,10 @@ static int mbr_test_run(struct unit_test_state *uts) /* Make sure mmc6 exists */ ut_asserteq(6, blk_get_device_by_str("mmc", "6", &mmc_dev_desc)); - ut_assertok(console_record_reset_enable()); ut_assertok(run_commandf("mmc dev 6")); ut_assert_nextline("switch to partitions #0, OK"); ut_assert_nextline("mmc6 is current device"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Make sure mmc6 is 12+ MiB in size */ ut_assertok(run_commandf("mmc read 0x%lx 0x%lx 1", ra, (ulong)0xBFFE00 / 0x200)); @@ -281,16 +280,16 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(console_record_reset_enable()); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); + ut_assert_nextlinen("MMC read: dev # 6"); ut_assert_nextline("MBR: write success!"); ut_assertok(run_commandf("mbr verify mmc 6")); ut_assert_nextline("MBR: verify success!"); memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| 000001c0 05 01 0e 25 24 01 00 40 00 00 00 08 00 00 00 00 |...%$..@........| @@ -317,7 +316,6 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(console_record_reset_enable()); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); ut_assert_nextline("MBR: write success!"); @@ -326,7 +324,7 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| 000001c0 05 01 0e 25 24 01 00 40 00 00 00 08 00 00 00 25 |...%$..@.......%| @@ -353,7 +351,6 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(console_record_reset_enable()); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); ut_assert_nextline("MBR: write success!"); @@ -362,7 +359,7 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| 000001c0 05 01 0e 25 24 01 00 40 00 00 00 08 00 00 00 25 |...%$..@.......%| @@ -389,7 +386,6 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(console_record_reset_enable()); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertok(run_commandf("mbr write mmc 6")); ut_assert_nextline("MBR: write success!"); @@ -398,7 +394,7 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| 000001c0 05 01 0e 25 24 01 00 40 00 00 00 08 00 00 00 25 |...%$..@.......%| @@ -425,13 +421,12 @@ static int mbr_test_run(struct unit_test_state *uts) memset(rbuf, 0, sizeof(rbuf)); ut_assertok(run_commandf("read mmc 6:0 0x%lx 0x%lx 1", ra, ebr_blk)); ut_assertok(memcmp(ebr_wbuf, rbuf, 512)); - ut_assertok(console_record_reset_enable()); ut_assertf(0 == run_commandf(mbr_parts_buf), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assertf(0 == run_commandf("mbr write mmc 6"), "Invalid partitions string: %s\n", mbr_parts_buf); ut_assert_nextline("MBR: write success!"); ut_assertok(run_commandf("mbr verify mmc 6")); ut_assert_nextline("MBR: verify success!"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* 000001b0 00 00 00 00 00 00 00 00 78 56 34 12 00 00 80 05 |........xV4.....| 000001c0 05 01 0e 25 24 01 00 40 00 00 00 08 00 00 00 25 |...%$..@.......%| @@ -465,7 +460,7 @@ static int mbr_test_run(struct unit_test_state *uts) } /* Declare mbr test */ -UNIT_TEST(mbr_test_run, UT_TESTF_CONSOLE_REC, mbr_test); +UNIT_TEST(mbr_test_run, UTF_CONSOLE, mbr_test); int do_ut_mbr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -479,5 +474,4 @@ static int dm_test_cmd_mbr(struct unit_test_state *uts) { return mbr_test_run(uts); } - -DM_TEST(dm_test_cmd_mbr, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_cmd_mbr, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/cmd/mem_search.c b/test/cmd/mem_search.c index 55ad2fac1e3..3a031eed7ed 100644 --- a/test/cmd/mem_search.c +++ b/test/cmd/mem_search.c @@ -27,7 +27,6 @@ static int mem_test_ms_b(struct unit_test_state *uts) buf[0x31] = 0x12; buf[0xff] = 0x12; buf[0x100] = 0x12; - ut_assertok(console_record_reset_enable()); run_command("ms.b 1 ff 12", 0); ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................"); ut_assert_nextline("--"); @@ -43,7 +42,7 @@ static int mem_test_ms_b(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_b, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_b, UTF_CONSOLE); /* Test 'ms' command with 16-bit values */ static int mem_test_ms_w(struct unit_test_state *uts) @@ -54,7 +53,6 @@ static int mem_test_ms_w(struct unit_test_state *uts) memset(buf, '\0', BUF_SIZE); buf[0x34 / 2] = 0x1234; buf[BUF_SIZE / 2] = 0x1234; - ut_assertok(console_record_reset_enable()); run_command("ms.w 0 80 1234", 0); ut_assert_nextline("00000030: 0000 0000 1234 0000 0000 0000 0000 0000 ....4..........."); ut_assert_nextline("1 match"); @@ -68,7 +66,7 @@ static int mem_test_ms_w(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_w, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_w, UTF_CONSOLE); /* Test 'ms' command with 32-bit values */ static int mem_test_ms_l(struct unit_test_state *uts) @@ -79,7 +77,6 @@ static int mem_test_ms_l(struct unit_test_state *uts) memset(buf, '\0', BUF_SIZE); buf[0x38 / 4] = 0x12345678; buf[BUF_SIZE / 4] = 0x12345678; - ut_assertok(console_record_reset_enable()); run_command("ms 0 40 12345678", 0); ut_assert_nextline("00000030: 00000000 00000000 12345678 00000000 ........xV4....."); ut_assert_nextline("1 match"); @@ -89,7 +86,6 @@ static int mem_test_ms_l(struct unit_test_state *uts) ut_asserteq(0x38, env_get_hex("memaddr", 0)); ut_asserteq(0x38 / 4, env_get_hex("mempos", 0)); - ut_assertok(console_record_reset_enable()); run_command("ms 0 80 12345679", 0); ut_assert_nextline("0 matches"); ut_assert_console_end(); @@ -102,7 +98,7 @@ static int mem_test_ms_l(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_l, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_l, UTF_CONSOLE); /* Test 'ms' command with continuation */ static int mem_test_ms_cont(struct unit_test_state *uts) @@ -116,7 +112,6 @@ static int mem_test_ms_cont(struct unit_test_state *uts) memset(buf, '\0', BUF_SIZE); for (i = 5; i < 0x33; i += 3) buf[i] = 0x34; - ut_assertok(console_record_reset_enable()); run_command("ms.b 0 100 34", 0); ut_assert_nextlinen("00000000: 00 00 00 00 00 34 00 00 34 00 00 34 00 00 34 00"); ut_assert_nextline("--"); @@ -134,7 +129,6 @@ static int mem_test_ms_cont(struct unit_test_state *uts) * run_command() ignoes the repeatable flag when using hush, so call * cmd_process() directly */ - ut_assertok(console_record_reset_enable()); cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL); ut_assert_nextlinen("00000020: 34 00 00 34 00 00 34 00 00 34 00 00 34 00 00 34"); ut_assert_nextline("--"); @@ -152,7 +146,7 @@ static int mem_test_ms_cont(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_cont, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_cont, UTF_CONSOLE); /* Test that an 'ms' command with continuation stops at the end of the range */ static int mem_test_ms_cont_end(struct unit_test_state *uts) @@ -167,7 +161,6 @@ static int mem_test_ms_cont_end(struct unit_test_state *uts) buf[0x31] = 0x12; buf[0xff] = 0x12; buf[0x100] = 0x12; - ut_assertok(console_record_reset_enable()); run_command("ms.b 1 ff 12", 0); ut_assert_nextlinen("00000030"); ut_assert_nextlinen("--"); @@ -181,13 +174,11 @@ static int mem_test_ms_cont_end(struct unit_test_state *uts) * * This should produce no matches. */ - ut_assertok(console_record_reset_enable()); cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL); ut_assert_nextlinen("0 matches"); ut_assert_console_end(); /* One more time */ - ut_assertok(console_record_reset_enable()); cmd_process(CMD_FLAG_REPEAT, 4, args, &repeatable, NULL); ut_assert_nextlinen("0 matches"); ut_assert_console_end(); @@ -196,7 +187,7 @@ static int mem_test_ms_cont_end(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_cont_end, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_cont_end, UTF_CONSOLE); /* Test 'ms' command with multiple values */ static int mem_test_ms_mult(struct unit_test_state *uts) @@ -225,7 +216,7 @@ static int mem_test_ms_mult(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_mult, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_mult, UTF_CONSOLE); /* Test 'ms' command with string */ static int mem_test_ms_s(struct unit_test_state *uts) @@ -239,7 +230,6 @@ static int mem_test_ms_s(struct unit_test_state *uts) strcpy(buf + 0x1e, str); strcpy(buf + 0x63, str); strcpy(buf + 0xa1, str2); - ut_assertok(console_record_reset_enable()); run_command("ms.s 0 100 hello", 0); ut_assert_nextline("00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 65 ..............he"); ut_assert_nextline("00000020: 6c 6c 6f 00 00 00 00 00 00 00 00 00 00 00 00 00 llo............."); @@ -254,7 +244,6 @@ static int mem_test_ms_s(struct unit_test_state *uts) ut_asserteq(0xa1, env_get_hex("memaddr", 0)); ut_asserteq(0xa1, env_get_hex("mempos", 0)); - ut_assertok(console_record_reset_enable()); run_command("ms.s 0 100 hello there", 0); ut_assert_nextline("000000a0: 00 68 65 6c 6c 6f 74 68 65 72 65 00 00 00 00 00 .hellothere....."); ut_assert_nextline("1 match"); @@ -268,7 +257,7 @@ static int mem_test_ms_s(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_s, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_s, UTF_CONSOLE); /* Test 'ms' command with limit */ static int mem_test_ms_limit(struct unit_test_state *uts) @@ -281,7 +270,6 @@ static int mem_test_ms_limit(struct unit_test_state *uts) buf[0x31] = 0x12; buf[0x62] = 0x12; buf[0x76] = 0x12; - ut_assertok(console_record_reset_enable()); run_command("ms.b -l2 1 ff 12", 0); ut_assert_nextline("00000030: 00 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................"); ut_assert_nextline("--"); @@ -297,7 +285,7 @@ static int mem_test_ms_limit(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_limit, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_limit, UTF_CONSOLE); /* Test 'ms' command in quiet mode */ static int mem_test_ms_quiet(struct unit_test_state *uts) @@ -310,7 +298,6 @@ static int mem_test_ms_quiet(struct unit_test_state *uts) buf[0x31] = 0x12; buf[0x62] = 0x12; buf[0x76] = 0x12; - ut_assertok(console_record_reset_enable()); run_command("ms.b -q -l2 1 ff 12", 0); ut_assert_console_end(); unmap_sysmem(buf); @@ -321,4 +308,4 @@ static int mem_test_ms_quiet(struct unit_test_state *uts) return 0; } -MEM_TEST(mem_test_ms_quiet, UT_TESTF_CONSOLE_REC); +MEM_TEST(mem_test_ms_quiet, UTF_CONSOLE); diff --git a/test/cmd/pci_mps.c b/test/cmd/pci_mps.c index 2a64143eecd..a265105600c 100644 --- a/test/cmd/pci_mps.c +++ b/test/cmd/pci_mps.c @@ -27,8 +27,7 @@ static int test_pci_mps_safe(struct unit_test_state *uts) return 0; } - -PCI_MPS_TEST(test_pci_mps_safe, UT_TESTF_CONSOLE_REC); +PCI_MPS_TEST(test_pci_mps_safe, UTF_CONSOLE); int do_ut_pci_mps(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) diff --git a/test/cmd/pinmux.c b/test/cmd/pinmux.c index 7ab7004b684..65974d03f88 100644 --- a/test/cmd/pinmux.c +++ b/test/cmd/pinmux.c @@ -18,17 +18,14 @@ static int dm_test_cmd_pinmux_status_pinname(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_LED, 2, &dev)); /* Test that 'pinmux status ' displays the selected pin. */ - console_record_reset(); run_command("pinmux status a5", 0); ut_assert_nextlinen("a5 : gpio output ."); ut_assert_console_end(); - console_record_reset(); run_command("pinmux status P7", 0); ut_assert_nextlinen("P7 : GPIO2 bias-pull-down input-enable."); ut_assert_console_end(); - console_record_reset(); run_command("pinmux status P9", 0); if (IS_ENABLED(CONFIG_LOGF_FUNC)) { ut_assert_nextlinen( @@ -42,5 +39,5 @@ static int dm_test_cmd_pinmux_status_pinname(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_cmd_pinmux_status_pinname, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cmd_pinmux_status_pinname, UTF_SCAN_PDATA | UTF_SCAN_FDT | + UTF_CONSOLE); diff --git a/test/cmd/pwm.c b/test/cmd/pwm.c index cf7ee0e0e65..0d47e2d8abb 100644 --- a/test/cmd/pwm.c +++ b/test/cmd/pwm.c @@ -22,8 +22,6 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_PWM, 0, &dev)); ut_assertnonnull(dev); - ut_assertok(console_record_reset_enable()); - /* pwm */ /* cros-ec-pwm doesn't support invert */ ut_asserteq(1, run_command("pwm invert 0 0 1", 0)); @@ -49,8 +47,6 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_PWM, 1, &dev)); ut_assertnonnull(dev); - ut_assertok(console_record_reset_enable()); - /* pwm */ ut_assertok(run_command("pwm invert 1 0 1", 0)); ut_assert_console_end(); @@ -71,5 +67,4 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_pwm_cmd, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_pwm_cmd, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/cmd/rw.c b/test/cmd/rw.c index edd762e4d58..0a856c44ede 100644 --- a/test/cmd/rw.c +++ b/test/cmd/rw.c @@ -87,17 +87,14 @@ static int dm_test_read_write(struct unit_test_state *uts) ut_assertok(memcmp(wbuf, rbuf, sizeof(wbuf))); /* Read/write outside partition bounds should be rejected upfront. */ - console_record_reset_enable(); ut_asserteq(1, run_commandf("read mmc 2#data 0x%lx 3 2", ra)); ut_assert_nextlinen("read out of range"); ut_assert_console_end(); - console_record_reset_enable(); ut_asserteq(1, run_commandf("write mmc 2#log 0x%lx 9 2", wa)); ut_assert_nextlinen("write out of range"); ut_assert_console_end(); return 0; } - -DM_TEST(dm_test_read_write, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_read_write, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/cmd/seama.c b/test/cmd/seama.c index b60f6550b13..28d6b9ab517 100644 --- a/test/cmd/seama.c +++ b/test/cmd/seama.c @@ -16,7 +16,6 @@ static int seama_test_noargs(struct unit_test_state *uts) { /* Test that 'seama' with no arguments fails gracefully */ - console_record_reset(); run_command("seama", 0); ut_assert_nextlinen("seama - Load the SEAMA image and sets envs"); ut_assert_skipline(); @@ -26,12 +25,11 @@ static int seama_test_noargs(struct unit_test_state *uts) ut_assert_console_end(); return 0; } -SEAMA_TEST(seama_test_noargs, UT_TESTF_CONSOLE_REC); +SEAMA_TEST(seama_test_noargs, UTF_CONSOLE); static int seama_test_addr(struct unit_test_state *uts) { /* Test that loads SEAMA image 0 to address 0x01000000 */ - console_record_reset(); run_command("seama 0x01000000", 0); ut_assert_nextlinen("Loading SEAMA image 0 from nand0"); ut_assert_nextlinen("SEMA IMAGE:"); @@ -42,12 +40,11 @@ static int seama_test_addr(struct unit_test_state *uts) ut_assert_console_end(); return 0; } -SEAMA_TEST(seama_test_addr, UT_TESTF_CONSOLE_REC); +SEAMA_TEST(seama_test_addr, UTF_CONSOLE); static int seama_test_index(struct unit_test_state *uts) { /* Test that loads SEAMA image 0 exlicitly specified */ - console_record_reset(); run_command("seama 0x01000000 0", 0); ut_assert_nextlinen("Loading SEAMA image 0 from nand0"); ut_assert_nextlinen("SEMA IMAGE:"); @@ -58,7 +55,7 @@ static int seama_test_index(struct unit_test_state *uts) ut_assert_console_end(); return 0; } -SEAMA_TEST(seama_test_index, UT_TESTF_CONSOLE_REC); +SEAMA_TEST(seama_test_index, UTF_CONSOLE); int do_ut_seama(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/cmd/setexpr.c b/test/cmd/setexpr.c index 4c6cc3cf09e..21a3268bd81 100644 --- a/test/cmd/setexpr.c +++ b/test/cmd/setexpr.c @@ -63,7 +63,7 @@ static int setexpr_test_int(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_int, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_int, UTF_CONSOLE); /* Test 'setexpr' command with + operator */ static int setexpr_test_plus(struct unit_test_state *uts) @@ -105,7 +105,7 @@ static int setexpr_test_plus(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_plus, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_plus, UTF_CONSOLE); /* Test 'setexpr' command with other operators */ static int setexpr_test_oper(struct unit_test_state *uts) @@ -148,7 +148,7 @@ static int setexpr_test_oper(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_oper, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_oper, UTF_CONSOLE); /* Test 'setexpr' command with regex */ static int setexpr_test_regex(struct unit_test_state *uts) @@ -192,7 +192,7 @@ static int setexpr_test_regex(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_regex, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_regex, UTF_CONSOLE); /* Test 'setexpr' command with regex replacement that expands the string */ static int setexpr_test_regex_inc(struct unit_test_state *uts) @@ -209,7 +209,7 @@ static int setexpr_test_regex_inc(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_regex_inc, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_regex_inc, UTF_CONSOLE); /* Test setexpr_regex_sub() directly to check buffer usage */ static int setexpr_test_sub(struct unit_test_state *uts) @@ -249,7 +249,7 @@ static int setexpr_test_sub(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_sub, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_sub, UTF_CONSOLE); /* Test setexpr_regex_sub() with back references */ static int setexpr_test_backref(struct unit_test_state *uts) @@ -292,7 +292,7 @@ static int setexpr_test_backref(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_backref, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_backref, UTF_CONSOLE); /* Test 'setexpr' command with setting strings */ static int setexpr_test_str(struct unit_test_state *uts) @@ -327,7 +327,7 @@ static int setexpr_test_str(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_str, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_str, UTF_CONSOLE); /* Test 'setexpr' command with concatenating strings */ static int setexpr_test_str_oper(struct unit_test_state *uts) @@ -340,7 +340,6 @@ static int setexpr_test_str_oper(struct unit_test_state *uts) strcpy(buf, "hello"); strcpy(buf + 0x10, " there"); - ut_assertok(console_record_reset_enable()); start_mem = ut_check_free(); ut_asserteq(1, run_command("setexpr.s fred *0 * *10", 0)); ut_assertok(ut_check_delta(start_mem)); @@ -376,7 +375,7 @@ static int setexpr_test_str_oper(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_str_oper, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_str_oper, UTF_CONSOLE); /* Test 'setexpr' command with a string that is too long */ static int setexpr_test_str_long(struct unit_test_state *uts) @@ -396,7 +395,7 @@ static int setexpr_test_str_long(struct unit_test_state *uts) return 0; } -SETEXPR_TEST(setexpr_test_str_long, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_str_long, UTF_CONSOLE); #ifdef CONFIG_CMD_SETEXPR_FMT /* Test 'setexpr' command with simply setting integers */ @@ -478,8 +477,7 @@ static int setexpr_test_fmt(struct unit_test_state *uts) return 0; } - -SETEXPR_TEST(setexpr_test_fmt, UT_TESTF_CONSOLE_REC); +SETEXPR_TEST(setexpr_test_fmt, UTF_CONSOLE); #endif int do_ut_setexpr(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) diff --git a/test/cmd/temperature.c b/test/cmd/temperature.c index 364972626b1..309693aa1e8 100644 --- a/test/cmd/temperature.c +++ b/test/cmd/temperature.c @@ -18,8 +18,6 @@ static int dm_test_cmd_temperature(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_THERMAL, 0, &dev)); ut_assertnonnull(dev); - ut_assertok(console_record_reset_enable()); - /* Test that "temperature list" shows the sandbox device */ ut_assertok(run_command("temperature list", 0)); ut_assert_nextline("| Device | Driver | Parent"); @@ -34,5 +32,4 @@ static int dm_test_cmd_temperature(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_cmd_temperature, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_cmd_temperature, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/cmd/test_echo.c b/test/cmd/test_echo.c index cde74ebeb61..8b306cc907f 100644 --- a/test/cmd/test_echo.c +++ b/test/cmd/test_echo.c @@ -45,16 +45,12 @@ static int lib_test_hush_echo(struct unit_test_state *uts) int i; for (i = 0; i < ARRAY_SIZE(echo_data); ++i) { - ut_silence_console(uts); - console_record_reset_enable(); ut_assertok(run_command(echo_data[i].cmd, 0)); - ut_unsilence_console(uts); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str(echo_data[i].expected, uts->actual_str); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); } return 0; } - -LIB_TEST(lib_test_hush_echo, 0); +LIB_TEST(lib_test_hush_echo, UTF_CONSOLE); diff --git a/test/cmd/test_pause.c b/test/cmd/test_pause.c index 3703290350b..174c31a3852 100644 --- a/test/cmd/test_pause.c +++ b/test/cmd/test_pause.c @@ -14,25 +14,22 @@ DECLARE_GLOBAL_DATA_PTR; static int lib_test_hush_pause(struct unit_test_state *uts) { /* Test default message */ - console_record_reset_enable(); /* Cook a newline when the command is expected to pause */ console_in_puts("\n"); ut_assertok(run_command("pause", 0)); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str("Press any key to continue...", uts->actual_str); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test provided message */ - console_record_reset_enable(); /* Cook a newline when the command is expected to pause */ console_in_puts("\n"); ut_assertok(run_command("pause 'Prompt for pause...'", 0)); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str("Prompt for pause...", uts->actual_str); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Test providing more than one params */ - console_record_reset_enable(); /* No newline cooked here since the command is expected to fail */ ut_asserteq(1, run_command("pause a b", 0)); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); @@ -41,4 +38,4 @@ static int lib_test_hush_pause(struct unit_test_state *uts) return 0; } -LIB_TEST(lib_test_hush_pause, 0); +LIB_TEST(lib_test_hush_pause, UTF_CONSOLE); diff --git a/test/cmd/wget.c b/test/cmd/wget.c index b0feb21dc41..fe26fee54c9 100644 --- a/test/cmd/wget.c +++ b/test/cmd/wget.c @@ -213,15 +213,16 @@ static int net_test_wget(struct unit_test_state *uts) env_set("ethrotate", "no"); env_set("loadaddr", "0x20000"); ut_assertok(run_command("wget ${loadaddr} 1.1.2.2:/index.html", 0)); + ut_assert_nextline("HTTP/1.1 200 OK"); + ut_assert_nextline("Packets received 5, Transfer Successful"); + ut_assert_nextline("Bytes transferred = 32 (20 hex)"); sandbox_eth_set_tx_handler(0, NULL); - ut_assertok(console_record_reset_enable()); run_command("md5sum ${loadaddr} ${filesize}", 0); ut_assert_nextline("md5 for 00020000 ... 0002001f ==> 234af48e94b0085060249ecb5942ab57"); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } - -LIB_TEST(net_test_wget, 0); +LIB_TEST(net_test_wget, UTF_CONSOLE); diff --git a/test/common/cread.c b/test/common/cread.c index e159caed041..4926c216803 100644 --- a/test/common/cread.c +++ b/test/common/cread.c @@ -66,8 +66,6 @@ static int cread_test(struct unit_test_state *uts) * print_buffer(0, buf, 1, 7, 0); */ - console_record_reset_enable(); - /* simple input */ *buf = '\0'; ut_asserteq(4, console_in_puts("abc\n")); @@ -102,4 +100,4 @@ static int cread_test(struct unit_test_state *uts) return 0; } -COMMON_TEST(cread_test, 0); +COMMON_TEST(cread_test, UTF_CONSOLE); diff --git a/test/common/event.c b/test/common/event.c index de433d34f22..bfbbf019768 100644 --- a/test/common/event.c +++ b/test/common/event.c @@ -106,4 +106,4 @@ static int test_event_probe(struct unit_test_state *uts) return 0; } -COMMON_TEST(test_event_probe, UT_TESTF_DM | UT_TESTF_SCAN_FDT); +COMMON_TEST(test_event_probe, UTF_DM | UTF_SCAN_FDT); diff --git a/test/common/test_autoboot.c b/test/common/test_autoboot.c index 4ba1dcc8091..e3050d02c60 100644 --- a/test/common/test_autoboot.c +++ b/test/common/test_autoboot.c @@ -20,7 +20,6 @@ static int check_for_input(struct unit_test_state *uts, const char *in, const char *autoboot_prompt = "Enter password \"a\" in 1 seconds to stop autoboot"; - console_record_reset_enable(); console_in_puts(in); /* turn on keyed autoboot for the test, if possible */ @@ -91,5 +90,4 @@ static int test_autoboot(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - -COMMON_TEST(test_autoboot, 0); +COMMON_TEST(test_autoboot, UTF_CONSOLE); diff --git a/test/dm/acpi.c b/test/dm/acpi.c index 7da381f1a54..7ccd7f8d20a 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -195,7 +195,7 @@ static int dm_test_acpi_get_name(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_get_name, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_get_name, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test acpi_get_table_revision() */ static int dm_test_acpi_get_table_revision(struct unit_test_state *uts) @@ -207,8 +207,7 @@ static int dm_test_acpi_get_table_revision(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_get_table_revision, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_get_table_revision, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test acpi_create_dmar() */ static int dm_test_acpi_create_dmar(struct unit_test_state *uts) @@ -225,7 +224,7 @@ static int dm_test_acpi_create_dmar(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_create_dmar, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_create_dmar, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test acpi_fill_header() */ static int dm_test_acpi_fill_header(struct unit_test_state *uts) @@ -251,7 +250,7 @@ static int dm_test_acpi_fill_header(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_fill_header, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_fill_header, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test ACPI write_tables() */ static int dm_test_acpi_write_tables(struct unit_test_state *uts) @@ -297,7 +296,7 @@ static int dm_test_acpi_write_tables(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_write_tables, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_write_tables, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test basic ACPI functions */ static int dm_test_acpi_basic(struct unit_test_state *uts) @@ -325,7 +324,7 @@ static int dm_test_acpi_basic(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_basic, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_basic, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test setup_ctx_and_base_tables */ static int dm_test_acpi_ctx_and_base_tables(struct unit_test_state *uts) @@ -374,8 +373,7 @@ static int dm_test_acpi_ctx_and_base_tables(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_ctx_and_base_tables, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_ctx_and_base_tables, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test 'acpi list' command */ static int dm_test_acpi_cmd_list(struct unit_test_state *uts) @@ -391,7 +389,6 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts) ut_assertok(acpi_write_dev_tables(&ctx)); - console_record_reset(); run_command("acpi list", 0); ut_assert_nextline("Name Base Size Detail"); ut_assert_nextline("---- ---------------- ----- ----------------------------"); @@ -418,7 +415,7 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_cmd_list, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_cmd_list, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); /* Test 'acpi dump' command */ static int dm_test_acpi_cmd_dump(struct unit_test_state *uts) @@ -435,13 +432,11 @@ static int dm_test_acpi_cmd_dump(struct unit_test_state *uts) ut_assertok(acpi_write_dev_tables(&ctx)); /* First search for a non-existent table */ - console_record_reset(); run_command("acpi dump rdst", 0); ut_assert_nextline("Table 'RDST' not found"); ut_assert_console_end(); /* Now a real table */ - console_record_reset(); run_command("acpi dump dmar", 0); addr = ALIGN(nomap_to_sysmem(ctx.xsdt) + sizeof(struct acpi_xsdt), 64); ut_assert_nextline("DMAR @ %16lx", addr); @@ -450,7 +445,7 @@ static int dm_test_acpi_cmd_dump(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_cmd_dump, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_cmd_dump, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); /* Test acpi_device_path() */ static int dm_test_acpi_device_path(struct unit_test_state *uts) @@ -487,7 +482,7 @@ static int dm_test_acpi_device_path(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_device_path, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_device_path, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test acpi_device_status() */ static int dm_test_acpi_device_status(struct unit_test_state *uts) @@ -499,7 +494,7 @@ static int dm_test_acpi_device_status(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_device_status, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_device_status, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test acpi_fill_ssdt() */ static int dm_test_acpi_fill_ssdt(struct unit_test_state *uts) @@ -530,7 +525,7 @@ static int dm_test_acpi_fill_ssdt(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_fill_ssdt, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_fill_ssdt, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test acpi_inject_dsdt() */ static int dm_test_acpi_inject_dsdt(struct unit_test_state *uts) @@ -561,7 +556,7 @@ static int dm_test_acpi_inject_dsdt(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_inject_dsdt, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_inject_dsdt, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test 'acpi items' command */ static int dm_test_acpi_cmd_items(struct unit_test_state *uts) @@ -577,7 +572,6 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts) acpi_reset_items(); ctx.current = buf; ut_assertok(acpi_fill_ssdt(&ctx)); - console_record_reset(); run_command("acpi items", 0); ut_assert_nextline("Seq Type Base Size Device/Writer"); ut_assert_nextline("--- ----- -------- ---- -------------"); @@ -588,7 +582,6 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts) acpi_reset_items(); ctx.current = buf; ut_assertok(acpi_inject_dsdt(&ctx)); - console_record_reset(); run_command("acpi items", 0); ut_assert_nextlinen("Seq"); ut_assert_nextlinen("---"); @@ -596,7 +589,6 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts) ut_assert_nextline(" 1 dsdt %8lx 2 acpi-test2", addr + 2); ut_assert_console_end(); - console_record_reset(); run_command("acpi items -d", 0); ut_assert_nextlinen("Seq"); ut_assert_nextlinen("---"); @@ -610,7 +602,7 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_cmd_items, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_cmd_items, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); /* Test 'acpi set' command */ static int dm_test_acpi_cmd_set(struct unit_test_state *uts) @@ -621,7 +613,6 @@ static int dm_test_acpi_cmd_set(struct unit_test_state *uts) gd_set_acpi_start(0); - console_record_reset(); ut_asserteq(0, gd_acpi_start()); ut_assertok(run_command("acpi set", 0)); ut_assert_nextline("ACPI pointer: 0"); @@ -648,7 +639,7 @@ static int dm_test_acpi_cmd_set(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_cmd_set, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_cmd_set, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); /** * dm_test_write_test_table() - create test ACPI table diff --git a/test/dm/acpi_dp.c b/test/dm/acpi_dp.c index 87bd8ae6749..eaeda2b8a7a 100644 --- a/test/dm/acpi_dp.c +++ b/test/dm/acpi_dp.c @@ -488,4 +488,4 @@ static int dm_test_acpi_dp_copy(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_dp_copy, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_dp_copy, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/acpigen.c b/test/dm/acpigen.c index 7113219792e..3e912fadaef 100644 --- a/test/dm/acpigen.c +++ b/test/dm/acpigen.c @@ -167,7 +167,7 @@ static int dm_test_acpi_interrupt(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_interrupt, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_interrupt, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test emitting a GPIO descriptor */ static int dm_test_acpi_gpio(struct unit_test_state *uts) @@ -212,7 +212,7 @@ static int dm_test_acpi_gpio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_gpio, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test emitting a GPIO descriptor with an interrupt */ static int dm_test_acpi_gpio_irq(struct unit_test_state *uts) @@ -257,7 +257,7 @@ static int dm_test_acpi_gpio_irq(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_gpio_irq, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_gpio_irq, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test emitting either a GPIO or interrupt descriptor */ static int dm_test_acpi_interrupt_or_gpio(struct unit_test_state *uts) @@ -296,8 +296,7 @@ static int dm_test_acpi_interrupt_or_gpio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_interrupt_or_gpio, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_interrupt_or_gpio, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test emitting an I2C descriptor */ static int dm_test_acpi_i2c(struct unit_test_state *uts) @@ -329,7 +328,7 @@ static int dm_test_acpi_i2c(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_i2c, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_i2c, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test emitting a SPI descriptor */ static int dm_test_acpi_spi(struct unit_test_state *uts) @@ -365,7 +364,7 @@ static int dm_test_acpi_spi(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_spi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_spi, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test emitting a length */ static int dm_test_acpi_len(struct unit_test_state *uts) @@ -806,7 +805,7 @@ static int dm_test_acpi_gpio_toggle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_gpio_toggle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_gpio_toggle, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test writing ACPI code to output power-sequence info */ static int dm_test_acpi_power_seq(struct unit_test_state *uts) @@ -873,7 +872,7 @@ static int dm_test_acpi_power_seq(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_power_seq, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_power_seq, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test writing values */ static int dm_test_acpi_write_values(struct unit_test_state *uts) @@ -947,7 +946,7 @@ static int dm_test_acpi_scope(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_acpi_scope, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_acpi_scope, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test writing a resource template */ static int dm_test_acpi_resource_template(struct unit_test_state *uts) diff --git a/test/dm/adc.c b/test/dm/adc.c index a26a677074a..e27302b449e 100644 --- a/test/dm/adc.c +++ b/test/dm/adc.c @@ -32,7 +32,7 @@ static int dm_test_adc_bind(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_bind, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_bind, UTF_SCAN_FDT); static int dm_test_adc_wrong_channel_selection(struct unit_test_state *uts) { @@ -43,7 +43,7 @@ static int dm_test_adc_wrong_channel_selection(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_wrong_channel_selection, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_wrong_channel_selection, UTF_SCAN_FDT); static int dm_test_adc_supply(struct unit_test_state *uts) { @@ -79,7 +79,7 @@ static int dm_test_adc_supply(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_supply, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_supply, UTF_SCAN_FDT); struct adc_channel adc_channel_test_data[] = { { 0, SANDBOX_ADC_CHANNEL0_DATA }, @@ -104,7 +104,7 @@ static int dm_test_adc_single_channel_conversion(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_single_channel_conversion, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_single_channel_conversion, UTF_SCAN_FDT); static int dm_test_adc_multi_channel_conversion(struct unit_test_state *uts) { @@ -127,7 +127,7 @@ static int dm_test_adc_multi_channel_conversion(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_multi_channel_conversion, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_multi_channel_conversion, UTF_SCAN_FDT); static int dm_test_adc_single_channel_shot(struct unit_test_state *uts) { @@ -143,7 +143,7 @@ static int dm_test_adc_single_channel_shot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_single_channel_shot, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_single_channel_shot, UTF_SCAN_FDT); static int dm_test_adc_multi_channel_shot(struct unit_test_state *uts) { @@ -163,7 +163,7 @@ static int dm_test_adc_multi_channel_shot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_multi_channel_shot, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_multi_channel_shot, UTF_SCAN_FDT); static const int dm_test_adc_uV_data[SANDBOX_ADC_CHANNELS] = { ((u64)SANDBOX_ADC_CHANNEL0_DATA * SANDBOX_BUCK2_INITIAL_EXPECTED_UV) / @@ -194,4 +194,4 @@ static int dm_test_adc_raw_to_uV(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_adc_raw_to_uV, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_adc_raw_to_uV, UTF_SCAN_FDT); diff --git a/test/dm/audio.c b/test/dm/audio.c index 3d1d821f323..f4d3346c90a 100644 --- a/test/dm/audio.c +++ b/test/dm/audio.c @@ -31,4 +31,4 @@ static int dm_test_audio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_audio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_audio, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/axi.c b/test/dm/axi.c index 0900a9b5485..45c46a19739 100644 --- a/test/dm/axi.c +++ b/test/dm/axi.c @@ -21,8 +21,7 @@ static int dm_test_axi_base(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_axi_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_axi_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that sandbox PCI bus numbering works correctly */ static int dm_test_axi_busnum(struct unit_test_state *uts) @@ -33,8 +32,7 @@ static int dm_test_axi_busnum(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_axi_busnum, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_axi_busnum, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can use the store device correctly */ static int dm_test_axi_store(struct unit_test_state *uts) @@ -74,5 +72,4 @@ static int dm_test_axi_store(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_axi_store, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_axi_store, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/blk.c b/test/dm/blk.c index d03aec32f6c..aa5cbc63777 100644 --- a/test/dm/blk.c +++ b/test/dm/blk.c @@ -43,7 +43,7 @@ static int dm_test_blk_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int count_blk_devices(void) { @@ -92,7 +92,7 @@ static int dm_test_blk_usb(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_usb, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_usb, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can find block devices without probing them */ static int dm_test_blk_find(struct unit_test_state *uts) @@ -114,7 +114,7 @@ static int dm_test_blk_find(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_find, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_find, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that block device numbering works as expected */ static int dm_test_blk_devnum(struct unit_test_state *uts) @@ -149,7 +149,7 @@ static int dm_test_blk_devnum(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_devnum, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_devnum, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can get a block from its parent */ static int dm_test_blk_get_from_parent(struct unit_test_state *uts) @@ -167,7 +167,7 @@ static int dm_test_blk_get_from_parent(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_get_from_parent, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_get_from_parent, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test iteration through block devices */ static int dm_test_blk_iter(struct unit_test_state *uts) @@ -222,7 +222,7 @@ static int dm_test_blk_iter(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_iter, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_iter, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test finding fixed/removable block devices */ static int dm_test_blk_flags(struct unit_test_state *uts) @@ -287,7 +287,7 @@ static int dm_test_blk_flags(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_flags, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_flags, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test blk_foreach() and friend */ static int dm_test_blk_foreach(struct unit_test_state *uts) @@ -333,4 +333,4 @@ static int dm_test_blk_foreach(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_blk_foreach, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_blk_foreach, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/blkmap.c b/test/dm/blkmap.c index 7581e62df3b..a6a0b4d4e20 100644 --- a/test/dm/blkmap.c +++ b/test/dm/blkmap.c @@ -165,8 +165,6 @@ static int dm_test_cmd_blkmap(struct unit_test_state *uts) ulong loadaddr = env_get_hex("loadaddr", 0); struct udevice *dev; - console_record_reset(); - ut_assertok(run_command("blkmap info", 0)); ut_assert_console_end(); @@ -197,4 +195,4 @@ static int dm_test_cmd_blkmap(struct unit_test_state *uts) ut_assert_console_end(); return 0; } -DM_TEST(dm_test_cmd_blkmap, 0); +DM_TEST(dm_test_cmd_blkmap, UTF_CONSOLE); diff --git a/test/dm/bootcount.c b/test/dm/bootcount.c index 9cfc7d48aac..f66927a5d37 100644 --- a/test/dm/bootcount.c +++ b/test/dm/bootcount.c @@ -35,8 +35,7 @@ static int dm_test_bootcount_rtc(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_bootcount_rtc, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bootcount_rtc, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_bootcount_syscon_four_bytes(struct unit_test_state *uts) { @@ -55,9 +54,8 @@ static int dm_test_bootcount_syscon_four_bytes(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_bootcount_syscon_four_bytes, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_bootcount_syscon_two_bytes(struct unit_test_state *uts) { @@ -76,6 +74,4 @@ static int dm_test_bootcount_syscon_two_bytes(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_bootcount_syscon_two_bytes, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bootcount_syscon_two_bytes, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/bus.c b/test/dm/bus.c index 95326f23dad..166a8427406 100644 --- a/test/dm/bus.c +++ b/test/dm/bus.c @@ -41,7 +41,7 @@ static int dm_test_bus_children(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_bus_children, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bus_children, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test our functions for accessing children */ static int dm_test_bus_children_funcs(struct unit_test_state *uts) @@ -81,7 +81,7 @@ static int dm_test_bus_children_funcs(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_bus_children_funcs, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bus_children_funcs, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_bus_children_of_offset(struct unit_test_state *uts) { @@ -105,7 +105,7 @@ static int dm_test_bus_children_of_offset(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_bus_children_of_offset, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); /* Test that we can iterate through children */ static int dm_test_bus_children_iterators(struct unit_test_state *uts) @@ -136,7 +136,7 @@ static int dm_test_bus_children_iterators(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_bus_children_iterators, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that the bus can store data about each child */ static int test_bus_parent_data(struct unit_test_state *uts) @@ -203,7 +203,7 @@ static int dm_test_bus_parent_data(struct unit_test_state *uts) { return test_bus_parent_data(uts); } -DM_TEST(dm_test_bus_parent_data, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bus_parent_data, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* As above but the size is controlled by the uclass */ static int dm_test_bus_parent_data_uclass(struct unit_test_state *uts) @@ -233,7 +233,7 @@ static int dm_test_bus_parent_data_uclass(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_bus_parent_data_uclass, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that the bus ops are called when a child is probed/removed */ static int dm_test_bus_parent_ops(struct unit_test_state *uts) @@ -270,7 +270,7 @@ static int dm_test_bus_parent_ops(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_bus_parent_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bus_parent_ops, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int test_bus_parent_plat(struct unit_test_state *uts) { @@ -345,7 +345,7 @@ static int dm_test_bus_parent_plat(struct unit_test_state *uts) { return test_bus_parent_plat(uts); } -DM_TEST(dm_test_bus_parent_plat, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bus_parent_plat, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* As above but the size is controlled by the uclass */ static int dm_test_bus_parent_plat_uclass(struct unit_test_state *uts) @@ -374,7 +374,7 @@ static int dm_test_bus_parent_plat_uclass(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_bus_parent_plat_uclass, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that the child post_bind method is called */ static int dm_test_bus_child_post_bind(struct unit_test_state *uts) @@ -395,7 +395,7 @@ static int dm_test_bus_child_post_bind(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_bus_child_post_bind, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bus_child_post_bind, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that the child post_bind method is called */ static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts) @@ -417,7 +417,7 @@ static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_bus_child_post_bind_uclass, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* * Test that the bus' uclass' child_pre_probe() is called before the @@ -451,7 +451,7 @@ static int dm_test_bus_child_pre_probe_uclass(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_bus_child_pre_probe_uclass, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* * Test that the bus' uclass' child_post_probe() is called after the @@ -484,4 +484,4 @@ static int dm_test_bus_child_post_probe_uclass(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_bus_child_post_probe_uclass, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/button.c b/test/dm/button.c index 9157ec92878..3612f308f02 100644 --- a/test/dm/button.c +++ b/test/dm/button.c @@ -37,7 +37,7 @@ static int dm_test_button_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_button_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_button_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of the button uclass using the button_gpio driver */ static int dm_test_button_gpio(struct unit_test_state *uts) @@ -62,7 +62,7 @@ static int dm_test_button_gpio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_button_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_button_gpio, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test obtaining a BUTTON by label */ static int dm_test_button_label(struct unit_test_state *uts) @@ -83,7 +83,7 @@ static int dm_test_button_label(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_button_label, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_button_label, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test button has linux,code */ static int dm_test_button_linux_code(struct unit_test_state *uts) @@ -95,7 +95,7 @@ static int dm_test_button_linux_code(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_button_linux_code, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_button_linux_code, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test adc-keys driver */ static int dm_test_button_keys_adc(struct unit_test_state *uts) @@ -129,7 +129,7 @@ static int dm_test_button_keys_adc(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_button_keys_adc, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_button_keys_adc, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of the button uclass using the button_gpio driver */ static int dm_test_button_cmd(struct unit_test_state *uts) @@ -225,4 +225,4 @@ static int dm_test_button_cmd(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_button_cmd, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_button_cmd, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/cache.c b/test/dm/cache.c index d2f3bfe2caf..e03e029f1dd 100644 --- a/test/dm/cache.c +++ b/test/dm/cache.c @@ -18,4 +18,4 @@ static int dm_test_reset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_reset, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_reset, UTF_SCAN_FDT); diff --git a/test/dm/clk.c b/test/dm/clk.c index a966471dbd9..790968e6477 100644 --- a/test/dm/clk.c +++ b/test/dm/clk.c @@ -46,8 +46,7 @@ static int dm_test_clk_base(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_clk_base, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_clk_base, UTF_SCAN_FDT); static int dm_test_clk(struct unit_test_state *uts) { @@ -187,7 +186,7 @@ static int dm_test_clk(struct unit_test_state *uts) ut_assertok(device_remove(dev_test, DM_REMOVE_NORMAL)); return 0; } -DM_TEST(dm_test_clk, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_clk, UTF_SCAN_FDT); static int dm_test_clk_bulk(struct unit_test_state *uts) { @@ -225,4 +224,4 @@ static int dm_test_clk_bulk(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_clk_bulk, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_clk_bulk, UTF_SCAN_FDT); diff --git a/test/dm/clk_ccf.c b/test/dm/clk_ccf.c index 15fba31b962..ac56f17b775 100644 --- a/test/dm/clk_ccf.c +++ b/test/dm/clk_ccf.c @@ -208,5 +208,4 @@ static int dm_test_clk_ccf(struct unit_test_state *uts) return 1; } - -DM_TEST(dm_test_clk_ccf, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_clk_ccf, UTF_SCAN_FDT); diff --git a/test/dm/core.c b/test/dm/core.c index 5bc5e8e82ec..e0c5b9e0017 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -175,7 +175,7 @@ static int dm_test_autobind_uclass_pdata_alloc(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_autobind_uclass_pdata_alloc, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_autobind_uclass_pdata_alloc, UTF_SCAN_PDATA); /* compare node names ignoring the unit address */ static int dm_test_compare_node_name(struct unit_test_state *uts) @@ -188,8 +188,7 @@ static int dm_test_compare_node_name(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_compare_node_name, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_compare_node_name, UTF_SCAN_PDATA); /* Test that binding with uclass plat setting occurs correctly */ static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts) @@ -215,7 +214,7 @@ static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_autobind_uclass_pdata_valid, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_autobind_uclass_pdata_valid, UTF_SCAN_PDATA); /* Test that autoprobe finds all the expected devices */ static int dm_test_autoprobe(struct unit_test_state *uts) @@ -282,7 +281,7 @@ static int dm_test_autoprobe(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_autoprobe, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_autoprobe, UTF_SCAN_PDATA); /* Check that we see the correct plat in each device */ static int dm_test_plat(struct unit_test_state *uts) @@ -300,7 +299,7 @@ static int dm_test_plat(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_plat, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_plat, UTF_SCAN_PDATA); /* Test that we can bind, probe, remove, unbind a driver */ static int dm_test_lifecycle(struct unit_test_state *uts) @@ -369,7 +368,7 @@ static int dm_test_lifecycle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_lifecycle, UT_TESTF_SCAN_PDATA | UT_TESTF_PROBE_TEST); +DM_TEST(dm_test_lifecycle, UTF_SCAN_PDATA | UTF_PROBE_TEST); /* Test that we can bind/unbind and the lists update correctly */ static int dm_test_ordering(struct unit_test_state *uts) @@ -424,7 +423,7 @@ static int dm_test_ordering(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ordering, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_ordering, UTF_SCAN_PDATA); /* Check that we can perform operations on a device (do a ping) */ int dm_check_operations(struct unit_test_state *uts, struct udevice *dev, @@ -482,7 +481,7 @@ static int dm_test_operations(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_operations, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_operations, UTF_SCAN_PDATA); /* Remove all drivers and check that things work */ static int dm_test_remove(struct unit_test_state *uts) @@ -504,7 +503,7 @@ static int dm_test_remove(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_remove, UT_TESTF_SCAN_PDATA | UT_TESTF_PROBE_TEST); +DM_TEST(dm_test_remove, UTF_SCAN_PDATA | UTF_PROBE_TEST); /* Remove and recreate everything, check for memory leaks */ static int dm_test_leak(struct unit_test_state *uts) @@ -1033,7 +1032,7 @@ static int dm_test_uclass_devices_find(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_devices_find, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_uclass_devices_find, UTF_SCAN_PDATA); static int dm_test_uclass_devices_find_by_name(struct unit_test_state *uts) { @@ -1070,7 +1069,7 @@ static int dm_test_uclass_devices_find_by_name(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_devices_find_by_name, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_uclass_devices_find_by_name, UTF_SCAN_FDT); static int dm_test_uclass_devices_get(struct unit_test_state *uts) { @@ -1086,7 +1085,7 @@ static int dm_test_uclass_devices_get(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_devices_get, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_uclass_devices_get, UTF_SCAN_PDATA); static int dm_test_uclass_devices_get_by_name(struct unit_test_state *uts) { @@ -1129,7 +1128,7 @@ static int dm_test_uclass_devices_get_by_name(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_devices_get_by_name, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_uclass_devices_get_by_name, UTF_SCAN_FDT); static int dm_test_device_get_uclass_id(struct unit_test_state *uts) { @@ -1140,7 +1139,7 @@ static int dm_test_device_get_uclass_id(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_device_get_uclass_id, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_device_get_uclass_id, UTF_SCAN_PDATA); static int dm_test_uclass_names(struct unit_test_state *uts) { @@ -1151,7 +1150,7 @@ static int dm_test_uclass_names(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_names, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_uclass_names, UTF_SCAN_PDATA); static int dm_test_inactive_child(struct unit_test_state *uts) { @@ -1181,7 +1180,7 @@ static int dm_test_inactive_child(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_inactive_child, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_inactive_child, UTF_SCAN_PDATA); /* Make sure all bound devices have a sequence number */ static int dm_test_all_have_seq(struct unit_test_state *uts) @@ -1200,7 +1199,7 @@ static int dm_test_all_have_seq(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_all_have_seq, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_all_have_seq, UTF_SCAN_PDATA); #if CONFIG_IS_ENABLED(DM_DMA) static int dm_test_dma_offset(struct unit_test_state *uts) @@ -1231,7 +1230,7 @@ static int dm_test_dma_offset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dma_offset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dma_offset, UTF_SCAN_PDATA | UTF_SCAN_FDT); #endif /* Test dm_get_stats() */ @@ -1245,7 +1244,7 @@ static int dm_test_get_stats(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_get_stats, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_get_stats, UTF_SCAN_FDT); /* Test uclass_find_device_by_name() */ static int dm_test_uclass_find_device(struct unit_test_state *uts) @@ -1260,7 +1259,7 @@ static int dm_test_uclass_find_device(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_find_device, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_uclass_find_device, UTF_SCAN_FDT); /* Test getting information about tags attached to devices */ static int dm_test_dev_get_attach(struct unit_test_state *uts) @@ -1288,7 +1287,7 @@ static int dm_test_dev_get_attach(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dev_get_attach, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dev_get_attach, UTF_SCAN_FDT); /* Test getting information about tags attached to bus devices */ static int dm_test_dev_get_attach_bus(struct unit_test_state *uts) @@ -1340,7 +1339,7 @@ static int dm_test_dev_get_attach_bus(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dev_get_attach_bus, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dev_get_attach_bus, UTF_SCAN_FDT); /* Test getting information about tags attached to bus devices */ static int dm_test_dev_get_mem(struct unit_test_state *uts) @@ -1351,4 +1350,4 @@ static int dm_test_dev_get_mem(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dev_get_mem, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dev_get_mem, UTF_SCAN_FDT); diff --git a/test/dm/cpu.c b/test/dm/cpu.c index 8af25316cea..9b2f90ee1e5 100644 --- a/test/dm/cpu.c +++ b/test/dm/cpu.c @@ -47,5 +47,4 @@ static int dm_test_cpu(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_cpu, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cpu, UTF_SCAN_FDT); diff --git a/test/dm/cros_ec.c b/test/dm/cros_ec.c index ac0055f0acd..089f6670a3f 100644 --- a/test/dm/cros_ec.c +++ b/test/dm/cros_ec.c @@ -28,7 +28,7 @@ static int dm_test_cros_ec_hello(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cros_ec_hello, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cros_ec_hello, UTF_SCAN_FDT); static int dm_test_cros_ec_sku_id(struct unit_test_state *uts) { @@ -38,14 +38,13 @@ static int dm_test_cros_ec_sku_id(struct unit_test_state *uts) ut_asserteq(1234, cros_ec_get_sku_id(dev)); /* try the command */ - console_record_reset(); ut_assertok(run_command("crosec sku", 0)); ut_assert_nextline("1234"); ut_assert_console_end(); return 0; } -DM_TEST(dm_test_cros_ec_sku_id, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cros_ec_sku_id, UTF_SCAN_FDT | UTF_CONSOLE); static int dm_test_cros_ec_features(struct unit_test_state *uts) { @@ -64,7 +63,6 @@ static int dm_test_cros_ec_features(struct unit_test_state *uts) ut_asserteq(true, cros_ec_check_feature(dev, EC_FEATURE_ISH)); /* try the command */ - console_record_reset(); ut_assertok(run_command("crosec features", 0)); ut_assert_nextline("flash"); ut_assert_nextline("i2c"); @@ -75,7 +73,7 @@ static int dm_test_cros_ec_features(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cros_ec_features, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cros_ec_features, UTF_SCAN_FDT | UTF_CONSOLE); static int dm_test_cros_ec_switches(struct unit_test_state *uts) { @@ -85,7 +83,6 @@ static int dm_test_cros_ec_switches(struct unit_test_state *uts) ut_asserteq(0, cros_ec_get_switches(dev)); /* try the command */ - console_record_reset(); ut_assertok(run_command("crosec switches", 0)); ut_assert_console_end(); @@ -94,14 +91,13 @@ static int dm_test_cros_ec_switches(struct unit_test_state *uts) ut_asserteq(EC_SWITCH_LID_OPEN, cros_ec_get_switches(dev)); /* try the command */ - console_record_reset(); ut_assertok(run_command("crosec switches", 0)); ut_assert_nextline("lid open"); ut_assert_console_end(); return 0; } -DM_TEST(dm_test_cros_ec_switches, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cros_ec_switches, UTF_SCAN_FDT | UTF_CONSOLE); static int dm_test_cros_ec_events(struct unit_test_state *uts) { @@ -113,7 +109,6 @@ static int dm_test_cros_ec_events(struct unit_test_state *uts) ut_asserteq(0, events); /* try the command */ - console_record_reset(); ut_assertok(run_command("crosec events", 0)); ut_assert_nextline("00000000"); ut_assert_console_end(); @@ -124,7 +119,6 @@ static int dm_test_cros_ec_events(struct unit_test_state *uts) ut_asserteq(EC_HOST_EVENT_MASK(EC_HOST_EVENT_LID_OPEN), events); /* try the command */ - console_record_reset(); ut_assertok(run_command("crosec events", 0)); ut_assert_nextline("00000002"); ut_assert_nextline("lid_open"); @@ -138,7 +132,7 @@ static int dm_test_cros_ec_events(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cros_ec_events, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cros_ec_events, UTF_SCAN_FDT | UTF_CONSOLE); static int dm_test_cros_ec_vstore(struct unit_test_state *uts) { @@ -174,4 +168,4 @@ static int dm_test_cros_ec_vstore(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cros_ec_vstore, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cros_ec_vstore, UTF_SCAN_FDT); diff --git a/test/dm/cros_ec_pwm.c b/test/dm/cros_ec_pwm.c index f68ee6f33b8..0b6ca8b8861 100644 --- a/test/dm/cros_ec_pwm.c +++ b/test/dm/cros_ec_pwm.c @@ -56,4 +56,4 @@ static int dm_test_cros_ec_pwm(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cros_ec_pwm, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cros_ec_pwm, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/devres.c b/test/dm/devres.c index 7a3a669ddd4..efc5c72ae2a 100644 --- a/test/dm/devres.c +++ b/test/dm/devres.c @@ -39,7 +39,7 @@ static int dm_test_devres_alloc(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devres_alloc, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_devres_alloc, UTF_SCAN_PDATA); /* Test devm_kfree() can be used to free memory too */ static int dm_test_devres_free(struct unit_test_state *uts) @@ -67,7 +67,7 @@ static int dm_test_devres_free(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devres_free, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_devres_free, UTF_SCAN_PDATA); /* Test that kzalloc() returns memory that is zeroed */ static int dm_test_devres_kzalloc(struct unit_test_state *uts) @@ -86,7 +86,7 @@ static int dm_test_devres_kzalloc(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devres_kzalloc, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_devres_kzalloc, UTF_SCAN_PDATA); /* Test that devm_kmalloc_array() allocates an array that can be set */ static int dm_test_devres_kmalloc_array(struct unit_test_state *uts) @@ -109,7 +109,7 @@ static int dm_test_devres_kmalloc_array(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devres_kmalloc_array, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_devres_kmalloc_array, UTF_SCAN_PDATA); /* Test that devm_kcalloc() allocates a zeroed array */ static int dm_test_devres_kcalloc(struct unit_test_state *uts) @@ -138,7 +138,7 @@ static int dm_test_devres_kcalloc(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devres_kcalloc, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_devres_kcalloc, UTF_SCAN_PDATA); /* Test devres releases resources automatically as expected */ static int dm_test_devres_phase(struct unit_test_state *uts) @@ -181,4 +181,4 @@ static int dm_test_devres_phase(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devres_phase, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_devres_phase, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/dma.c b/test/dm/dma.c index 949710fdb4e..be3862963b1 100644 --- a/test/dm/dma.c +++ b/test/dm/dma.c @@ -34,7 +34,7 @@ static int dm_test_dma_m2m(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dma_m2m, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dma_m2m, UTF_SCAN_FDT); static int dm_test_dma(struct unit_test_state *uts) { @@ -76,7 +76,7 @@ static int dm_test_dma(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dma, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dma, UTF_SCAN_FDT); static int dm_test_dma_rx(struct unit_test_state *uts) { @@ -121,4 +121,4 @@ static int dm_test_dma_rx(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dma_rx, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dma_rx, UTF_SCAN_FDT); diff --git a/test/dm/dsa.c b/test/dm/dsa.c index c857106eaf4..c6b4e12a758 100644 --- a/test/dm/dsa.c +++ b/test/dm/dsa.c @@ -56,8 +56,7 @@ static int dm_test_dsa_probe(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_dsa_probe, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dsa_probe, UTF_SCAN_FDT); /* This test sends ping requests with the local address through each DSA port * via the sandbox DSA master Eth. @@ -78,5 +77,4 @@ static int dm_test_dsa(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_dsa, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dsa, UTF_SCAN_FDT); diff --git a/test/dm/dsi_host.c b/test/dm/dsi_host.c index 68686a40d9f..b92742472d4 100644 --- a/test/dm/dsi_host.c +++ b/test/dm/dsi_host.c @@ -54,5 +54,4 @@ static int dm_test_dsi_host(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_dsi_host, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dsi_host, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/ecdsa.c b/test/dm/ecdsa.c index da535c98b59..d7eac7115f7 100644 --- a/test/dm/ecdsa.c +++ b/test/dm/ecdsa.c @@ -35,4 +35,4 @@ static int dm_test_ecdsa_verify(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ecdsa_verify, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ecdsa_verify, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/efi_media.c b/test/dm/efi_media.c index 9d0ed0f0755..0cf7e37e987 100644 --- a/test/dm/efi_media.c +++ b/test/dm/efi_media.c @@ -20,4 +20,4 @@ static int dm_test_efi_media(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_efi_media, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_efi_media, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/eth.c b/test/dm/eth.c index 820b8cbfc29..467495863e1 100644 --- a/test/dm/eth.c +++ b/test/dm/eth.c @@ -166,7 +166,7 @@ static int dm_test_ip6_make_lladdr(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ip6_make_lladdr, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ip6_make_lladdr, UTF_SCAN_FDT); #endif static int dm_test_eth(struct unit_test_state *uts) @@ -187,7 +187,7 @@ static int dm_test_eth(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_eth, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_eth, UTF_SCAN_FDT); static int dm_test_eth_alias(struct unit_test_state *uts) { @@ -211,7 +211,7 @@ static int dm_test_eth_alias(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_eth_alias, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_eth_alias, UTF_SCAN_FDT); static int dm_test_eth_prime(struct unit_test_state *uts) { @@ -231,7 +231,7 @@ static int dm_test_eth_prime(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_eth_prime, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_eth_prime, UTF_SCAN_FDT); /** * This test case is trying to test the following scenario: @@ -296,7 +296,7 @@ static int dm_test_eth_act(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_eth_act, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_eth_act, UTF_SCAN_FDT); /* Ensure that all addresses are loaded properly */ static int dm_test_ethaddr(struct unit_test_state *uts) @@ -329,7 +329,7 @@ static int dm_test_ethaddr(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ethaddr, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ethaddr, UTF_SCAN_FDT); /* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_eth_rotate1(struct unit_test_state *uts) @@ -401,7 +401,7 @@ static int dm_test_eth_rotate(struct unit_test_state *uts) return retval; } -DM_TEST(dm_test_eth_rotate, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_eth_rotate, UTF_SCAN_FDT); /* The asserts include a return on fail; cleanup in the caller */ static int _dm_test_net_retry(struct unit_test_state *uts) @@ -444,7 +444,7 @@ static int dm_test_net_retry(struct unit_test_state *uts) return retval; } -DM_TEST(dm_test_net_retry, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_net_retry, UTF_SCAN_FDT); static int sb_check_arp_reply(struct udevice *dev, void *packet, unsigned int len) @@ -528,8 +528,7 @@ static int dm_test_eth_async_arp_reply(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_eth_async_arp_reply, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_eth_async_arp_reply, UTF_SCAN_FDT); static int sb_check_ping_reply(struct udevice *dev, void *packet, unsigned int len) @@ -613,8 +612,7 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_eth_async_ping_reply, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_eth_async_ping_reply, UTF_SCAN_FDT); #if IS_ENABLED(CONFIG_IPV6_ROUTER_DISCOVERY) @@ -659,7 +657,6 @@ static int dm_test_validate_ra(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_validate_ra, 0); static int dm_test_process_ra(struct unit_test_state *uts) @@ -698,7 +695,6 @@ static int dm_test_process_ra(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_process_ra, 0); #endif diff --git a/test/dm/extcon.c b/test/dm/extcon.c index 6a4e22bfdc5..91358abb5f0 100644 --- a/test/dm/extcon.c +++ b/test/dm/extcon.c @@ -17,5 +17,4 @@ static int dm_test_extcon(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_extcon, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_extcon, UTF_SCAN_FDT); diff --git a/test/dm/fastboot.c b/test/dm/fastboot.c index 5d938eb7f12..73c43f82924 100644 --- a/test/dm/fastboot.c +++ b/test/dm/fastboot.c @@ -91,4 +91,4 @@ static int dm_test_fastboot_mmc_part(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fastboot_mmc_part, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fastboot_mmc_part, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/fdtdec.c b/test/dm/fdtdec.c index b484414f5f0..1f24f1d5dff 100644 --- a/test/dm/fdtdec.c +++ b/test/dm/fdtdec.c @@ -55,7 +55,7 @@ static int dm_test_fdtdec_set_carveout(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdtdec_set_carveout, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts) { @@ -128,4 +128,4 @@ static int dm_test_fdtdec_add_reserved_memory(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdtdec_add_reserved_memory, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); diff --git a/test/dm/ffa.c b/test/dm/ffa.c index fa6d54d00d6..593b7177fce 100644 --- a/test/dm/ffa.c +++ b/test/dm/ffa.c @@ -197,8 +197,7 @@ static int dm_test_ffa_ack(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_ffa_ack, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_ffa_ack, UTF_SCAN_FDT | UTF_CONSOLE); static int dm_test_ffa_nack(struct unit_test_state *uts) { @@ -256,5 +255,4 @@ static int dm_test_ffa_nack(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_ffa_nack, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_ffa_nack, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/dm/firmware.c b/test/dm/firmware.c index ec68e816999..795f6d5e403 100644 --- a/test/dm/firmware.c +++ b/test/dm/firmware.c @@ -19,4 +19,4 @@ static int dm_test_firmware_probe(struct unit_test_state *uts) "sandbox-firmware", &dev)); return 0; } -DM_TEST(dm_test_firmware_probe, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_firmware_probe, UTF_SCAN_FDT); diff --git a/test/dm/fpga.c b/test/dm/fpga.c index 8bb35358532..fe9f287f8c7 100644 --- a/test/dm/fpga.c +++ b/test/dm/fpga.c @@ -16,5 +16,4 @@ static int dm_test_fpga(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_fpga, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fpga, UTF_SCAN_FDT); diff --git a/test/dm/fwu_mdata.c b/test/dm/fwu_mdata.c index 6154480ba83..b7680632f95 100644 --- a/test/dm/fwu_mdata.c +++ b/test/dm/fwu_mdata.c @@ -111,7 +111,7 @@ static int dm_test_fwu_mdata_read(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fwu_mdata_read, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fwu_mdata_read, UTF_SCAN_FDT); static int dm_test_fwu_mdata_write(struct unit_test_state *uts) { @@ -142,4 +142,4 @@ static int dm_test_fwu_mdata_write(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fwu_mdata_write, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fwu_mdata_write, UTF_SCAN_FDT); diff --git a/test/dm/gpio.c b/test/dm/gpio.c index 957ab25c8d3..b45946c143c 100644 --- a/test/dm/gpio.c +++ b/test/dm/gpio.c @@ -145,7 +145,7 @@ static int dm_test_gpio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that GPIO open-drain/open-source emulation works correctly */ static int dm_test_gpio_opendrain_opensource(struct unit_test_state *uts) @@ -244,7 +244,7 @@ static int dm_test_gpio_opendrain_opensource(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_gpio_opendrain_opensource, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that sandbox anonymous GPIOs work correctly */ static int dm_test_gpio_anon(struct unit_test_state *uts) @@ -266,7 +266,7 @@ static int dm_test_gpio_anon(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_anon, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_anon, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that gpio_requestf() works as expected */ static int dm_test_gpio_requestf(struct unit_test_state *uts) @@ -284,7 +284,7 @@ static int dm_test_gpio_requestf(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_requestf, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_requestf, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that gpio_request() copies its string */ static int dm_test_gpio_copy(struct unit_test_state *uts) @@ -306,7 +306,7 @@ static int dm_test_gpio_copy(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_copy, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_copy, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we don't leak memory with GPIOs */ static int dm_test_gpio_leak(struct unit_test_state *uts) @@ -318,7 +318,7 @@ static int dm_test_gpio_leak(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_leak, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_leak, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can find GPIOs using phandles */ static int dm_test_gpio_phandles(struct unit_test_state *uts) @@ -392,7 +392,7 @@ static int dm_test_gpio_phandles(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_phandles, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_phandles, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Check the gpio pin configuration get from device tree information */ static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts) @@ -428,7 +428,7 @@ static int dm_test_gpio_get_dir_flags(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_get_dir_flags, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_get_dir_flags, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of gpio_get_acpi() */ static int dm_test_gpio_get_acpi(struct unit_test_state *uts) @@ -457,7 +457,7 @@ static int dm_test_gpio_get_acpi(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_get_acpi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_get_acpi, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of gpio_get_acpi() with an interrupt GPIO */ static int dm_test_gpio_get_acpi_irq(struct unit_test_state *uts) @@ -489,7 +489,7 @@ static int dm_test_gpio_get_acpi_irq(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_gpio_get_acpi_irq, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_get_acpi_irq, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can get/release GPIOs using managed API */ static int dm_test_gpio_devm(struct unit_test_state *uts) @@ -590,7 +590,7 @@ static int dm_test_gpio_devm(struct unit_test_state *uts) device_remove(dev2, DM_REMOVE_NORMAL); return 0; } -DM_TEST(dm_test_gpio_devm, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_gpio_devm, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_clrset_flags(struct unit_test_state *uts) { @@ -631,7 +631,7 @@ static int dm_test_clrset_flags(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_clrset_flags, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_clrset_flags, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Check that an active-low GPIO works as expected */ static int dm_test_clrset_flags_invert(struct unit_test_state *uts) @@ -678,7 +678,7 @@ static int dm_test_clrset_flags_invert(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_clrset_flags_invert, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_clrset_flags_invert, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int set_gpios(struct unit_test_state *uts, struct gpio_desc *desc, int count, uint value) @@ -719,7 +719,7 @@ static int dm_test_gpio_get_values_as_int(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_gpio_get_values_as_int, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Check that an active-low GPIO works as expected */ static int dm_test_gpio_get_values_as_int_base3(struct unit_test_state *uts) @@ -776,7 +776,7 @@ static int dm_test_gpio_get_values_as_int_base3(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_gpio_get_values_as_int_base3, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Check that gpio_get_status return the label of a GPIO configured as GPIOD_AF */ static int dm_test_gpio_function(struct unit_test_state *uts) @@ -806,4 +806,4 @@ static int dm_test_gpio_function(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_gpio_function, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/host.c b/test/dm/host.c index e514f8409cf..f577377da6a 100644 --- a/test/dm/host.c +++ b/test/dm/host.c @@ -72,7 +72,7 @@ static int dm_test_host(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_host, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_host, UTF_SCAN_FDT); /* reusing the same label should work */ static int dm_test_host_dup(struct unit_test_state *uts) @@ -106,7 +106,7 @@ static int dm_test_host_dup(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_host_dup, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_host_dup, UTF_SCAN_FDT); /* Basic test of 'host' command */ static int dm_test_cmd_host(struct unit_test_state *uts) @@ -115,8 +115,6 @@ static int dm_test_cmd_host(struct unit_test_state *uts) struct blk_desc *desc; char fname[256]; - console_record_reset(); - /* first check 'host info' with binding */ ut_assertok(run_command("host info", 0)); ut_assert_nextline("dev blocks blksz label path"); @@ -199,4 +197,4 @@ static int dm_test_cmd_host(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cmd_host, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cmd_host, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/dm/hwspinlock.c b/test/dm/hwspinlock.c index a05b183b8bc..58bba52182e 100644 --- a/test/dm/hwspinlock.c +++ b/test/dm/hwspinlock.c @@ -36,5 +36,4 @@ static int dm_test_hwspinlock_base(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_hwspinlock_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_hwspinlock_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/i2c.c b/test/dm/i2c.c index e9cf9f7819a..40f1f26b671 100644 --- a/test/dm/i2c.c +++ b/test/dm/i2c.c @@ -38,7 +38,7 @@ static int dm_test_i2c_find(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_find, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_find, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_read_write(struct unit_test_state *uts) { @@ -55,7 +55,7 @@ static int dm_test_i2c_read_write(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_read_write, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_read_write, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_speed(struct unit_test_state *uts) { @@ -77,7 +77,7 @@ static int dm_test_i2c_speed(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_speed, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_speed, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_offset_len(struct unit_test_state *uts) { @@ -94,7 +94,7 @@ static int dm_test_i2c_offset_len(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_offset_len, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_offset_len, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_probe_empty(struct unit_test_state *uts) { @@ -109,7 +109,7 @@ static int dm_test_i2c_probe_empty(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_probe_empty, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_probe_empty, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_bytewise(struct unit_test_state *uts) { @@ -164,7 +164,7 @@ static int dm_test_i2c_bytewise(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_bytewise, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_bytewise, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_offset(struct unit_test_state *uts) { @@ -237,7 +237,7 @@ static int dm_test_i2c_offset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_offset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_offset, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_addr_offset(struct unit_test_state *uts) { @@ -301,8 +301,7 @@ static int dm_test_i2c_addr_offset(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_i2c_addr_offset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_addr_offset, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_i2c_reg_clrset(struct unit_test_state *uts) { @@ -331,4 +330,4 @@ static int dm_test_i2c_reg_clrset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2c_reg_clrset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2c_reg_clrset, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/i2s.c b/test/dm/i2s.c index a3d3a31b6fb..cc336690e60 100644 --- a/test/dm/i2s.c +++ b/test/dm/i2s.c @@ -29,4 +29,4 @@ static int dm_test_i2s(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_i2s, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_i2s, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/iommu.c b/test/dm/iommu.c index acea5f28971..c5dd917f00c 100644 --- a/test/dm/iommu.c +++ b/test/dm/iommu.c @@ -38,7 +38,7 @@ static int dm_test_iommu(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_iommu, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_iommu, UTF_SCAN_FDT); static int dm_test_iommu_noiommu(struct unit_test_state *uts) { @@ -66,7 +66,7 @@ static int dm_test_iommu_noiommu(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_iommu_noiommu, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_iommu_noiommu, UTF_SCAN_FDT); static int dm_test_iommu_pci(struct unit_test_state *uts) { @@ -81,7 +81,7 @@ static int dm_test_iommu_pci(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_iommu_pci, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_iommu_pci, UTF_SCAN_FDT); static int dm_test_iommu_pci_noiommu(struct unit_test_state *uts) { @@ -96,4 +96,4 @@ static int dm_test_iommu_pci_noiommu(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_iommu_pci_noiommu, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_iommu_pci_noiommu, UTF_SCAN_FDT); diff --git a/test/dm/irq.c b/test/dm/irq.c index d22772ab769..836f2d82e71 100644 --- a/test/dm/irq.c +++ b/test/dm/irq.c @@ -30,7 +30,7 @@ static int dm_test_irq_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_irq_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_irq_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of irq_first_device_type() */ static int dm_test_irq_type(struct unit_test_state *uts) @@ -42,7 +42,7 @@ static int dm_test_irq_type(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_irq_type, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_irq_type, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of irq_read_and_clear() */ static int dm_test_read_and_clear(struct unit_test_state *uts) @@ -59,7 +59,7 @@ static int dm_test_read_and_clear(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_read_and_clear, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_read_and_clear, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of irq_request() */ static int dm_test_request(struct unit_test_state *uts) @@ -74,7 +74,7 @@ static int dm_test_request(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_request, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_request, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of irq_get_acpi() */ static int dm_test_irq_get_acpi(struct unit_test_state *uts) @@ -96,4 +96,4 @@ static int dm_test_irq_get_acpi(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_irq_get_acpi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_irq_get_acpi, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/led.c b/test/dm/led.c index c28fa044f45..e1509c397d8 100644 --- a/test/dm/led.c +++ b/test/dm/led.c @@ -24,7 +24,7 @@ static int dm_test_led_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_led_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_led_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of the LED 'default-state' device tree property */ static int dm_test_led_default_state(struct unit_test_state *uts) @@ -41,7 +41,7 @@ static int dm_test_led_default_state(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_led_default_state, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_led_default_state, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of the led uclass using the led_gpio driver */ static int dm_test_led_gpio(struct unit_test_state *uts) @@ -66,7 +66,7 @@ static int dm_test_led_gpio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_led_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_led_gpio, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can toggle LEDs */ static int dm_test_led_toggle(struct unit_test_state *uts) @@ -91,7 +91,7 @@ static int dm_test_led_toggle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_led_toggle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_led_toggle, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test obtaining an LED by label */ static int dm_test_led_label(struct unit_test_state *uts) @@ -112,7 +112,7 @@ static int dm_test_led_label(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_led_label, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_led_label, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test LED blinking */ #ifdef CONFIG_LED_BLINK @@ -135,5 +135,5 @@ static int dm_test_led_blink(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_led_blink, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_led_blink, UTF_SCAN_PDATA | UTF_SCAN_FDT); #endif diff --git a/test/dm/mailbox.c b/test/dm/mailbox.c index 14f72d58d1c..4a0648b9277 100644 --- a/test/dm/mailbox.c +++ b/test/dm/mailbox.c @@ -28,4 +28,4 @@ static int dm_test_mailbox(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_mailbox, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mailbox, UTF_SCAN_FDT); diff --git a/test/dm/mdio.c b/test/dm/mdio.c index 7ececf37ccc..6760c98898a 100644 --- a/test/dm/mdio.c +++ b/test/dm/mdio.c @@ -53,5 +53,4 @@ static int dm_test_mdio(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_mdio, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mdio, UTF_SCAN_FDT); diff --git a/test/dm/mdio_mux.c b/test/dm/mdio_mux.c index 33a7e972609..866feb26381 100644 --- a/test/dm/mdio_mux.c +++ b/test/dm/mdio_mux.c @@ -76,5 +76,4 @@ static int dm_test_mdio_mux(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_mdio_mux, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mdio_mux, UTF_SCAN_FDT); diff --git a/test/dm/memory.c b/test/dm/memory.c index 7d9500aa91d..34e64ba0187 100644 --- a/test/dm/memory.c +++ b/test/dm/memory.c @@ -17,5 +17,4 @@ static int dm_test_memory(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_memory, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_memory, UTF_SCAN_FDT); diff --git a/test/dm/misc.c b/test/dm/misc.c index ad856fd01b6..250885dcf51 100644 --- a/test/dm/misc.c +++ b/test/dm/misc.c @@ -79,5 +79,4 @@ static int dm_test_misc(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_misc, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_misc, UTF_SCAN_FDT); diff --git a/test/dm/mmc.c b/test/dm/mmc.c index c0abea797d9..cdebb955196 100644 --- a/test/dm/mmc.c +++ b/test/dm/mmc.c @@ -22,7 +22,7 @@ static int dm_test_mmc_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_mmc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mmc_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_mmc_blk(struct unit_test_state *uts) { @@ -50,4 +50,4 @@ static int dm_test_mmc_blk(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_mmc_blk, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mmc_blk, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/mux-cmd.c b/test/dm/mux-cmd.c index d4bb8befa38..6eb3b283161 100644 --- a/test/dm/mux-cmd.c +++ b/test/dm/mux-cmd.c @@ -109,7 +109,7 @@ static int dm_test_cmd_mux_list(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cmd_mux_list, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cmd_mux_list, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); static int dm_test_cmd_mux_select(struct unit_test_state *uts) { @@ -143,7 +143,7 @@ static int dm_test_cmd_mux_select(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cmd_mux_select, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cmd_mux_select, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_cmd_mux_deselect(struct unit_test_state *uts) { @@ -174,4 +174,4 @@ static int dm_test_cmd_mux_deselect(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_cmd_mux_deselect, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_cmd_mux_deselect, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/mux-emul.c b/test/dm/mux-emul.c index febd521104a..de231e4e5b2 100644 --- a/test/dm/mux-emul.c +++ b/test/dm/mux-emul.c @@ -79,7 +79,7 @@ static int dm_test_mux_emul_default_state(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_mux_emul_default_state, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mux_emul_default_state, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_mux_emul_select_deselect(struct unit_test_state *uts) { @@ -102,4 +102,4 @@ static int dm_test_mux_emul_select_deselect(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_mux_emul_select_deselect, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mux_emul_select_deselect, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/mux-mmio.c b/test/dm/mux-mmio.c index 3a871a19c7e..3bb1e49b8c9 100644 --- a/test/dm/mux-mmio.c +++ b/test/dm/mux-mmio.c @@ -85,7 +85,7 @@ static int dm_test_mux_mmio_select(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_mux_mmio_select, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_mux_mmio_select, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that managed API for mux work correctly */ static int dm_test_devm_mux_mmio(struct unit_test_state *uts) @@ -134,4 +134,4 @@ static int dm_test_devm_mux_mmio(struct unit_test_state *uts) device_remove(dev_b, DM_REMOVE_NORMAL); return 0; } -DM_TEST(dm_test_devm_mux_mmio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_devm_mux_mmio, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/nand.c b/test/dm/nand.c index 0b992fdce1c..c7e09850503 100644 --- a/test/dm/nand.c +++ b/test/dm/nand.c @@ -12,7 +12,7 @@ #include #include -static int dm_test_nand(struct unit_test_state *uts, int dev, bool end) +static int run_test_nand(struct unit_test_state *uts, int dev, bool end) { nand_erase_options_t opts = { }; struct mtd_info *mtd; @@ -88,17 +88,34 @@ static int dm_test_nand(struct unit_test_state *uts, int dev, bool end) return 0; } -#define DM_NAND_TEST(dev) \ -static int dm_test_nand##dev##_start(struct unit_test_state *uts) \ -{ \ - return dm_test_nand(uts, dev, false); \ -} \ -DM_TEST(dm_test_nand##dev##_start, UT_TESTF_SCAN_FDT); \ -static int dm_test_nand##dev##_end(struct unit_test_state *uts) \ -{ \ - return dm_test_nand(uts, dev, true); \ -} \ -DM_TEST(dm_test_nand##dev##_end, UT_TESTF_SCAN_FDT) +static int dm_test_nand0_start(struct unit_test_state *uts) +{ + ut_assertok(run_test_nand(uts, 0, false)); -DM_NAND_TEST(0); -DM_NAND_TEST(1); + return 0; +} +DM_TEST(dm_test_nand0_start, UTF_SCAN_FDT); + +static int dm_test_nand1_start(struct unit_test_state *uts) +{ + ut_assertok(run_test_nand(uts, 1, false)); + + return 0; +} +DM_TEST(dm_test_nand1_start, UTF_SCAN_FDT); + +static int dm_test_nand0_end(struct unit_test_state *uts) +{ + ut_assertok(run_test_nand(uts, 0, true)); + + return 0; +} +DM_TEST(dm_test_nand0_end, UTF_SCAN_FDT); + +static int dm_test_nand1_end(struct unit_test_state *uts) +{ + ut_assertok(run_test_nand(uts, 1, true)); + + return 0; +} +DM_TEST(dm_test_nand1_end, UTF_SCAN_FDT); diff --git a/test/dm/nop.c b/test/dm/nop.c index 0c79431d9d8..a6f5f820f6a 100644 --- a/test/dm/nop.c +++ b/test/dm/nop.c @@ -69,5 +69,4 @@ static int dm_test_nop(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_nop, UT_TESTF_FLAT_TREE | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_nop, UTF_FLAT_TREE | UTF_SCAN_FDT); diff --git a/test/dm/nvmxip.c b/test/dm/nvmxip.c index 537959a0930..a702d0aec3f 100644 --- a/test/dm/nvmxip.c +++ b/test/dm/nvmxip.c @@ -142,5 +142,4 @@ static int dm_test_nvmxip(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - -DM_TEST(dm_test_nvmxip, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_nvmxip, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c index d4939e88516..6e35bcaf62c 100644 --- a/test/dm/of_platdata.c +++ b/test/dm/of_platdata.c @@ -20,7 +20,7 @@ static int dm_test_of_plat_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_base, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_base, UTF_SCAN_PDATA); /* Test that we can read properties from a device */ static int dm_test_of_plat_props(struct unit_test_state *uts) @@ -91,7 +91,7 @@ static int dm_test_of_plat_props(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_props, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_props, UTF_SCAN_PDATA); /* * find_driver_info - recursively find the driver_info for a device @@ -173,7 +173,7 @@ static int dm_test_of_plat_dev(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_dev, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_dev, UTF_SCAN_PDATA); /* Test handling of phandles that point to other devices */ static int dm_test_of_plat_phandle(struct unit_test_state *uts) @@ -206,7 +206,7 @@ static int dm_test_of_plat_phandle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_phandle, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_phandle, UTF_SCAN_PDATA); #if CONFIG_IS_ENABLED(OF_PLATDATA_PARENT) /* Test that device parents are correctly set up */ @@ -220,7 +220,7 @@ static int dm_test_of_plat_parent(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_parent, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_parent, UTF_SCAN_PDATA); #endif /* Test clocks with of-platdata */ @@ -239,7 +239,7 @@ static int dm_test_of_plat_clk(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_clk, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_clk, UTF_SCAN_PDATA); /* Test irqs with of-platdata */ static int dm_test_of_plat_irq(struct unit_test_state *uts) @@ -258,7 +258,7 @@ static int dm_test_of_plat_irq(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_irq, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_irq, UTF_SCAN_PDATA); /* Test GPIOs with of-platdata */ static int dm_test_of_plat_gpio(struct unit_test_state *uts) @@ -277,4 +277,4 @@ static int dm_test_of_plat_gpio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_of_plat_gpio, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_of_plat_gpio, UTF_SCAN_PDATA); diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c index 39191d7f52b..859fc3ae0d0 100644 --- a/test/dm/ofnode.c +++ b/test/dm/ofnode.c @@ -47,7 +47,7 @@ oftree get_other_oftree(struct unit_test_state *uts) /* An invalid tree may cause failure or crashes */ if (!oftree_valid(tree)) - ut_reportf("test needs the UT_TESTF_OTHER_FDT flag"); + ut_reportf("test needs the UTF_OTHER_FDT flag"); return tree; } @@ -103,7 +103,7 @@ static int dm_test_ofnode_compatible(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_ofnode_compatible, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* check ofnode_device_is_compatible() with the 'other' FDT */ static int dm_test_ofnode_compatible_ot(struct unit_test_state *uts) @@ -116,7 +116,7 @@ static int dm_test_ofnode_compatible_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_compatible_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_compatible_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); static int dm_test_ofnode_get_by_phandle(struct unit_test_state *uts) { @@ -134,7 +134,7 @@ static int dm_test_ofnode_get_by_phandle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_get_by_phandle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_get_by_phandle, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test oftree_get_by_phandle() with a the 'other' oftree */ static int dm_test_ofnode_get_by_phandle_ot(struct unit_test_state *uts) @@ -150,7 +150,7 @@ static int dm_test_ofnode_get_by_phandle_ot(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_ofnode_get_by_phandle_ot, - UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); + UTF_SCAN_FDT | UTF_OTHER_FDT); static int check_prop_values(struct unit_test_state *uts, ofnode start, const char *propname, const char *propval, @@ -189,7 +189,7 @@ static int dm_test_ofnode_by_prop_value(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_by_prop_value, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_by_prop_value, UTF_SCAN_FDT); /* test ofnode_by_prop_value() with a the 'other' oftree */ static int dm_test_ofnode_by_prop_value_ot(struct unit_test_state *uts) @@ -202,7 +202,7 @@ static int dm_test_ofnode_by_prop_value_ot(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_ofnode_by_prop_value_ot, - UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); + UTF_SCAN_FDT | UTF_OTHER_FDT); /* test ofnode_read_fmap_entry() */ static int dm_test_ofnode_fmap(struct unit_test_state *uts) @@ -218,7 +218,7 @@ static int dm_test_ofnode_fmap(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_fmap, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_fmap, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_read_prop() */ static int dm_test_ofnode_read(struct unit_test_state *uts) @@ -248,7 +248,7 @@ static int dm_test_ofnode_read(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_read, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_read, UTF_SCAN_FDT); /* test ofnode_read_prop() with the 'other' tree */ static int dm_test_ofnode_read_ot(struct unit_test_state *uts) @@ -271,7 +271,7 @@ static int dm_test_ofnode_read_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_read_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_read_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); /* test ofnode_count_/parse_phandle_with_args() */ static int dm_test_ofnode_phandle(struct unit_test_state *uts) @@ -347,7 +347,7 @@ static int dm_test_ofnode_phandle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_phandle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_phandle, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_count_/parse_phandle_with_args() with 'other' tree */ static int dm_test_ofnode_phandle_ot(struct unit_test_state *uts) @@ -376,7 +376,7 @@ static int dm_test_ofnode_phandle_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_phandle_ot, UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_phandle_ot, UTF_OTHER_FDT); /* test ofnode_read_chosen_string/node/prop() */ static int dm_test_ofnode_read_chosen(struct unit_test_state *uts) @@ -406,7 +406,7 @@ static int dm_test_ofnode_read_chosen(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_read_chosen, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_read_chosen, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_get_aliases_node/prop() */ static int dm_test_ofnode_read_aliases(struct unit_test_state *uts) @@ -429,7 +429,7 @@ static int dm_test_ofnode_read_aliases(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_read_aliases, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_read_aliases, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_ofnode_get_child_count(struct unit_test_state *uts) { @@ -450,7 +450,7 @@ static int dm_test_ofnode_get_child_count(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_ofnode_get_child_count, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_get_child_count() with 'other' tree */ static int dm_test_ofnode_get_child_count_ot(struct unit_test_state *uts) @@ -473,7 +473,7 @@ static int dm_test_ofnode_get_child_count_ot(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_ofnode_get_child_count_ot, - UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); + UTF_SCAN_FDT | UTF_OTHER_FDT); static int dm_test_ofnode_is_enabled(struct unit_test_state *uts) { @@ -485,7 +485,7 @@ static int dm_test_ofnode_is_enabled(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_is_enabled, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_is_enabled, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_is_enabled() with 'other' tree */ static int dm_test_ofnode_is_enabled_ot(struct unit_test_state *uts) @@ -499,7 +499,7 @@ static int dm_test_ofnode_is_enabled_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_is_enabled_ot, UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_is_enabled_ot, UTF_OTHER_FDT); /* test ofnode_get_addr/size() */ static int dm_test_ofnode_get_reg(struct unit_test_state *uts) @@ -536,7 +536,7 @@ static int dm_test_ofnode_get_reg(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_get_reg, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_get_reg, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_get_addr() with 'other' tree */ static int dm_test_ofnode_get_reg_ot(struct unit_test_state *uts) @@ -550,7 +550,7 @@ static int dm_test_ofnode_get_reg_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_get_reg_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_get_reg_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); static int dm_test_ofnode_get_path(struct unit_test_state *uts) { @@ -571,7 +571,7 @@ static int dm_test_ofnode_get_path(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_get_path, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_get_path, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_get_path() with 'other' tree */ static int dm_test_ofnode_get_path_ot(struct unit_test_state *uts) @@ -591,7 +591,7 @@ static int dm_test_ofnode_get_path_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_get_path_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_get_path_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); /* test ofnode_conf_read_bool/int/str() */ static int dm_test_ofnode_conf(struct unit_test_state *uts) @@ -607,7 +607,7 @@ static int dm_test_ofnode_conf(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_conf, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_conf, UTF_SCAN_FDT); static int dm_test_ofnode_options(struct unit_test_state *uts) { @@ -644,7 +644,7 @@ static int dm_test_ofnode_for_each_compatible_node(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_for_each_compatible_node, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_for_each_compatible_node, UTF_SCAN_FDT); /* test dm_test_ofnode_string_count/index/list() */ static int dm_test_ofnode_string(struct unit_test_state *uts) @@ -692,7 +692,7 @@ static int dm_test_ofnode_string(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_string, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_string, UTF_SCAN_FDT); /* test error returns from ofnode_read_string_count/index/list() */ static int dm_test_ofnode_string_err(struct unit_test_state *uts) @@ -742,7 +742,7 @@ static int dm_test_ofnode_string_err(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_string_err, UT_TESTF_LIVE_TREE); +DM_TEST(dm_test_ofnode_string_err, UTF_LIVE_TREE); static int dm_test_ofnode_read_phy_mode(struct unit_test_state *uts) { @@ -764,7 +764,7 @@ static int dm_test_ofnode_read_phy_mode(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_read_phy_mode, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_read_phy_mode, UTF_SCAN_FDT); /** * make_ofnode_fdt() - Create an FDT for testing with ofnode @@ -811,7 +811,7 @@ static int dm_test_ofnode_aliases(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_aliases, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_aliases, UTF_SCAN_FDT); /** * dm_test_ofnode_root_mult() - Check aliaes on control and 'other' tree @@ -850,7 +850,7 @@ static int dm_test_ofnode_root_mult(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_root_mult, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_root_mult, UTF_SCAN_FDT); /* test ofnode_set_enabled(), ofnode_write_prop() on a livetree */ static int dm_test_ofnode_livetree_writing(struct unit_test_state *uts) @@ -897,7 +897,7 @@ static int dm_test_ofnode_livetree_writing(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_ofnode_livetree_writing, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); static int check_write_prop(struct unit_test_state *uts, ofnode node) { @@ -940,7 +940,7 @@ static int dm_test_ofnode_write_copy(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_write_copy, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_write_copy, UTF_SCAN_FDT); /* test writing a property to the 'other' tree */ static int dm_test_ofnode_write_copy_ot(struct unit_test_state *uts) @@ -957,7 +957,7 @@ static int dm_test_ofnode_write_copy_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_write_copy_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_write_copy_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); /* test ofnode_read_u32_index/default() */ static int dm_test_ofnode_u32(struct unit_test_state *uts) @@ -985,7 +985,7 @@ static int dm_test_ofnode_u32(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_u32, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_u32, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_read_u32_array() */ static int dm_test_ofnode_u32_array(struct unit_test_state *uts) @@ -1012,7 +1012,7 @@ static int dm_test_ofnode_u32_array(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_u32_array, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_u32_array, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test ofnode_read_u64() and ofnode_write_u64() */ static int dm_test_ofnode_u64(struct unit_test_state *uts) @@ -1046,7 +1046,7 @@ static int dm_test_ofnode_u64(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_u64, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_u64, UTF_SCAN_FDT); static int dm_test_ofnode_add_subnode(struct unit_test_state *uts) { @@ -1115,7 +1115,7 @@ static int dm_test_ofnode_add_subnode(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_add_subnode, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_add_subnode, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_ofnode_for_each_prop(struct unit_test_state *uts) { @@ -1139,7 +1139,7 @@ static int dm_test_ofnode_for_each_prop(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_for_each_prop, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_for_each_prop, UTF_SCAN_FDT); static int dm_test_ofnode_by_compatible(struct unit_test_state *uts) { @@ -1155,7 +1155,7 @@ static int dm_test_ofnode_by_compatible(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_by_compatible, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_by_compatible, UTF_SCAN_FDT); /* check ofnode_by_compatible() on the 'other' tree */ static int dm_test_ofnode_by_compatible_ot(struct unit_test_state *uts) @@ -1173,7 +1173,7 @@ static int dm_test_ofnode_by_compatible_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_by_compatible_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_by_compatible_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); static int dm_test_ofnode_find_subnode(struct unit_test_state *uts) { @@ -1190,7 +1190,7 @@ static int dm_test_ofnode_find_subnode(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_find_subnode, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_find_subnode, UTF_SCAN_FDT); /* test ofnode_find_subnode() on the 'other' tree */ static int dm_test_ofnode_find_subnode_ot(struct unit_test_state *uts) @@ -1209,7 +1209,7 @@ static int dm_test_ofnode_find_subnode_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_find_subnode_ot, UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_find_subnode_ot, UTF_OTHER_FDT); static int dm_test_ofnode_get_name(struct unit_test_state *uts) { @@ -1222,7 +1222,7 @@ static int dm_test_ofnode_get_name(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_get_name, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_get_name, UTF_SCAN_FDT); /* try to access more FDTs than is supported */ static int dm_test_ofnode_too_many(struct unit_test_state *uts) @@ -1259,7 +1259,7 @@ static int dm_test_ofnode_too_many(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_too_many, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_too_many, UTF_SCAN_FDT); static int check_copy_props(struct unit_test_state *uts, ofnode dst, ofnode src) { @@ -1304,7 +1304,7 @@ static int dm_test_ofnode_copy_props(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_copy_props, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_copy_props, UTF_SCAN_FDT); /* test ofnode_copy_props() with the 'other' tree */ static int dm_test_ofnode_copy_props_ot(struct unit_test_state *uts) @@ -1318,7 +1318,7 @@ static int dm_test_ofnode_copy_props_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_copy_props_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_copy_props_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); /* check that the livetree is aligned to a structure boundary */ static int dm_test_livetree_align(struct unit_test_state *uts) @@ -1344,7 +1344,7 @@ static int dm_test_livetree_align(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_livetree_align, UT_TESTF_SCAN_FDT | UT_TESTF_LIVE_TREE); +DM_TEST(dm_test_livetree_align, UTF_SCAN_FDT | UTF_LIVE_TREE); /* check that it is possible to load an arbitrary livetree */ static int dm_test_livetree_ensure(struct unit_test_state *uts) @@ -1363,7 +1363,7 @@ static int dm_test_livetree_ensure(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_livetree_ensure, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_livetree_ensure, UTF_SCAN_FDT); static int dm_test_oftree_new(struct unit_test_state *uts) { @@ -1379,7 +1379,7 @@ static int dm_test_oftree_new(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_oftree_new, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_oftree_new, UTF_SCAN_FDT); static int check_copy_node(struct unit_test_state *uts, ofnode dst, ofnode src, ofnode *nodep) @@ -1428,7 +1428,7 @@ static int dm_test_ofnode_copy_node(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_copy_node, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_copy_node, UTF_SCAN_FDT); /* test ofnode_copy_node() with the 'other' tree */ static int dm_test_ofnode_copy_node_ot(struct unit_test_state *uts) @@ -1442,7 +1442,7 @@ static int dm_test_ofnode_copy_node_ot(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_copy_node_ot, UT_TESTF_SCAN_FDT | UT_TESTF_OTHER_FDT); +DM_TEST(dm_test_ofnode_copy_node_ot, UTF_SCAN_FDT | UTF_OTHER_FDT); static int dm_test_ofnode_delete(struct unit_test_state *uts) { @@ -1473,7 +1473,7 @@ static int dm_test_ofnode_delete(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofnode_delete, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofnode_delete, UTF_SCAN_FDT); static int dm_test_oftree_to_fdt(struct unit_test_state *uts) { @@ -1495,7 +1495,7 @@ static int dm_test_oftree_to_fdt(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_oftree_to_fdt, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_oftree_to_fdt, UTF_SCAN_FDT); /* test ofnode_read_bool() and ofnode_write_bool() */ static int dm_test_bool(struct unit_test_state *uts) @@ -1520,4 +1520,4 @@ static int dm_test_bool(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_bool, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_bool, UTF_SCAN_FDT); diff --git a/test/dm/ofread.c b/test/dm/ofread.c index 69d03c49107..069551a31af 100644 --- a/test/dm/ofread.c +++ b/test/dm/ofread.c @@ -45,4 +45,4 @@ static int dm_test_ofprop_get_property(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofprop_get_property, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofprop_get_property, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/osd.c b/test/dm/osd.c index cf4a3a545ed..5fb27a3d822 100644 --- a/test/dm/osd.c +++ b/test/dm/osd.c @@ -130,8 +130,7 @@ static int dm_test_osd_basics(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_osd_basics, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_osd_basics, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_osd_extended(struct unit_test_state *uts) { @@ -214,5 +213,4 @@ static int dm_test_osd_extended(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_osd_extended, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_osd_extended, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/p2sb.c b/test/dm/p2sb.c index 3ada1fcb362..4cc374e04ed 100644 --- a/test/dm/p2sb.c +++ b/test/dm/p2sb.c @@ -24,4 +24,4 @@ static int dm_test_p2sb_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_p2sb_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_p2sb_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/panel.c b/test/dm/panel.c index 8be7c397a46..ce835c96ed0 100644 --- a/test/dm/panel.c +++ b/test/dm/panel.c @@ -76,4 +76,4 @@ static int dm_test_panel(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_panel, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_panel, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/part.c b/test/dm/part.c index cabb31d18ca..c5c4b3fdba1 100644 --- a/test/dm/part.c +++ b/test/dm/part.c @@ -93,7 +93,7 @@ static int dm_test_part(struct unit_test_state *uts) env_set("bootdevice", oldbootdevice); return ret; } -DM_TEST(dm_test_part, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_part, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_part_bootable(struct unit_test_state *uts) { @@ -106,7 +106,7 @@ static int dm_test_part_bootable(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_part_bootable, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_part_bootable, UTF_SCAN_FDT); static int do_get_info_test(struct unit_test_state *uts, struct blk_desc *dev_desc, int part, int part_type, @@ -193,4 +193,4 @@ static int dm_test_part_get_info_by_type(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_part_get_info_by_type, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_part_get_info_by_type, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/pch.c b/test/dm/pch.c index b37b856d5da..88e924dc2a6 100644 --- a/test/dm/pch.c +++ b/test/dm/pch.c @@ -33,7 +33,7 @@ static int dm_test_pch_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pch_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pch_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test sandbox PCH ioctl */ static int dm_test_pch_ioctl(struct unit_test_state *uts) @@ -52,4 +52,4 @@ static int dm_test_pch_ioctl(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pch_ioctl, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pch_ioctl, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/pci.c b/test/dm/pci.c index 9b97f2e0544..6eb19f6fea3 100644 --- a/test/dm/pci.c +++ b/test/dm/pci.c @@ -19,7 +19,7 @@ static int dm_test_pci_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that sandbox PCI bus numbering and device works correctly */ static int dm_test_pci_busdev(struct unit_test_state *uts) @@ -54,7 +54,7 @@ static int dm_test_pci_busdev(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_busdev, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_busdev, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can use the swapcase device correctly */ static int dm_test_pci_swapcase(struct unit_test_state *uts) @@ -107,7 +107,7 @@ static int dm_test_pci_swapcase(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_swapcase, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_swapcase, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can dynamically bind the device driver correctly */ static int dm_test_pci_drvdata(struct unit_test_state *uts) @@ -129,7 +129,7 @@ static int dm_test_pci_drvdata(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_drvdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_drvdata, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that devices on PCI bus#2 can be accessed correctly */ static int dm_test_pci_mixed(struct unit_test_state *uts) @@ -192,7 +192,7 @@ static int dm_test_pci_mixed(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_mixed, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_mixed, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test looking up PCI capability and extended capability */ static int dm_test_pci_cap(struct unit_test_state *uts) @@ -244,7 +244,7 @@ static int dm_test_pci_cap(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_cap, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_cap, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test looking up BARs in EA capability structure */ static int dm_test_pci_ea(struct unit_test_state *uts) @@ -293,7 +293,7 @@ static int dm_test_pci_ea(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_ea, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_ea, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test the dev_read_addr_pci() function */ static int dm_test_pci_addr_flat(struct unit_test_state *uts) @@ -318,14 +318,14 @@ static int dm_test_pci_addr_flat(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_addr_flat, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | - UT_TESTF_FLAT_TREE); +DM_TEST(dm_test_pci_addr_flat, UTF_SCAN_PDATA | UTF_SCAN_FDT | + UTF_FLAT_TREE); /* * Test the dev_read_addr_pci() function with livetree. That function is * not currently fully implemented, in that it fails to return the BAR address. * Once that is implemented this test can be removed and dm_test_pci_addr_flat() - * can be used for both flattree and livetree by removing the UT_TESTF_FLAT_TREE + * can be used for both flattree and livetree by removing the UTF_FLAT_TREE * flag above. */ static int dm_test_pci_addr_live(struct unit_test_state *uts) @@ -343,8 +343,7 @@ static int dm_test_pci_addr_live(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_addr_live, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | - UT_TESTF_LIVE_TREE); +DM_TEST(dm_test_pci_addr_live, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_LIVE_TREE); /* Test device_is_on_pci_bus() */ static int dm_test_pci_on_bus(struct unit_test_state *uts) @@ -358,7 +357,7 @@ static int dm_test_pci_on_bus(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_on_bus, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_on_bus, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* * Test support for multiple memory regions enabled via @@ -380,7 +379,7 @@ static int dm_test_pci_region_multi(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_region_multi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_region_multi, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* * Test the translation of PCI bus addresses to physical addresses using the @@ -433,7 +432,7 @@ static int dm_test_pci_bus_to_phys(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_bus_to_phys, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_bus_to_phys, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* * Test the translation of physical addresses to PCI bus addresses using the @@ -486,4 +485,4 @@ static int dm_test_pci_phys_to_bus(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pci_phys_to_bus, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_phys_to_bus, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/pci_ep.c b/test/dm/pci_ep.c index e82fc53f84b..068b72a20c0 100644 --- a/test/dm/pci_ep.c +++ b/test/dm/pci_ep.c @@ -59,5 +59,4 @@ static int dm_test_pci_ep_base(struct unit_test_state *uts) ut_asserteq(sandbox_get_pci_ep_irq_count(bus), 10); return 0; } - -DM_TEST(dm_test_pci_ep_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pci_ep_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/phy.c b/test/dm/phy.c index d14117f6f7a..9b4cff60e6a 100644 --- a/test/dm/phy.c +++ b/test/dm/phy.c @@ -68,7 +68,7 @@ static int dm_test_phy_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_phy_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_phy_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of the phy uclass using the sandbox phy driver operations */ static int dm_test_phy_ops(struct unit_test_state *uts) @@ -140,7 +140,7 @@ static int dm_test_phy_ops(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_phy_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_phy_ops, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_phy_bulk(struct unit_test_state *uts) { @@ -173,7 +173,7 @@ static int dm_test_phy_bulk(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_phy_bulk, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_phy_bulk, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_phy_multi_exit(struct unit_test_state *uts) { @@ -232,7 +232,7 @@ static int dm_test_phy_multi_exit(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_phy_multi_exit, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_phy_multi_exit, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_phy_setup(struct unit_test_state *uts) { @@ -261,4 +261,4 @@ static int dm_test_phy_setup(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_phy_setup, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_phy_setup, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/phys2bus.c b/test/dm/phys2bus.c index 1ee2150482c..0f30c7e37fd 100644 --- a/test/dm/phys2bus.c +++ b/test/dm/phys2bus.c @@ -33,4 +33,4 @@ static int dm_test_phys_to_bus(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_phys_to_bus, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_phys_to_bus, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/pinmux.c b/test/dm/pinmux.c index cfbe3ef5d1e..92e5bc83802 100644 --- a/test/dm/pinmux.c +++ b/test/dm/pinmux.c @@ -68,8 +68,7 @@ static int dm_test_pinmux(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_pinmux, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pinmux, UTF_SCAN_FDT); static int dm_test_pinctrl_single(struct unit_test_state *uts) { @@ -143,5 +142,4 @@ static int dm_test_pinctrl_single(struct unit_test_state *uts) ut_asserteq(-EINVAL, ret); return 0; } - -DM_TEST(dm_test_pinctrl_single, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pinctrl_single, UTF_SCAN_FDT); diff --git a/test/dm/pmc.c b/test/dm/pmc.c index bbad1ee2741..00122798b71 100644 --- a/test/dm/pmc.c +++ b/test/dm/pmc.c @@ -29,4 +29,4 @@ static int dm_test_pmc_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pmc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pmc_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/pmic.c b/test/dm/pmic.c index 53a6f0369e8..70dd18f5df0 100644 --- a/test/dm/pmic.c +++ b/test/dm/pmic.c @@ -43,7 +43,7 @@ static int dm_test_power_pmic_get(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_pmic_get, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_pmic_get, UTF_SCAN_FDT); /* PMIC get method - MC34708 - for 3 bytes transmission */ static int dm_test_power_pmic_mc34708_get(struct unit_test_state *uts) @@ -52,8 +52,7 @@ static int dm_test_power_pmic_mc34708_get(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_power_pmic_mc34708_get, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_pmic_mc34708_get, UTF_SCAN_FDT); /* Test PMIC I/O */ static int dm_test_power_pmic_io(struct unit_test_state *uts) @@ -82,7 +81,7 @@ static int dm_test_power_pmic_io(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_pmic_io, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_pmic_io, UTF_SCAN_FDT); #define MC34708_PMIC_REG_COUNT 64 #define MC34708_PMIC_TEST_VAL 0x125534 @@ -99,8 +98,7 @@ static int dm_test_power_pmic_mc34708_regs_check(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_power_pmic_mc34708_regs_check, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_pmic_mc34708_regs_check, UTF_SCAN_FDT); static int dm_test_power_pmic_mc34708_rw_val(struct unit_test_state *uts) { @@ -126,5 +124,4 @@ static int dm_test_power_pmic_mc34708_rw_val(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_power_pmic_mc34708_rw_val, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_pmic_mc34708_rw_val, UTF_SCAN_FDT); diff --git a/test/dm/power-domain.c b/test/dm/power-domain.c index 120a9059c8e..896cf5b2ae9 100644 --- a/test/dm/power-domain.c +++ b/test/dm/power-domain.c @@ -45,4 +45,4 @@ static int dm_test_power_domain(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_domain, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_domain, UTF_SCAN_FDT); diff --git a/test/dm/pwm.c b/test/dm/pwm.c index 80133347ec7..5ccd8bc89b9 100644 --- a/test/dm/pwm.c +++ b/test/dm/pwm.c @@ -41,4 +41,4 @@ static int dm_test_pwm_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_pwm_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_pwm_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/qfw.c b/test/dm/qfw.c index 3c354163ef3..b6be5c5baa5 100644 --- a/test/dm/qfw.c +++ b/test/dm/qfw.c @@ -23,8 +23,7 @@ static int dm_test_qfw_cpus(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_qfw_cpus, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_qfw_cpus, UTF_SCAN_PDATA); static int dm_test_qfw_firmware_list(struct unit_test_state *uts) { @@ -37,5 +36,4 @@ static int dm_test_qfw_firmware_list(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_qfw_firmware_list, UT_TESTF_SCAN_PDATA); +DM_TEST(dm_test_qfw_firmware_list, UTF_SCAN_PDATA); diff --git a/test/dm/ram.c b/test/dm/ram.c index 188c7c32758..f3710b1f691 100644 --- a/test/dm/ram.c +++ b/test/dm/ram.c @@ -25,4 +25,4 @@ static int dm_test_ram_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ram_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ram_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/read.c b/test/dm/read.c index 4ecf18110d0..0aa822195a8 100644 --- a/test/dm/read.c +++ b/test/dm/read.c @@ -45,4 +45,4 @@ static int dm_test_dma_ranges(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_dma_ranges, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_dma_ranges, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/reboot-mode.c b/test/dm/reboot-mode.c index 160b4da07f2..9a3b2bf0a43 100644 --- a/test/dm/reboot-mode.c +++ b/test/dm/reboot-mode.c @@ -39,9 +39,8 @@ static int dm_test_reboot_mode_gpio(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_reboot_mode_gpio, - UT_TESTF_PROBE_TEST | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_PROBE_TEST | UTF_SCAN_FDT | UTF_FLAT_TREE); static int dm_test_reboot_mode_rtc(struct unit_test_state *uts) { @@ -65,6 +64,5 @@ static int dm_test_reboot_mode_rtc(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_reboot_mode_rtc, - UT_TESTF_PROBE_TEST | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_PROBE_TEST | UTF_SCAN_FDT | UTF_FLAT_TREE); diff --git a/test/dm/regmap.c b/test/dm/regmap.c index 1398f8f6573..5024b47c7a2 100644 --- a/test/dm/regmap.c +++ b/test/dm/regmap.c @@ -69,7 +69,7 @@ static int dm_test_regmap_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_regmap_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_regmap_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test we can access a regmap through syscon */ static int dm_test_regmap_syscon(struct unit_test_state *uts) @@ -94,8 +94,7 @@ static int dm_test_regmap_syscon(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_regmap_syscon, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_regmap_syscon, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Read/Write/Modify test */ static int dm_test_regmap_rw(struct unit_test_state *uts) @@ -128,8 +127,7 @@ static int dm_test_regmap_rw(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_regmap_rw, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_regmap_rw, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Get/Set test */ static int dm_test_regmap_getset(struct unit_test_state *uts) @@ -159,8 +157,7 @@ static int dm_test_regmap_getset(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_regmap_getset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_regmap_getset, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Read polling test */ static int dm_test_regmap_poll(struct unit_test_state *uts) @@ -187,8 +184,7 @@ static int dm_test_regmap_poll(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_regmap_poll, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_regmap_poll, UTF_SCAN_PDATA | UTF_SCAN_FDT); struct regmaptest_priv { struct regmap *cfg_regmap; /* For testing regmap_config options. */ @@ -324,7 +320,7 @@ static int dm_test_devm_regmap(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devm_regmap, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_devm_regmap, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int test_one_field(struct unit_test_state *uts, struct regmap *regmap, @@ -383,4 +379,4 @@ static int dm_test_devm_regmap_field(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_devm_regmap_field, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_devm_regmap_field, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/regulator.c b/test/dm/regulator.c index 9e45fd177b9..532bbd82376 100644 --- a/test/dm/regulator.c +++ b/test/dm/regulator.c @@ -89,7 +89,7 @@ static int dm_test_power_regulator_get(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_get, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_get, UTF_SCAN_FDT); /* Test regulator set and get Voltage method */ static int dm_test_power_regulator_set_get_voltage(struct unit_test_state *uts) @@ -116,7 +116,7 @@ static int dm_test_power_regulator_set_get_voltage(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_set_get_voltage, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_set_get_voltage, UTF_SCAN_FDT); /* Test regulator set and get Current method */ static int dm_test_power_regulator_set_get_current(struct unit_test_state *uts) @@ -155,7 +155,7 @@ static int dm_test_power_regulator_set_get_current(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_set_get_current, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_set_get_current, UTF_SCAN_FDT); /* Test regulator set and get Enable method */ static int dm_test_power_regulator_set_get_enable(struct unit_test_state *uts) @@ -174,7 +174,7 @@ static int dm_test_power_regulator_set_get_enable(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_set_get_enable, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_set_get_enable, UTF_SCAN_FDT); /* Test regulator set and get enable if allowed method */ static @@ -195,7 +195,7 @@ int dm_test_power_regulator_set_enable_if_allowed(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_set_enable_if_allowed, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_set_enable_if_allowed, UTF_SCAN_FDT); /* Test regulator set and get mode method */ static int dm_test_power_regulator_set_get_mode(struct unit_test_state *uts) @@ -214,7 +214,7 @@ static int dm_test_power_regulator_set_get_mode(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_set_get_mode, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_set_get_mode, UTF_SCAN_FDT); /* Test regulator set and get suspend Voltage method */ static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_state *uts) @@ -244,7 +244,7 @@ static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_stat } return 0; } -DM_TEST(dm_test_power_regulator_set_get_suspend_voltage, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_set_get_suspend_voltage, UTF_SCAN_FDT); /* Test regulator set and get suspend Enable method */ static int dm_test_power_regulator_set_get_suspend_enable(struct unit_test_state *uts) @@ -271,7 +271,7 @@ static int dm_test_power_regulator_set_get_suspend_enable(struct unit_test_state } return 0; } -DM_TEST(dm_test_power_regulator_set_get_suspend_enable, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_set_get_suspend_enable, UTF_SCAN_FDT); /* Test regulator autoset method */ static int dm_test_power_regulator_autoset(struct unit_test_state *uts) @@ -304,7 +304,7 @@ static int dm_test_power_regulator_autoset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_autoset, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_autoset, UTF_SCAN_FDT); /* * Struct setting: to keep the expected output settings. @@ -400,4 +400,4 @@ static int dm_test_power_regulator_autoset_list(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_power_regulator_autoset_list, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_power_regulator_autoset_list, UTF_SCAN_FDT); diff --git a/test/dm/remoteproc.c b/test/dm/remoteproc.c index 444c4dce083..921314ba930 100644 --- a/test/dm/remoteproc.c +++ b/test/dm/remoteproc.c @@ -68,7 +68,7 @@ static int dm_test_remoteproc_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_remoteproc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_remoteproc_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); #define DEVICE_TO_PHYSICAL_OFFSET 0x1000 /** @@ -256,4 +256,4 @@ static int dm_test_remoteproc_elf(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_remoteproc_elf, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_remoteproc_elf, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/reset.c b/test/dm/reset.c index d3158bf4a72..dceb6a1dad3 100644 --- a/test/dm/reset.c +++ b/test/dm/reset.c @@ -66,8 +66,7 @@ static int dm_test_reset_base(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_reset_base, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_reset_base, UTF_SCAN_FDT); static int dm_test_reset(struct unit_test_state *uts) { @@ -94,7 +93,7 @@ static int dm_test_reset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_reset, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_reset, UTF_SCAN_FDT); static int dm_test_reset_devm(struct unit_test_state *uts) { @@ -119,7 +118,7 @@ static int dm_test_reset_devm(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_reset_devm, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_reset_devm, UTF_SCAN_FDT); static int dm_test_reset_bulk(struct unit_test_state *uts) { @@ -149,7 +148,7 @@ static int dm_test_reset_bulk(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_reset_bulk, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_reset_bulk, UTF_SCAN_FDT); static int dm_test_reset_bulk_devm(struct unit_test_state *uts) { @@ -181,4 +180,4 @@ static int dm_test_reset_bulk_devm(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_reset_bulk_devm, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_reset_bulk_devm, UTF_SCAN_FDT); diff --git a/test/dm/rkmtd.c b/test/dm/rkmtd.c index 3dc9ca1add1..d1ca5d1acac 100644 --- a/test/dm/rkmtd.c +++ b/test/dm/rkmtd.c @@ -85,7 +85,7 @@ static int dm_test_rkmtd(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rkmtd, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rkmtd, UTF_SCAN_FDT); /* Reusing the same label should work */ static int dm_test_rkmtd_dup(struct unit_test_state *uts) @@ -112,7 +112,7 @@ static int dm_test_rkmtd_dup(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rkmtd_dup, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rkmtd_dup, UTF_SCAN_FDT); /* Basic test of the 'rkmtd' command */ static int dm_test_rkmtd_cmd(struct unit_test_state *uts) @@ -196,4 +196,4 @@ static int dm_test_rkmtd_cmd(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rkmtd_cmd, UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_rkmtd_cmd, UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/dm/rng.c b/test/dm/rng.c index c8ed6cadf58..d7ef0722ff5 100644 --- a/test/dm/rng.c +++ b/test/dm/rng.c @@ -23,7 +23,7 @@ static int dm_test_rng_read(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rng_read, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rng_read, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test the rng command */ static int dm_test_rng_cmd(struct unit_test_state *uts) @@ -33,8 +33,6 @@ static int dm_test_rng_cmd(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_RNG, 0, &dev)); ut_assertnonnull(dev); - ut_assertok(console_record_reset_enable()); - run_command("rng", 0); ut_assert_nextlinen("00000000:"); ut_assert_nextlinen("00000010:"); @@ -52,4 +50,4 @@ static int dm_test_rng_cmd(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rng_cmd, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_CONSOLE_REC); +DM_TEST(dm_test_rng_cmd, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); diff --git a/test/dm/rtc.c b/test/dm/rtc.c index a8aa41955c2..88f080b64a8 100644 --- a/test/dm/rtc.c +++ b/test/dm/rtc.c @@ -27,7 +27,7 @@ static int dm_test_rtc_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rtc_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rtc_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); static void show_time(const char *msg, struct rtc_time *time) { @@ -142,7 +142,7 @@ static int dm_test_rtc_set_get(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rtc_set_get, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rtc_set_get, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_rtc_read_write(struct unit_test_state *uts) { @@ -186,13 +186,11 @@ static int dm_test_rtc_read_write(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rtc_read_write, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rtc_read_write, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test 'rtc list' command */ static int dm_test_rtc_cmd_list(struct unit_test_state *uts) { - console_record_reset(); - run_command("rtc list", 0); ut_assert_nextline("RTC #0 - rtc@43"); ut_assert_nextline("RTC #1 - rtc@61"); @@ -200,13 +198,11 @@ static int dm_test_rtc_cmd_list(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rtc_cmd_list, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rtc_cmd_list, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); /* Test 'rtc read' and 'rtc write' commands */ static int dm_test_rtc_cmd_rw(struct unit_test_state *uts) { - console_record_reset(); - run_command("rtc dev 0", 0); ut_assert_nextline("RTC #0 - rtc@43"); ut_assert_console_end(); @@ -243,7 +239,7 @@ static int dm_test_rtc_cmd_rw(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rtc_cmd_rw, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rtc_cmd_rw, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE); /* Reset the time */ static int dm_test_rtc_reset(struct unit_test_state *uts) @@ -280,7 +276,7 @@ static int dm_test_rtc_reset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rtc_reset, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rtc_reset, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Check that two RTC devices can be used independently */ static int dm_test_rtc_dual(struct unit_test_state *uts) @@ -312,4 +308,4 @@ static int dm_test_rtc_dual(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_rtc_dual, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_rtc_dual, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/scmi.c b/test/dm/scmi.c index c9a03523184..3655594c26d 100644 --- a/test/dm/scmi.c +++ b/test/dm/scmi.c @@ -95,7 +95,7 @@ static int dm_test_scmi_sandbox_agent(struct unit_test_state *uts) return ret; } -DM_TEST(dm_test_scmi_sandbox_agent, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scmi_sandbox_agent, UTF_SCAN_FDT); static int dm_test_scmi_base(struct unit_test_state *uts) { @@ -202,8 +202,7 @@ static int dm_test_scmi_base(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_scmi_base, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scmi_base, UTF_SCAN_FDT); static int dm_test_scmi_cmd(struct unit_test_state *uts) { @@ -282,8 +281,7 @@ static int dm_test_scmi_cmd(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_scmi_cmd, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scmi_cmd, UTF_SCAN_FDT | UTF_CONSOLE); static int dm_test_scmi_power_domains(struct unit_test_state *uts) { @@ -388,8 +386,7 @@ static int dm_test_scmi_power_domains(struct unit_test_state *uts) return release_sandbox_scmi_test_devices(uts, dev); } - -DM_TEST(dm_test_scmi_power_domains, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scmi_power_domains, UTF_SCAN_FDT); static int dm_test_scmi_clocks(struct unit_test_state *uts) { @@ -458,7 +455,7 @@ static int dm_test_scmi_clocks(struct unit_test_state *uts) return release_sandbox_scmi_test_devices(uts, dev); } -DM_TEST(dm_test_scmi_clocks, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scmi_clocks, UTF_SCAN_FDT); static int dm_test_scmi_resets(struct unit_test_state *uts) { @@ -496,7 +493,7 @@ static int dm_test_scmi_resets(struct unit_test_state *uts) return release_sandbox_scmi_test_devices(uts, dev); } -DM_TEST(dm_test_scmi_resets, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scmi_resets, UTF_SCAN_FDT); static int dm_test_scmi_voltage_domains(struct unit_test_state *uts) { @@ -551,4 +548,4 @@ static int dm_test_scmi_voltage_domains(struct unit_test_state *uts) return release_sandbox_scmi_test_devices(uts, dev); } -DM_TEST(dm_test_scmi_voltage_domains, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scmi_voltage_domains, UTF_SCAN_FDT); diff --git a/test/dm/scsi.c b/test/dm/scsi.c index 5180159fb27..fbc36a74244 100644 --- a/test/dm/scsi.c +++ b/test/dm/scsi.c @@ -35,4 +35,4 @@ static int dm_test_scsi_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_scsi_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_scsi_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/serial.c b/test/dm/serial.c index 34c0d4db879..4acb14f41bc 100644 --- a/test/dm/serial.c +++ b/test/dm/serial.c @@ -87,5 +87,4 @@ static int dm_test_serial(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_serial, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_serial, UTF_SCAN_FDT); diff --git a/test/dm/sf.c b/test/dm/sf.c index 0e3a0f13f9e..3684d021709 100644 --- a/test/dm/sf.c +++ b/test/dm/sf.c @@ -72,7 +72,7 @@ static int dm_test_spi_flash(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spi_flash, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spi_flash, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Functional test that sandbox SPI flash works correctly */ static int dm_test_spi_flash_func(struct unit_test_state *uts) @@ -100,4 +100,4 @@ static int dm_test_spi_flash_func(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spi_flash_func, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spi_flash_func, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/simple-bus.c b/test/dm/simple-bus.c index 8a730ba2fce..d9534830b16 100644 --- a/test/dm/simple-bus.c +++ b/test/dm/simple-bus.c @@ -29,4 +29,4 @@ static int dm_test_simple_bus(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_simple_bus, UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); +DM_TEST(dm_test_simple_bus, UTF_SCAN_FDT | UTF_FLAT_TREE); diff --git a/test/dm/simple-pm-bus.c b/test/dm/simple-pm-bus.c index 9949cb34d59..8ae5e7754a9 100644 --- a/test/dm/simple-pm-bus.c +++ b/test/dm/simple-pm-bus.c @@ -41,4 +41,4 @@ static int dm_test_simple_pm_bus(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_simple_pm_bus, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_simple_pm_bus, UTF_SCAN_FDT); diff --git a/test/dm/sm.c b/test/dm/sm.c index 4d95c2ad75b..cf4dab6a722 100644 --- a/test/dm/sm.c +++ b/test/dm/sm.c @@ -60,5 +60,4 @@ static int dm_test_sm(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_sm, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sm, UTF_SCAN_FDT); diff --git a/test/dm/smem.c b/test/dm/smem.c index adcbfe574ab..89e74cccc57 100644 --- a/test/dm/smem.c +++ b/test/dm/smem.c @@ -23,4 +23,4 @@ static int dm_test_smem_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_smem_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_smem_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/soc.c b/test/dm/soc.c index cb0ac1545f7..a6b82e5376d 100644 --- a/test/dm/soc.c +++ b/test/dm/soc.c @@ -115,5 +115,4 @@ static int dm_test_soc(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_soc, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_soc, UTF_SCAN_FDT); diff --git a/test/dm/sound.c b/test/dm/sound.c index f4e6215e683..7b5556738dc 100644 --- a/test/dm/sound.c +++ b/test/dm/sound.c @@ -43,7 +43,7 @@ static int dm_test_sound(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_sound, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sound, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test of the 'start beep' operations */ static int dm_test_sound_beep(struct unit_test_state *uts) @@ -64,4 +64,4 @@ static int dm_test_sound_beep(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_sound_beep, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sound_beep, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/spi.c b/test/dm/spi.c index 1ab2dd78324..249a9238fed 100644 --- a/test/dm/spi.c +++ b/test/dm/spi.c @@ -89,7 +89,7 @@ static int dm_test_spi_find(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spi_find, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spi_find, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* dm_test_spi_switch_slaves - Helper function to check whether spi_claim_bus * operates correctly with two spi slaves. @@ -168,7 +168,7 @@ static int dm_test_spi_claim_bus(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spi_claim_bus, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spi_claim_bus, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that sandbox SPI works correctly */ static int dm_test_spi_xfer(struct unit_test_state *uts) @@ -199,4 +199,4 @@ static int dm_test_spi_xfer(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spi_xfer, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spi_xfer, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/spmi.c b/test/dm/spmi.c index ee444f3b9b1..d706fc981ca 100644 --- a/test/dm/spmi.c +++ b/test/dm/spmi.c @@ -43,7 +43,7 @@ static int dm_test_spmi_probe(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spmi_probe, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spmi_probe, UTF_SCAN_FDT); /* Test if it's possible to read bus directly and indirectly */ static int dm_test_spmi_access(struct unit_test_state *uts) @@ -68,7 +68,7 @@ static int dm_test_spmi_access(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spmi_access, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spmi_access, UTF_SCAN_FDT); /* Test if it's possible to access GPIO that should be in pmic */ static int dm_test_spmi_access_peripheral(struct unit_test_state *uts) @@ -108,4 +108,4 @@ static int dm_test_spmi_access_peripheral(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_spmi_access_peripheral, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_spmi_access_peripheral, UTF_SCAN_FDT); diff --git a/test/dm/syscon-reset.c b/test/dm/syscon-reset.c index ba19504573f..5f51c1b96f1 100644 --- a/test/dm/syscon-reset.c +++ b/test/dm/syscon-reset.c @@ -55,4 +55,4 @@ static int dm_test_syscon_reset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_syscon_reset, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_syscon_reset, UTF_SCAN_FDT); diff --git a/test/dm/syscon.c b/test/dm/syscon.c index 04d324e87d4..9855859721b 100644 --- a/test/dm/syscon.c +++ b/test/dm/syscon.c @@ -28,7 +28,7 @@ static int dm_test_syscon_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_syscon_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_syscon_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test system controller finding */ static int dm_test_syscon_by_driver_data(struct unit_test_state *uts) @@ -45,7 +45,7 @@ static int dm_test_syscon_by_driver_data(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_syscon_by_driver_data, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_syscon_by_driver_data, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test system controller by phandle */ static int dm_test_syscon_by_phandle(struct unit_test_state *uts) @@ -80,4 +80,4 @@ static int dm_test_syscon_by_phandle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_syscon_by_phandle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_syscon_by_phandle, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/sysinfo-gpio.c b/test/dm/sysinfo-gpio.c index 24a99dafb15..155da3b6344 100644 --- a/test/dm/sysinfo-gpio.c +++ b/test/dm/sysinfo-gpio.c @@ -65,4 +65,4 @@ static int dm_test_sysinfo_gpio(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_sysinfo_gpio, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sysinfo_gpio, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/sysinfo.c b/test/dm/sysinfo.c index 7444a580df6..6c0d2d7e4df 100644 --- a/test/dm/sysinfo.c +++ b/test/dm/sysinfo.c @@ -59,5 +59,4 @@ static int dm_test_sysinfo(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_sysinfo, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sysinfo, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/sysreset.c b/test/dm/sysreset.c index f3a859be787..8431aaa0a9e 100644 --- a/test/dm/sysreset.c +++ b/test/dm/sysreset.c @@ -45,7 +45,7 @@ static int dm_test_sysreset_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_sysreset_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sysreset_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_sysreset_get_status(struct unit_test_state *uts) { @@ -64,7 +64,7 @@ static int dm_test_sysreset_get_status(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_sysreset_get_status, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sysreset_get_status, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can walk through the sysreset devices */ static int dm_test_sysreset_walk(struct unit_test_state *uts) @@ -95,7 +95,7 @@ static int dm_test_sysreset_walk(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_sysreset_walk, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sysreset_walk, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_sysreset_get_last(struct unit_test_state *uts) { @@ -114,4 +114,4 @@ static int dm_test_sysreset_get_last(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_sysreset_get_last, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_sysreset_get_last, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/tag.c b/test/dm/tag.c index bce8a35acfb..1412171738c 100644 --- a/test/dm/tag.c +++ b/test/dm/tag.c @@ -29,7 +29,6 @@ static int dm_test_tag_ptr(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_tag_ptr, 0); /* @@ -49,7 +48,6 @@ static int dm_test_tag_val(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_tag_val, 0); /* @@ -63,7 +61,6 @@ static int dm_test_tag_inval(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_tag_inval, 0); /* @@ -79,5 +76,4 @@ static int dm_test_tag_del_all(struct unit_test_state *uts) return 0; } - DM_TEST(dm_test_tag_del_all, 0); diff --git a/test/dm/tee.c b/test/dm/tee.c index bb02a9b3c98..b56c982eb75 100644 --- a/test/dm/tee.c +++ b/test/dm/tee.c @@ -215,5 +215,4 @@ out: return rc; } - -DM_TEST(dm_test_tee, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_tee, UTF_SCAN_FDT); diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c index 31effff59c2..af8cd617108 100644 --- a/test/dm/test-fdt.c +++ b/test/dm/test-fdt.c @@ -296,7 +296,7 @@ static int dm_test_fdt_uclass_seq(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fdt_uclass_seq, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fdt_uclass_seq, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* More tests for sequence numbers */ static int dm_test_fdt_uclass_seq_manual(struct unit_test_state *uts) @@ -321,7 +321,7 @@ static int dm_test_fdt_uclass_seq_manual(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fdt_uclass_seq_manual, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fdt_uclass_seq_manual, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_fdt_uclass_seq_more(struct unit_test_state *uts) { @@ -360,7 +360,7 @@ static int dm_test_fdt_uclass_seq_more(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fdt_uclass_seq_more, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fdt_uclass_seq_more, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that we can find a device by device tree offset */ static int dm_test_fdt_offset(struct unit_test_state *uts) @@ -390,7 +390,7 @@ static int dm_test_fdt_offset(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_offset, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); /** * Test various error conditions with uclass_first_device(), @@ -455,7 +455,7 @@ static int dm_test_first_next_device_probeall(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_first_next_device_probeall, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test iteration through devices in a uclass */ static int dm_test_uclass_foreach(struct unit_test_state *uts) @@ -476,7 +476,7 @@ static int dm_test_uclass_foreach(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_foreach, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_uclass_foreach, UTF_SCAN_PDATA | UTF_SCAN_FDT); /** * check_devices() - Check return values and pointers @@ -556,7 +556,7 @@ static int dm_test_first_next_ok_device(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_first_next_ok_device, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_first_next_ok_device, UTF_SCAN_PDATA | UTF_SCAN_FDT); static const struct udevice_id fdt_dummy_ids[] = { { .compatible = "denx,u-boot-fdt-dummy", }, @@ -611,7 +611,7 @@ static int dm_test_fdt_translation(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fdt_translation, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fdt_translation, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_fdt_get_addr_ptr_flat(struct unit_test_state *uts) { @@ -632,7 +632,7 @@ static int dm_test_fdt_get_addr_ptr_flat(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_get_addr_ptr_flat, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); static int dm_test_fdt_remap_addr_flat(struct unit_test_state *uts) { @@ -652,7 +652,7 @@ static int dm_test_fdt_remap_addr_flat(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_remap_addr_flat, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); static int dm_test_fdt_remap_addr_index_flat(struct unit_test_state *uts) { @@ -674,7 +674,7 @@ static int dm_test_fdt_remap_addr_index_flat(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_remap_addr_index_flat, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); static int dm_test_fdt_remap_addr_name_flat(struct unit_test_state *uts) { @@ -696,7 +696,7 @@ static int dm_test_fdt_remap_addr_name_flat(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_remap_addr_name_flat, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT | UT_TESTF_FLAT_TREE); + UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_FLAT_TREE); static int dm_test_fdt_remap_addr_live(struct unit_test_state *uts) { @@ -716,7 +716,7 @@ static int dm_test_fdt_remap_addr_live(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_remap_addr_live, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_fdt_remap_addr_index_live(struct unit_test_state *uts) { @@ -738,7 +738,7 @@ static int dm_test_fdt_remap_addr_index_live(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_remap_addr_index_live, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_fdt_remap_addr_name_live(struct unit_test_state *uts) { @@ -760,7 +760,7 @@ static int dm_test_fdt_remap_addr_name_live(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_fdt_remap_addr_name_live, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_fdt_disable_enable_by_path(struct unit_test_state *uts) { @@ -787,8 +787,7 @@ static int dm_test_fdt_disable_enable_by_path(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fdt_disable_enable_by_path, UT_TESTF_SCAN_PDATA | - UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fdt_disable_enable_by_path, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test a few uclass phandle functions */ static int dm_test_fdt_phandle(struct unit_test_state *uts) @@ -810,7 +809,7 @@ static int dm_test_fdt_phandle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_fdt_phandle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_fdt_phandle, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test device_find_first_child_by_uclass() */ static int dm_test_first_child(struct unit_test_state *uts) @@ -837,7 +836,7 @@ static int dm_test_first_child(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_first_child, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_first_child, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test integer functions in dm_read_...() */ static int dm_test_read_int(struct unit_test_state *uts) @@ -901,7 +900,7 @@ static int dm_test_read_int(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_read_int, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_read_int, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_read_int_index(struct unit_test_state *uts) { @@ -930,7 +929,7 @@ static int dm_test_read_int_index(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_read_int_index, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_read_int_index, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_read_phandle(struct unit_test_state *uts) { @@ -995,7 +994,7 @@ static int dm_test_read_phandle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_read_phandle, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_read_phandle, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test iteration through devices by drvdata */ static int dm_test_uclass_drvdata(struct unit_test_state *uts) @@ -1016,7 +1015,7 @@ static int dm_test_uclass_drvdata(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_uclass_drvdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_uclass_drvdata, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test device_first_child_ofdata_err(), etc. */ static int dm_test_child_ofdata(struct unit_test_state *uts) @@ -1035,7 +1034,7 @@ static int dm_test_child_ofdata(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_child_ofdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_child_ofdata, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test device_first_child_err(), etc. */ static int dm_test_first_child_probe(struct unit_test_state *uts) @@ -1054,7 +1053,7 @@ static int dm_test_first_child_probe(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_first_child_probe, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_first_child_probe, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test that ofdata is read for parents before children */ static int dm_test_ofdata_order(struct unit_test_state *uts) @@ -1079,7 +1078,7 @@ static int dm_test_ofdata_order(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_ofdata_order, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_ofdata_order, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test dev_decode_display_timing() */ static int dm_test_decode_display_timing(struct unit_test_state *uts) @@ -1159,7 +1158,7 @@ static int dm_test_decode_display_timing(struct unit_test_state *uts) ut_assert(dev_decode_display_timing(dev, 3, &timing)); return 0; } -DM_TEST(dm_test_decode_display_timing, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_decode_display_timing, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test dev_decode_panel_timing() */ static int dm_test_decode_panel_timing(struct unit_test_state *uts) @@ -1194,7 +1193,7 @@ static int dm_test_decode_panel_timing(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_decode_panel_timing, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_decode_panel_timing, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test read_resourcee() */ static int dm_test_read_resource(struct unit_test_state *uts) @@ -1225,5 +1224,4 @@ static int dm_test_read_resource(struct unit_test_state *uts) return 0; } - -DM_TEST(dm_test_read_resource, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_read_resource, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/timer.c b/test/dm/timer.c index 7fcefc42e59..a32059d560d 100644 --- a/test/dm/timer.c +++ b/test/dm/timer.c @@ -23,7 +23,7 @@ static int dm_test_timer_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_timer_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_timer_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* * Test of timebase fallback @@ -46,4 +46,4 @@ static int dm_test_timer_timebase_fallback(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_timer_timebase_fallback, - UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); + UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/tpm.c b/test/dm/tpm.c index 0e413c0eedd..962a3fd1943 100644 --- a/test/dm/tpm.c +++ b/test/dm/tpm.c @@ -56,7 +56,7 @@ static int dm_test_tpm(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_tpm, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_tpm, UTF_SCAN_FDT); /* Test report_state */ static int dm_test_tpm_report_state(struct unit_test_state *uts) @@ -77,7 +77,7 @@ static int dm_test_tpm_report_state(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_tpm_report_state, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_tpm_report_state, UTF_SCAN_FDT); /** * test_tpm_autostart() - check the tpm_auto_start() call @@ -114,7 +114,7 @@ static int dm_test_tpm_autostart(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_tpm_autostart, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_tpm_autostart, UTF_SCAN_FDT); static int dm_test_tpm_autostart_reinit(struct unit_test_state *uts) { @@ -123,4 +123,4 @@ static int dm_test_tpm_autostart_reinit(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_tpm_autostart_reinit, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_tpm_autostart_reinit, UTF_SCAN_FDT); diff --git a/test/dm/usb.c b/test/dm/usb.c index 0bbea219ec9..fa894c1096e 100644 --- a/test/dm/usb.c +++ b/test/dm/usb.c @@ -33,7 +33,7 @@ static int dm_test_usb_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_usb_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_usb_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* * Test that we can use the flash stick. This is more of a functional test. It @@ -82,7 +82,7 @@ static int dm_test_usb_flash(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_usb_flash, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_usb_flash, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test that we can handle multiple storage devices */ static int dm_test_usb_multi(struct unit_test_state *uts) @@ -98,7 +98,7 @@ static int dm_test_usb_multi(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_usb_multi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_usb_multi, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* test that we have an associated ofnode with the usb device */ static int dm_test_usb_fdt_node(struct unit_test_state *uts) @@ -120,7 +120,7 @@ static int dm_test_usb_fdt_node(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_usb_fdt_node, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_usb_fdt_node, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int count_usb_devices(void) { @@ -164,7 +164,7 @@ static int dm_test_usb_stop(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_usb_stop, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_usb_stop, UTF_SCAN_PDATA | UTF_SCAN_FDT); /** * dm_test_usb_keyb() - test USB keyboard driver @@ -455,4 +455,4 @@ static int dm_test_usb_keyb(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_usb_keyb, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_usb_keyb, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/video.c b/test/dm/video.c index 7dfbeb9555d..e347c1403fd 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -42,7 +42,7 @@ static int dm_test_video_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /** * compress_frame_buffer() - Compress the frame buffer and return its size @@ -175,7 +175,7 @@ static int dm_test_video_text(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_text, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_text, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_video_text_12x22(struct unit_test_state *uts) { @@ -211,7 +211,7 @@ static int dm_test_video_text_12x22(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_text_12x22, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_text_12x22, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test handling of special characters in the console */ static int dm_test_video_chars(struct unit_test_state *uts) @@ -228,7 +228,7 @@ static int dm_test_video_chars(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_chars, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_chars, UTF_SCAN_PDATA | UTF_SCAN_FDT); #ifdef CONFIG_VIDEO_ANSI #define ANSI_ESC "\x1b" @@ -262,7 +262,7 @@ static int dm_test_video_ansi(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_ansi, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_ansi, UTF_SCAN_PDATA | UTF_SCAN_FDT); #endif /** @@ -320,7 +320,7 @@ static int dm_test_video_context(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_context, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_context, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test rotated text output through the console uclass */ static int dm_test_video_rotation1(struct unit_test_state *uts) @@ -329,7 +329,7 @@ static int dm_test_video_rotation1(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_rotation1, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_rotation1, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test rotated text output through the console uclass */ static int dm_test_video_rotation2(struct unit_test_state *uts) @@ -338,7 +338,7 @@ static int dm_test_video_rotation2(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_rotation2, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_rotation2, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test rotated text output through the console uclass */ static int dm_test_video_rotation3(struct unit_test_state *uts) @@ -347,7 +347,7 @@ static int dm_test_video_rotation3(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_rotation3, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_rotation3, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Read a file into memory and return a pointer to it */ static int read_file(struct unit_test_state *uts, const char *fname, @@ -385,7 +385,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_bmp, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_bmp, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a bitmap file on a 8bpp display */ static int dm_test_video_bmp8(struct unit_test_state *uts) @@ -404,7 +404,7 @@ static int dm_test_video_bmp8(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_bmp8, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a bitmap file on a 16bpp display */ static int dm_test_video_bmp16(struct unit_test_state *uts) @@ -427,7 +427,7 @@ static int dm_test_video_bmp16(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_bmp16, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_bmp16, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a 24bpp bitmap file on a 16bpp display */ static int dm_test_video_bmp24(struct unit_test_state *uts) @@ -450,7 +450,7 @@ static int dm_test_video_bmp24(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_bmp24, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_bmp24, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a 24bpp bitmap file on a 32bpp display */ static int dm_test_video_bmp24_32(struct unit_test_state *uts) @@ -473,7 +473,7 @@ static int dm_test_video_bmp24_32(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_bmp24_32, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_bmp24_32, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a bitmap file on a 32bpp display */ static int dm_test_video_bmp32(struct unit_test_state *uts) @@ -491,7 +491,7 @@ static int dm_test_video_bmp32(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_bmp32, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_bmp32, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a compressed bitmap file */ static int dm_test_video_bmp_comp(struct unit_test_state *uts) @@ -507,7 +507,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_bmp_comp, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_bmp_comp, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a bitmap file on a 32bpp display */ static int dm_test_video_comp_bmp32(struct unit_test_state *uts) @@ -526,7 +526,7 @@ static int dm_test_video_comp_bmp32(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_comp_bmp32, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_comp_bmp32, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test drawing a bitmap file on a 8bpp display */ static int dm_test_video_comp_bmp8(struct unit_test_state *uts) @@ -545,7 +545,7 @@ static int dm_test_video_comp_bmp8(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_comp_bmp8, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_comp_bmp8, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test TrueType console */ static int dm_test_video_truetype(struct unit_test_state *uts) @@ -560,7 +560,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_truetype, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_truetype, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test scrolling TrueType console */ static int dm_test_video_truetype_scroll(struct unit_test_state *uts) @@ -581,7 +581,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_truetype_scroll, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_truetype_scroll, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test TrueType backspace, within and across lines */ static int dm_test_video_truetype_bs(struct unit_test_state *uts) @@ -602,4 +602,4 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_video_truetype_bs, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_video_truetype_bs, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/virtio.c b/test/dm/virtio.c index 3efd7c74f42..2574c4da624 100644 --- a/test/dm/virtio.c +++ b/test/dm/virtio.c @@ -29,4 +29,4 @@ static int dm_test_virtio_missing_ops(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_virtio_missing_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_virtio_missing_ops, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/virtio_device.c b/test/dm/virtio_device.c index 63dc53415b7..53414e4d3a4 100644 --- a/test/dm/virtio_device.c +++ b/test/dm/virtio_device.c @@ -44,7 +44,7 @@ static int dm_test_virtio_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_virtio_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_virtio_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test all of the virtio uclass ops */ static int dm_test_virtio_all_ops(struct unit_test_state *uts) @@ -93,7 +93,7 @@ static int dm_test_virtio_all_ops(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_virtio_all_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_virtio_all_ops, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test removal of virtio device driver */ static int dm_test_virtio_remove(struct unit_test_state *uts) @@ -122,7 +122,7 @@ static int dm_test_virtio_remove(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_virtio_remove, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_virtio_remove, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Test all of the virtio ring */ static int dm_test_virtio_ring(struct unit_test_state *uts) @@ -194,4 +194,4 @@ static int dm_test_virtio_ring(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_virtio_ring, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_virtio_ring, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/virtio_rng.c b/test/dm/virtio_rng.c index ab7d862d79e..e404b08484e 100644 --- a/test/dm/virtio_rng.c +++ b/test/dm/virtio_rng.c @@ -48,4 +48,4 @@ static int dm_test_virtio_rng_check_len(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_virtio_rng_check_len, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_virtio_rng_check_len, UTF_SCAN_PDATA | UTF_SCAN_FDT); diff --git a/test/dm/wdt.c b/test/dm/wdt.c index 1df2da23c6c..541bcba1b53 100644 --- a/test/dm/wdt.c +++ b/test/dm/wdt.c @@ -43,7 +43,7 @@ static int dm_test_wdt_base(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_wdt_base, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_wdt_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); static int dm_test_wdt_gpio_toggle(struct unit_test_state *uts) { @@ -75,7 +75,7 @@ static int dm_test_wdt_gpio_toggle(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_wdt_gpio_toggle, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_wdt_gpio_toggle, UTF_SCAN_FDT); static int dm_test_wdt_gpio_level(struct unit_test_state *uts) { @@ -107,7 +107,7 @@ static int dm_test_wdt_gpio_level(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_wdt_gpio_level, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_wdt_gpio_level, UTF_SCAN_FDT); static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts) { @@ -159,4 +159,4 @@ static int dm_test_wdt_watchdog_reset(struct unit_test_state *uts) return 0; } -DM_TEST(dm_test_wdt_watchdog_reset, UT_TESTF_SCAN_FDT); +DM_TEST(dm_test_wdt_watchdog_reset, UTF_SCAN_FDT); diff --git a/test/env/cmd_ut_env.c b/test/env/cmd_ut_env.c index 238cf310367..4af05764fb8 100644 --- a/test/env/cmd_ut_env.c +++ b/test/env/cmd_ut_env.c @@ -34,7 +34,7 @@ static int env_test_env_cmd(struct unit_test_state *uts) return 0; } -ENV_TEST(env_test_env_cmd, UT_TESTF_CONSOLE_REC); +ENV_TEST(env_test_env_cmd, UTF_CONSOLE); int do_ut_env(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { diff --git a/test/env/hashtable.c b/test/env/hashtable.c index ccdf0138c4b..16e49358888 100644 --- a/test/env/hashtable.c +++ b/test/env/hashtable.c @@ -101,7 +101,6 @@ static int env_test_htab_fill(struct unit_test_state *uts) hdestroy_r(&htab); return 0; } - ENV_TEST(env_test_htab_fill, 0); /* Fill the hashtable up halfway an repeateadly delete/create elements @@ -122,5 +121,4 @@ static int env_test_htab_deletes(struct unit_test_state *uts) hdestroy_r(&htab); return 0; } - ENV_TEST(env_test_htab_deletes, 0); diff --git a/test/hush/dollar.c b/test/hush/dollar.c index 4caa07c192a..91b097017c2 100644 --- a/test/hush/dollar.c +++ b/test/hush/dollar.c @@ -14,7 +14,6 @@ DECLARE_GLOBAL_DATA_PTR; static int hush_test_simple_dollar(struct unit_test_state *uts) { - console_record_reset_enable(); ut_assertok(run_command("echo $dollar_foo", 0)); ut_assert_nextline_empty(); ut_assert_console_end(); @@ -121,12 +120,11 @@ static int hush_test_simple_dollar(struct unit_test_state *uts) return 0; } -HUSH_TEST(hush_test_simple_dollar, 0); +HUSH_TEST(hush_test_simple_dollar, UTF_CONSOLE); static int hush_test_env_dollar(struct unit_test_state *uts) { env_set("env_foo", "bar"); - console_record_reset_enable(); ut_assertok(run_command("echo $env_foo", 0)); ut_assert_nextline("bar"); @@ -154,12 +152,10 @@ static int hush_test_env_dollar(struct unit_test_state *uts) return 0; } -HUSH_TEST(hush_test_env_dollar, 0); +HUSH_TEST(hush_test_env_dollar, UTF_CONSOLE); static int hush_test_command_dollar(struct unit_test_state *uts) { - console_record_reset_enable(); - ut_assertok(run_command("dollar_bar=\"echo bar\"", 0)); ut_assertok(run_command("$dollar_bar", 0)); @@ -222,4 +218,4 @@ static int hush_test_command_dollar(struct unit_test_state *uts) return 0; } -HUSH_TEST(hush_test_command_dollar, 0); +HUSH_TEST(hush_test_command_dollar, UTF_CONSOLE); diff --git a/test/hush/loop.c b/test/hush/loop.c index d734abf136d..a9b6a8edf24 100644 --- a/test/hush/loop.c +++ b/test/hush/loop.c @@ -14,8 +14,6 @@ DECLARE_GLOBAL_DATA_PTR; static int hush_test_for(struct unit_test_state *uts) { - console_record_reset_enable(); - ut_assertok(run_command("for loop_i in foo bar quux quux; do echo $loop_i; done", 0)); ut_assert_nextline("foo"); ut_assert_nextline("bar"); @@ -32,12 +30,10 @@ static int hush_test_for(struct unit_test_state *uts) return 0; } -HUSH_TEST(hush_test_for, 0); +HUSH_TEST(hush_test_for, UTF_CONSOLE); static int hush_test_while(struct unit_test_state *uts) { - console_record_reset_enable(); - if (gd->flags & GD_FLG_HUSH_MODERN_PARSER) { /* * Hush 2021 always returns 0 from while loop... @@ -65,11 +61,10 @@ static int hush_test_while(struct unit_test_state *uts) return 0; } -HUSH_TEST(hush_test_while, 0); +HUSH_TEST(hush_test_while, UTF_CONSOLE); static int hush_test_until(struct unit_test_state *uts) { - console_record_reset_enable(); env_set("loop_bar", "bar"); /* @@ -87,4 +82,4 @@ static int hush_test_until(struct unit_test_state *uts) env_set("loop_bar", NULL); return 0; } -HUSH_TEST(hush_test_until, 0); +HUSH_TEST(hush_test_until, UTF_CONSOLE); diff --git a/test/lib/asn1.c b/test/lib/asn1.c index 4842b7058ac..f0c7819e408 100644 --- a/test/lib/asn1.c +++ b/test/lib/asn1.c @@ -135,7 +135,6 @@ static int lib_asn1_x509(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - LIB_TEST(lib_asn1_x509, 0); #endif /* CONFIG_X509_CERTIFICATE_PARSER */ @@ -324,7 +323,6 @@ static int lib_asn1_pkcs7(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - LIB_TEST(lib_asn1_pkcs7, 0); #endif /* CONFIG_PKCS7_MESSAGE_PARSER */ @@ -386,6 +384,5 @@ static int lib_asn1_pkey(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - LIB_TEST(lib_asn1_pkey, 0); #endif /* CONFIG_RSA_PUBLIC_KEY_PARSER */ diff --git a/test/lib/efi_device_path.c b/test/lib/efi_device_path.c index 290c8768fa4..5cc001e209e 100644 --- a/test/lib/efi_device_path.c +++ b/test/lib/efi_device_path.c @@ -45,5 +45,4 @@ static int lib_test_efi_dp_check_length(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_test_efi_dp_check_length, 0); diff --git a/test/lib/efi_image_region.c b/test/lib/efi_image_region.c index 3ca49dc4a2e..2102539ea70 100644 --- a/test/lib/efi_image_region.c +++ b/test/lib/efi_image_region.c @@ -65,7 +65,6 @@ static int lib_test_efi_image_region_add(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_test_efi_image_region_add, 0); static int lib_test_efi_image_region_sort(struct unit_test_state *uts) @@ -158,5 +157,4 @@ static int lib_test_efi_image_region_sort(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_test_efi_image_region_sort, 0); diff --git a/test/lib/hexdump.c b/test/lib/hexdump.c index d531a830398..7b4592d175f 100644 --- a/test/lib/hexdump.c +++ b/test/lib/hexdump.c @@ -31,7 +31,6 @@ static int lib_test_hex_to_bin(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_test_hex_to_bin, 0); static int lib_test_hex2bin(struct unit_test_state *uts) @@ -61,7 +60,6 @@ static int lib_test_hex2bin(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_test_hex2bin, 0); static int lib_test_bin2hex(struct unit_test_state *uts) @@ -91,5 +89,4 @@ static int lib_test_bin2hex(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_test_bin2hex, 0); diff --git a/test/lib/lmb.c b/test/lib/lmb.c index 4b5b6e5e209..3c66138f732 100644 --- a/test/lib/lmb.c +++ b/test/lib/lmb.c @@ -360,7 +360,6 @@ static int lib_test_lmb_noreserved(struct unit_test_state *uts) /* simulate 512 MiB RAM beginning at 1.5GiB */ return test_noreserved(uts, 0xE0000000, 4, 1); } - LIB_TEST(lib_test_lmb_noreserved, 0); static int lib_test_lmb_unaligned_size(struct unit_test_state *uts) diff --git a/test/lib/rsa.c b/test/lib/rsa.c index 40f70010c78..129d03ab7dd 100644 --- a/test/lib/rsa.c +++ b/test/lib/rsa.c @@ -158,7 +158,6 @@ static int lib_rsa_verify_valid(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - LIB_TEST(lib_rsa_verify_valid, 0); /** @@ -200,6 +199,5 @@ static int lib_rsa_verify_invalid(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - LIB_TEST(lib_rsa_verify_invalid, 0); #endif /* RSA_VERIFY_WITH_PKEY */ diff --git a/test/lib/sscanf.c b/test/lib/sscanf.c index 9fe5521749f..3a2ec8ffa5f 100644 --- a/test/lib/sscanf.c +++ b/test/lib/sscanf.c @@ -169,5 +169,4 @@ static int lib_sscanf(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_sscanf, 0); diff --git a/test/lib/string.c b/test/lib/string.c index d08dbca9291..8d22f3fd68f 100644 --- a/test/lib/string.c +++ b/test/lib/string.c @@ -93,7 +93,6 @@ static int lib_memset(struct unit_test_state *uts) } return 0; } - LIB_TEST(lib_memset, 0); /** @@ -157,7 +156,6 @@ static int lib_memcpy(struct unit_test_state *uts) } return 0; } - LIB_TEST(lib_memcpy, 0); /** @@ -192,7 +190,6 @@ static int lib_memmove(struct unit_test_state *uts) } return 0; } - LIB_TEST(lib_memmove, 0); /** lib_memdup() - unit test for memdup() */ diff --git a/test/lib/test_aes.c b/test/lib/test_aes.c index cfd9d8ca5a9..6d9068c4f79 100644 --- a/test/lib/test_aes.c +++ b/test/lib/test_aes.c @@ -163,5 +163,4 @@ static int lib_test_aes(struct unit_test_state *uts) return ret; } - LIB_TEST(lib_test_aes, 0); diff --git a/test/lib/test_crc8.c b/test/lib/test_crc8.c index 0dac97bc5bf..52be2dc06c4 100644 --- a/test/lib/test_crc8.c +++ b/test/lib/test_crc8.c @@ -25,5 +25,4 @@ static int lib_crc8(struct unit_test_state *uts) { return 0; } - LIB_TEST(lib_crc8, 0); diff --git a/test/lib/test_crypt.c b/test/lib/test_crypt.c index dcdadd992c1..b6dd5f07b86 100644 --- a/test/lib/test_crypt.c +++ b/test/lib/test_crypt.c @@ -59,5 +59,4 @@ static int lib_crypt(struct unit_test_state *uts) return CMD_RET_SUCCESS; } - LIB_TEST(lib_crypt, 0); diff --git a/test/lib/test_errno_str.c b/test/lib/test_errno_str.c index 67f76442b27..967ecfd56f1 100644 --- a/test/lib/test_errno_str.c +++ b/test/lib/test_errno_str.c @@ -41,5 +41,4 @@ static int lib_errno_str(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_errno_str, 0); diff --git a/test/lib/test_print.c b/test/lib/test_print.c index c7fc50a1de1..cd7f3f85769 100644 --- a/test/lib/test_print.c +++ b/test/lib/test_print.c @@ -17,13 +17,10 @@ DECLARE_GLOBAL_DATA_PTR; static int test_print_freq(struct unit_test_state *uts, uint64_t freq, char *expected) { - ut_silence_console(uts); - console_record_reset_enable(); print_freq(freq, ";\n"); - ut_unsilence_console(uts); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str(expected, uts->actual_str); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -41,19 +38,15 @@ static int lib_test_print_freq(struct unit_test_state *uts) ut_assertok(test_print_freq(uts, 54321987654321, "54321.99 GHz;")); return 0; } - -LIB_TEST(lib_test_print_freq, 0); +LIB_TEST(lib_test_print_freq, UTF_CONSOLE); static int test_print_size(struct unit_test_state *uts, uint64_t freq, char *expected) { - ut_silence_console(uts); - console_record_reset_enable(); print_size(freq, ";\n"); - ut_unsilence_console(uts); console_record_readline(uts->actual_str, sizeof(uts->actual_str)); ut_asserteq_str(expected, uts->actual_str); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } @@ -74,5 +67,4 @@ static int lib_test_print_size(struct unit_test_state *uts) ut_assertok(test_print_size(uts, 54321987654321, "49.4 TiB;")); return 0; } - -LIB_TEST(lib_test_print_size, 0); +LIB_TEST(lib_test_print_size, UTF_CONSOLE); diff --git a/test/lib/uuid.c b/test/lib/uuid.c index 0914f2c47e7..8fe65dbf78b 100644 --- a/test/lib/uuid.c +++ b/test/lib/uuid.c @@ -36,5 +36,4 @@ static int lib_test_uuid_to_le(struct unit_test_state *uts) return 0; } - LIB_TEST(lib_test_uuid_to_le, 0); diff --git a/test/log/cont_test.c b/test/log/cont_test.c index 036d44b9d73..32b1c792367 100644 --- a/test/log/cont_test.c +++ b/test/log/cont_test.c @@ -25,7 +25,6 @@ static int log_test_cont(struct unit_test_state *uts) /* Write two messages, the second continuing the first */ gd->log_fmt = (1 << LOGF_CAT) | (1 << LOGF_LEVEL) | (1 << LOGF_MSG); gd->default_log_level = LOGL_INFO; - console_record_reset_enable(); log(LOGC_ARCH, LOGL_ERR, "ea%d\n", 1); log(LOGC_CONT, LOGL_CONT, "cc%d\n", 2); gd->default_log_level = log_level; @@ -33,7 +32,7 @@ static int log_test_cont(struct unit_test_state *uts) gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "ERR.arch, ea1")); ut_assertok(ut_check_console_line(uts, "ERR.arch, cc2")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Write a third message which is not a continuation */ gd->log_fmt = (1 << LOGF_CAT) | (1 << LOGF_LEVEL) | (1 << LOGF_MSG); @@ -44,7 +43,7 @@ static int log_test_cont(struct unit_test_state *uts) gd->log_fmt = log_fmt; gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "INFO.efi, ie3")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); /* Write two messages without a newline between them */ gd->log_fmt = (1 << LOGF_CAT) | (1 << LOGF_LEVEL) | (1 << LOGF_MSG); @@ -56,7 +55,7 @@ static int log_test_cont(struct unit_test_state *uts) gd->log_fmt = log_fmt; gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "ERR.arch, ea1 cc2")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } diff --git a/test/log/log_filter.c b/test/log/log_filter.c index 9cc891dc48c..d36e9d9714e 100644 --- a/test/log/log_filter.c +++ b/test/log/log_filter.c @@ -24,7 +24,7 @@ static int log_test_filter_invalid(struct unit_test_state *uts) return 0; } -LOG_TEST_FLAGS(log_test_filter_invalid, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_filter_invalid, UTF_CONSOLE); /* Test adding and removing filters */ static int log_test_filter(struct unit_test_state *uts) @@ -38,7 +38,6 @@ static int log_test_filter(struct unit_test_state *uts) ulong filt1, filt2; #define create_filter(args, filter_num) do {\ - ut_assertok(console_record_reset_enable()); \ ut_assertok(run_command("log filter-add -p " args, 0)); \ ut_assert_skipline(); \ ut_assertok(strict_strtoul(uts->actual_str, 10, &(filter_num))); \ @@ -72,7 +71,6 @@ static int log_test_filter(struct unit_test_state *uts) ut_asserteq(true, filt2_found); #define remove_filter(filter_num) do { \ - ut_assertok(console_record_reset_enable()); \ snprintf(cmd, sizeof(cmd), "log filter-remove %lu", filter_num); \ ut_assertok(run_command(cmd, 0)); \ ut_assert_console_end(); \ @@ -95,7 +93,6 @@ static int log_test_filter(struct unit_test_state *uts) create_filter("", filt1); create_filter("", filt2); - ut_assertok(console_record_reset_enable()); ut_assertok(run_command("log filter-remove -a", 0)); ut_assert_console_end(); @@ -105,4 +102,4 @@ static int log_test_filter(struct unit_test_state *uts) return 0; } -LOG_TEST_FLAGS(log_test_filter, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_filter, UTF_CONSOLE); diff --git a/test/log/log_test.c b/test/log/log_test.c index 18f8a2d9391..1c89df4ef18 100644 --- a/test/log/log_test.c +++ b/test/log/log_test.c @@ -110,18 +110,16 @@ int log_test_cat_allow(struct unit_test_state *uts) filt = log_add_filter("console", cat_list, LOGL_MAX, NULL); ut_assert(filt >= 0); - ut_assertok(console_record_reset_enable()); log_run_cat(UCLASS_MMC); check_log_entries_extra(); - ut_assertok(console_record_reset_enable()); log_run_cat(UCLASS_SPI); check_log_entries_extra(); ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_cat_allow, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_cat_allow, UTF_CONSOLE); /* Check a category filter that should block log entries */ int log_test_cat_deny_implicit(struct unit_test_state *uts) @@ -134,14 +132,13 @@ int log_test_cat_deny_implicit(struct unit_test_state *uts) filt = log_add_filter("console", cat_list, LOGL_MAX, NULL); ut_assert(filt >= 0); - ut_assertok(console_record_reset_enable()); log_run_cat(UCLASS_SPI); check_log_entries_none(); ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_cat_deny_implicit, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_cat_deny_implicit, UTF_CONSOLE); /* Check passing and failing file filters */ int log_test_file(struct unit_test_state *uts) @@ -151,18 +148,16 @@ int log_test_file(struct unit_test_state *uts) filt = log_add_filter("console", NULL, LOGL_MAX, "file"); ut_assert(filt >= 0); - ut_assertok(console_record_reset_enable()); log_run_file("file"); check_log_entries_flags(EXPECT_DIRECT | EXPECT_EXTRA | EXPECT_FORCE); - ut_assertok(console_record_reset_enable()); log_run_file("file2"); check_log_entries_none(); ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_file, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_file, UTF_CONSOLE); /* Check a passing file filter (second in list) */ int log_test_file_second(struct unit_test_state *uts) @@ -172,14 +167,13 @@ int log_test_file_second(struct unit_test_state *uts) filt = log_add_filter("console", NULL, LOGL_MAX, "file,file2"); ut_assert(filt >= 0); - ut_assertok(console_record_reset_enable()); log_run_file("file2"); check_log_entries_flags(EXPECT_DIRECT | EXPECT_EXTRA | EXPECT_FORCE); ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_file_second, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_file_second, UTF_CONSOLE); /* Check a passing file filter (middle of list) */ int log_test_file_mid(struct unit_test_state *uts) @@ -190,14 +184,13 @@ int log_test_file_mid(struct unit_test_state *uts) "file,file2,log/log_test.c"); ut_assert(filt >= 0); - ut_assertok(console_record_reset_enable()); log_run_file("file2"); check_log_entries_extra(); ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_file_mid, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_file_mid, UTF_CONSOLE); /* Check a log level filter */ int log_test_level(struct unit_test_state *uts) @@ -207,7 +200,6 @@ int log_test_level(struct unit_test_state *uts) filt = log_add_filter("console", NULL, LOGL_WARNING, NULL); ut_assert(filt >= 0); - ut_assertok(console_record_reset_enable()); log_run(); check_log_entries_flags_levels(EXPECT_LOG | EXPECT_DIRECT | EXPECT_FORCE, LOGL_FIRST, LOGL_WARNING); @@ -215,7 +207,7 @@ int log_test_level(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt)); return 0; } -LOG_TEST_FLAGS(log_test_level, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_level, UTF_CONSOLE); /* Check two filters, one of which passes everything */ int log_test_double(struct unit_test_state *uts) @@ -227,7 +219,6 @@ int log_test_double(struct unit_test_state *uts) filt2 = log_add_filter("console", NULL, LOGL_MAX, NULL); ut_assert(filt2 >= 0); - ut_assertok(console_record_reset_enable()); log_run(); check_log_entries_extra(); @@ -235,7 +226,7 @@ int log_test_double(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt2)); return 0; } -LOG_TEST_FLAGS(log_test_double, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_double, UTF_CONSOLE); /* Check three filters, which together pass everything */ int log_test_triple(struct unit_test_state *uts) @@ -249,7 +240,6 @@ int log_test_triple(struct unit_test_state *uts) filt3 = log_add_filter("console", NULL, LOGL_MAX, "log/log_test.c"); ut_assert(filt3 >= 0); - ut_assertok(console_record_reset_enable()); log_run_file("file2"); check_log_entries_extra(); @@ -258,13 +248,12 @@ int log_test_triple(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt3)); return 0; } -LOG_TEST_FLAGS(log_test_triple, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_triple, UTF_CONSOLE); int do_log_test_helpers(struct unit_test_state *uts) { int i; - ut_assertok(console_record_reset_enable()); log_err("level %d\n", LOGL_EMERG); log_err("level %d\n", LOGL_ALERT); log_err("level %d\n", LOGL_CRIT); @@ -292,11 +281,10 @@ int log_test_helpers(struct unit_test_state *uts) gd->log_fmt = log_get_default_format(); return ret; } -LOG_TEST_FLAGS(log_test_helpers, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_helpers, UTF_CONSOLE); int do_log_test_disable(struct unit_test_state *uts) { - ut_assertok(console_record_reset_enable()); log_err("default\n"); ut_assert_nextline("%*s() default", CONFIG_LOGF_FUNC_PAD, __func__); @@ -319,7 +307,7 @@ int log_test_disable(struct unit_test_state *uts) gd->log_fmt = log_get_default_format(); return ret; } -LOG_TEST_FLAGS(log_test_disable, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_disable, UTF_CONSOLE); /* Check denying based on category */ int log_test_cat_deny(struct unit_test_state *uts) @@ -335,7 +323,6 @@ int log_test_cat_deny(struct unit_test_state *uts) LOGFF_DENY); ut_assert(filt2 >= 0); - ut_assertok(console_record_reset_enable()); log_run_cat(UCLASS_SPI); check_log_entries_none(); @@ -343,7 +330,7 @@ int log_test_cat_deny(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt2)); return 0; } -LOG_TEST_FLAGS(log_test_cat_deny, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_cat_deny, UTF_CONSOLE); /* Check denying based on file */ int log_test_file_deny(struct unit_test_state *uts) @@ -356,7 +343,6 @@ int log_test_file_deny(struct unit_test_state *uts) LOGFF_DENY); ut_assert(filt2 >= 0); - ut_assertok(console_record_reset_enable()); log_run_file("file"); check_log_entries_none(); @@ -364,7 +350,7 @@ int log_test_file_deny(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt2)); return 0; } -LOG_TEST_FLAGS(log_test_file_deny, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_file_deny, UTF_CONSOLE); /* Check denying based on level */ int log_test_level_deny(struct unit_test_state *uts) @@ -377,7 +363,6 @@ int log_test_level_deny(struct unit_test_state *uts) LOGFF_DENY); ut_assert(filt2 >= 0); - ut_assertok(console_record_reset_enable()); log_run(); check_log_entries_flags_levels( EXPECT_LOG | EXPECT_DIRECT | EXPECT_FORCE, @@ -387,7 +372,7 @@ int log_test_level_deny(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt2)); return 0; } -LOG_TEST_FLAGS(log_test_level_deny, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_level_deny, UTF_CONSOLE); /* Check matching based on minimum level */ int log_test_min(struct unit_test_state *uts) @@ -401,7 +386,6 @@ int log_test_min(struct unit_test_state *uts) LOGFF_DENY | LOGFF_LEVEL_MIN); ut_assert(filt2 >= 0); - ut_assertok(console_record_reset_enable()); log_run(); check_log_entries_flags_levels(EXPECT_LOG | EXPECT_DIRECT | EXPECT_FORCE, LOGL_WARNING, LOGL_INFO - 1); @@ -410,7 +394,7 @@ int log_test_min(struct unit_test_state *uts) ut_assertok(log_remove_filter("console", filt2)); return 0; } -LOG_TEST_FLAGS(log_test_min, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_min, UTF_CONSOLE); /* Check dropped traces */ int log_test_dropped(struct unit_test_state *uts) @@ -419,8 +403,6 @@ int log_test_dropped(struct unit_test_state *uts) gd->flags &= ~(GD_FLG_LOG_READY); gd->log_drop_count = 0; - ut_assertok(console_record_reset_enable()); - log_run(); ut_asserteq(2 * (LOGL_COUNT - LOGL_FIRST) + _LOG_MAX_LEVEL - LOGL_FIRST + 1, @@ -432,7 +414,7 @@ int log_test_dropped(struct unit_test_state *uts) return 0; } -LOG_TEST_FLAGS(log_test_dropped, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_dropped, UTF_CONSOLE); /* Check log_buffer() */ int log_test_buffer(struct unit_test_state *uts) @@ -446,7 +428,6 @@ int log_test_buffer(struct unit_test_state *uts) for (i = 0; i < 0x11; i++) buf[i] = i * 0x11; - ut_assertok(console_record_reset_enable()); log_buffer(LOGC_BOOT, LOGL_INFO, 0, buf, 1, 0x12, 0); /* This one should product no output due to the debug level */ @@ -461,4 +442,4 @@ int log_test_buffer(struct unit_test_state *uts) return 0; } -LOG_TEST_FLAGS(log_test_buffer, UT_TESTF_CONSOLE_REC); +LOG_TEST_FLAGS(log_test_buffer, UTF_CONSOLE); diff --git a/test/log/nolog_ndebug.c b/test/log/nolog_ndebug.c index b714a16d2e7..4dc0f2d3a33 100644 --- a/test/log/nolog_ndebug.c +++ b/test/log/nolog_ndebug.c @@ -21,7 +21,6 @@ static int log_test_log_disabled_ndebug(struct unit_test_state *uts) int i; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); /* Output a log record at every level */ for (i = LOGL_EMERG; i < LOGL_COUNT; i++) @@ -31,7 +30,7 @@ static int log_test_log_disabled_ndebug(struct unit_test_state *uts) /* Since DEBUG is not defined, we expect to not get debug output */ for (i = LOGL_EMERG; i < LOGL_DEBUG; i++) ut_assertok(ut_check_console_line(uts, "testing level %d", i)); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } diff --git a/test/log/nolog_test.c b/test/log/nolog_test.c index c4c0fa6cf81..341dbfc9310 100644 --- a/test/log/nolog_test.c +++ b/test/log/nolog_test.c @@ -25,11 +25,10 @@ static int log_test_nolog_err(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); log_err("testing %s\n", "log_err"); gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "testing log_err")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(log_test_nolog_err); @@ -39,11 +38,10 @@ static int log_test_nolog_warning(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); log_warning("testing %s\n", "log_warning"); gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "testing log_warning")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(log_test_nolog_warning); @@ -53,11 +51,10 @@ static int log_test_nolog_notice(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); log_notice("testing %s\n", "log_notice"); gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "testing log_notice")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(log_test_nolog_notice); @@ -67,11 +64,10 @@ static int log_test_nolog_info(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); log_err("testing %s\n", "log_info"); gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "testing log_info")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(log_test_nolog_info); @@ -83,10 +79,9 @@ static int nolog_test_nodebug(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); debug("testing %s\n", "debug"); gd->flags &= ~GD_FLG_RECORD; - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(nolog_test_nodebug); @@ -96,11 +91,10 @@ static int log_test_nolog_nodebug(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); log_debug("testing %s\n", "log_debug"); gd->flags &= ~GD_FLG_RECORD; ut_assert(!strcmp(buf, "")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(log_test_nolog_nodebug); @@ -112,11 +106,10 @@ static int nolog_test_debug(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); debug("testing %s\n", "debug"); gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "testing debug")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(nolog_test_debug); @@ -126,13 +119,12 @@ static int log_test_nolog_debug(struct unit_test_state *uts) char buf[BUFFSIZE]; memset(buf, 0, BUFFSIZE); - console_record_reset_enable(); log_debug("testing %s\n", "log_debug"); log(LOGC_NONE, LOGL_DEBUG, "more %s\n", "log_debug"); gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "testing log_debug")); ut_assertok(ut_check_console_line(uts, "more log_debug")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } LOG_TEST(log_test_nolog_debug); diff --git a/test/log/pr_cont_test.c b/test/log/pr_cont_test.c index 30f30d98fe1..7734e927f98 100644 --- a/test/log/pr_cont_test.c +++ b/test/log/pr_cont_test.c @@ -28,14 +28,13 @@ static int log_test_pr_cont(struct unit_test_state *uts) /* Write two messages, the second continuing the first */ gd->log_fmt = BIT(LOGF_MSG); gd->default_log_level = LOGL_INFO; - console_record_reset_enable(); pr_err("ea%d ", 1); pr_cont("cc%d\n", 2); gd->default_log_level = log_level; gd->log_fmt = log_fmt; gd->flags &= ~GD_FLG_RECORD; ut_assertok(ut_check_console_line(uts, "ea1 cc2")); - ut_assertok(ut_check_console_end(uts)); + ut_assert_console_end(); return 0; } diff --git a/test/print_ut.c b/test/print_ut.c index 53d3354ea69..f5e607b21a3 100644 --- a/test/print_ut.c +++ b/test/print_ut.c @@ -180,14 +180,12 @@ static int print_display_buffer(struct unit_test_state *uts) buf[i] = i * 0x11; /* bytes */ - console_record_reset(); print_buffer(0, buf, 1, 0x12, 0); ut_assert_nextline("00000000: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ..\"3DUfw........"); ut_assert_nextline("00000010: 10 00 .."); ut_assert_console_end(); /* line length */ - console_record_reset(); print_buffer(0, buf, 1, 0x12, 8); ut_assert_nextline("00000000: 00 11 22 33 44 55 66 77 ..\"3DUfw"); ut_assert_nextline("00000008: 88 99 aa bb cc dd ee ff ........"); @@ -195,7 +193,6 @@ static int print_display_buffer(struct unit_test_state *uts) ut_assert_console_end(); /* long line */ - console_record_reset(); buf[0x41] = 0x41; print_buffer(0, buf, 1, 0x42, 0x40); ut_assert_nextline("00000000: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..\"3DUfw........................................................"); @@ -203,35 +200,30 @@ static int print_display_buffer(struct unit_test_state *uts) ut_assert_console_end(); /* address */ - console_record_reset(); print_buffer(0x12345678, buf, 1, 0x12, 0); ut_assert_nextline("12345678: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ..\"3DUfw........"); ut_assert_nextline("12345688: 10 00 .."); ut_assert_console_end(); /* 16-bit */ - console_record_reset(); print_buffer(0, buf, 2, 9, 0); ut_assert_nextline("00000000: 1100 3322 5544 7766 9988 bbaa ddcc ffee ..\"3DUfw........"); ut_assert_nextline("00000010: 0010 .."); ut_assert_console_end(); /* 32-bit */ - console_record_reset(); print_buffer(0, buf, 4, 5, 0); ut_assert_nextline("00000000: 33221100 77665544 bbaa9988 ffeeddcc ..\"3DUfw........"); ut_assert_nextline("00000010: 00000010 ...."); ut_assert_console_end(); /* 64-bit */ - console_record_reset(); print_buffer(0, buf, 8, 3, 0); ut_assert_nextline("00000000: 7766554433221100 ffeeddccbbaa9988 ..\"3DUfw........"); ut_assert_nextline("00000010: 0000000000000010 ........"); ut_assert_console_end(); /* ASCII */ - console_record_reset(); buf[1] = 31; buf[2] = 32; buf[3] = 33; @@ -246,7 +238,7 @@ static int print_display_buffer(struct unit_test_state *uts) return 0; } -PRINT_TEST(print_display_buffer, UT_TESTF_CONSOLE_REC); +PRINT_TEST(print_display_buffer, UTF_CONSOLE); static int print_hexdump_line(struct unit_test_state *uts) { @@ -272,7 +264,7 @@ static int print_hexdump_line(struct unit_test_state *uts) return 0; } -PRINT_TEST(print_hexdump_line, UT_TESTF_CONSOLE_REC); +PRINT_TEST(print_hexdump_line, UTF_CONSOLE); static int print_do_hex_dump(struct unit_test_state *uts) { @@ -289,7 +281,6 @@ static int print_do_hex_dump(struct unit_test_state *uts) buf[i] = i * 0x11; /* bytes */ - console_record_reset(); print_hex_dump_bytes("", DUMP_PREFIX_ADDRESS, buf, 0x12); ut_assert_nextline("%0*lx: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ..\"3DUfw........", IS_ENABLED(CONFIG_PHYS_64BIT) ? 16 : 8, 0x0UL); @@ -298,7 +289,6 @@ static int print_do_hex_dump(struct unit_test_state *uts) ut_assert_console_end(); /* line length */ - console_record_reset(); print_hex_dump("", DUMP_PREFIX_ADDRESS, 8, 1, buf, 0x12, true); ut_assert_nextline("%0*lx: 00 11 22 33 44 55 66 77 ..\"3DUfw", IS_ENABLED(CONFIG_PHYS_64BIT) ? 16 : 8, 0x0UL); @@ -310,7 +300,6 @@ static int print_do_hex_dump(struct unit_test_state *uts) unmap_sysmem(buf); /* long line */ - console_record_reset(); buf[0x41] = 0x41; print_hex_dump("", DUMP_PREFIX_ADDRESS, 0x40, 1, buf, 0x42, true); ut_assert_nextline("%0*lx: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..\"3DUfw........................................................", @@ -320,7 +309,6 @@ static int print_do_hex_dump(struct unit_test_state *uts) ut_assert_console_end(); /* 16-bit */ - console_record_reset(); print_hex_dump("", DUMP_PREFIX_ADDRESS, 0, 2, buf, 0x12, true); ut_assert_nextline("%0*lx: 1100 3322 5544 7766 9988 bbaa ddcc ffee ..\"3DUfw........", IS_ENABLED(CONFIG_PHYS_64BIT) ? 16 : 8, 0x0UL); @@ -330,7 +318,6 @@ static int print_do_hex_dump(struct unit_test_state *uts) unmap_sysmem(buf); /* 32-bit */ - console_record_reset(); print_hex_dump("", DUMP_PREFIX_ADDRESS, 0, 4, buf, 0x14, true); ut_assert_nextline("%0*lx: 33221100 77665544 bbaa9988 ffeeddcc ..\"3DUfw........", IS_ENABLED(CONFIG_PHYS_64BIT) ? 16 : 8, 0x0UL); @@ -340,7 +327,6 @@ static int print_do_hex_dump(struct unit_test_state *uts) unmap_sysmem(buf); /* 64-bit */ - console_record_reset(); print_hex_dump("", DUMP_PREFIX_ADDRESS, 16, 8, buf, 0x18, true); ut_assert_nextline("%0*lx: 7766554433221100 ffeeddccbbaa9988 ..\"3DUfw........", IS_ENABLED(CONFIG_PHYS_64BIT) ? 16 : 8, 0x0UL); @@ -350,7 +336,6 @@ static int print_do_hex_dump(struct unit_test_state *uts) unmap_sysmem(buf); /* ASCII */ - console_record_reset(); buf[1] = 31; buf[2] = 32; buf[3] = 33; @@ -365,7 +350,7 @@ static int print_do_hex_dump(struct unit_test_state *uts) return 0; } -PRINT_TEST(print_do_hex_dump, UT_TESTF_CONSOLE_REC); +PRINT_TEST(print_do_hex_dump, UTF_CONSOLE); static int snprint(struct unit_test_state *uts) { diff --git a/test/test-main.c b/test/test-main.c index 3fa6f6e32ec..63e8be0ccd1 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -181,7 +181,7 @@ static bool ut_test_run_on_flattree(struct unit_test *test) { const char *fname = strrchr(test->file, '/') + 1; - if (!(test->flags & UT_TESTF_DM)) + if (!(test->flags & UTF_DM)) return false; return !strstr(fname, "video") || strstr(test->name, "video_base"); @@ -240,14 +240,14 @@ static bool test_matches(const char *prefix, const char *test_name, * * @tests: List of tests to run * @count: Number of tests to ru - * Return: true if any of the tests have the UT_TESTF_DM flag + * Return: true if any of the tests have the UTF_DM flag */ static bool ut_list_has_dm_tests(struct unit_test *tests, int count) { struct unit_test *test; for (test = tests; test < tests + count; test++) { - if (test->flags & UT_TESTF_DM) + if (test->flags & UTF_DM) return true; } @@ -289,26 +289,26 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) { ut_assertok(event_init()); - if (test->flags & UT_TESTF_DM) + if (test->flags & UTF_DM) ut_assertok(dm_test_pre_run(uts)); ut_set_skip_delays(uts, false); uts->start = mallinfo(); - if (test->flags & UT_TESTF_SCAN_PDATA) + if (test->flags & UTF_SCAN_PDATA) ut_assertok(dm_scan_plat(false)); - if (test->flags & UT_TESTF_PROBE_TEST) + if (test->flags & UTF_PROBE_TEST) ut_assertok(do_autoprobe(uts)); if (CONFIG_IS_ENABLED(OF_REAL) && - (test->flags & UT_TESTF_SCAN_FDT)) { + (test->flags & UTF_SCAN_FDT)) { /* * only set this if we know the ethernet uclass will be created */ - eth_set_enable_bootdevs(test->flags & UT_TESTF_ETH_BOOTDEV); - test_sf_set_enable_bootdevs(test->flags & UT_TESTF_SF_BOOTDEV); + eth_set_enable_bootdevs(test->flags & UTF_ETH_BOOTDEV); + test_sf_set_enable_bootdevs(test->flags & UTF_SF_BOOTDEV); ut_assertok(dm_extended_scan(false)); } @@ -316,10 +316,10 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) * Do this after FDT scan since dm_scan_other() in bootstd-uclass.c * checks for the existence of bootstd */ - if (test->flags & UT_TESTF_SCAN_PDATA) + if (test->flags & UTF_SCAN_PDATA) ut_assertok(dm_scan_other(false)); - if (IS_ENABLED(CONFIG_SANDBOX) && (test->flags & UT_TESTF_OTHER_FDT)) { + if (IS_ENABLED(CONFIG_SANDBOX) && (test->flags & UTF_OTHER_FDT)) { /* make sure the other FDT is available */ ut_assertok(test_load_other_fdt(uts)); @@ -333,7 +333,7 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) } } - if (test->flags & UT_TESTF_CONSOLE_REC) { + if (test->flags & UTF_CONSOLE) { int ret = console_record_reset_enable(); if (ret) { @@ -356,7 +356,7 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) static int test_post_run(struct unit_test_state *uts, struct unit_test *test) { ut_unsilence_console(uts); - if (test->flags & UT_TESTF_DM) + if (test->flags & UTF_DM) ut_assertok(dm_test_post_run(uts)); ut_assertok(cyclic_unregister_all()); ut_assertok(event_uninit()); @@ -403,7 +403,7 @@ static int ut_run_test(struct unit_test_state *uts, struct unit_test *test, const char *note = ""; int ret; - if ((test->flags & UT_TESTF_DM) && !uts->of_live) + if ((test->flags & UTF_DM) && !uts->of_live) note = " (flat tree)"; printf("Test: %s: %s%s\n", test_name, fname, note); @@ -450,13 +450,13 @@ static int ut_run_test_live_flat(struct unit_test_state *uts, { int runs; - if ((test->flags & UT_TESTF_OTHER_FDT) && !IS_ENABLED(CONFIG_SANDBOX)) + if ((test->flags & UTF_OTHER_FDT) && !IS_ENABLED(CONFIG_SANDBOX)) return skip_test(uts); /* Run with the live tree if possible */ runs = 0; if (CONFIG_IS_ENABLED(OF_LIVE)) { - if (!(test->flags & UT_TESTF_FLAT_TREE)) { + if (!(test->flags & UTF_FLAT_TREE)) { uts->of_live = true; ut_assertok(ut_run_test(uts, test, test->name)); runs++; @@ -476,10 +476,10 @@ static int ut_run_test_live_flat(struct unit_test_state *uts, * boards) */ if ((!CONFIG_IS_ENABLED(OF_LIVE) || - (test->flags & UT_TESTF_SCAN_FDT)) && - !(test->flags & UT_TESTF_LIVE_TREE) && + (test->flags & UTF_SCAN_FDT)) && + !(test->flags & UTF_LIVE_TREE) && (CONFIG_IS_ENABLED(OFNODE_MULTI_TREE) || - !(test->flags & UT_TESTF_OTHER_FDT)) && + !(test->flags & UTF_OTHER_FDT)) && (!runs || ut_test_run_on_flattree(test)) && !(gd->flags & GD_FLG_FDT_CHANGED)) { uts->of_live = false; @@ -540,7 +540,7 @@ static int ut_run_tests(struct unit_test_state *uts, const char *prefix, if (!test_matches(prefix, test_name, select_name)) continue; - if (test->flags & UT_TESTF_MANUAL) { + if (test->flags & UTF_MANUAL) { int len; /* diff --git a/test/ut.c b/test/ut.c index ae99831ac8f..7454da3e001 100644 --- a/test/ut.c +++ b/test/ut.c @@ -59,9 +59,11 @@ static int readline_check(struct unit_test_state *uts) ut_fail(uts, __FILE__, __LINE__, __func__, "Console record buffer too small - increase CONFIG_CONSOLE_RECORD_OUT_SIZE"); return ret; + } else if (ret == -ENOENT) { + strcpy(uts->actual_str, ""); } - return 0; + return ret; } int ut_check_console_line(struct unit_test_state *uts, const char *fmt, ...) @@ -79,8 +81,8 @@ int ut_check_console_line(struct unit_test_state *uts, const char *fmt, ...) return -EOVERFLOW; } ret = readline_check(uts); - if (ret < 0) - return ret; + if (ret == -ENOENT) + return 1; return strcmp(uts->expect_str, uts->actual_str); } diff --git a/tools/buildman/test.py b/tools/buildman/test.py index bfad3093030..e9d2c7e41b0 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -779,6 +779,7 @@ class TestBuild(unittest.TestCase): tmpdir = self.base_dir with (patch('time.time', side_effect=self.get_time), + patch('time.monotonic', side_effect=self.get_time), patch('time.sleep', side_effect=self.inc_time), patch('os.kill', side_effect=self.kill)): # Grab the process. Since there is no other profcess, this should