Tidy up console recording in tests
Subsystems (2)
cover Tidy up console recording in tests
This series started as a small fix for checking for an empty line, but in the process several other problems were found and fixed:
- fix tests which use console recording but don't set the flag
- fix wget test and make it run on sandbox
- drop unnecessary resetting of the console in tests
- drop unnecessary blank line before MMC output
- update the docs a little
- fix buildman test failure on newer Pythons
- a few other minor things
This series also renames the confusing flag names, so that they are easier to remember - just a UTF_ (unit-test flags) prefix.
Simon Glass (21):
buildman: Make test_process_limit handle time.monotonic()
test: Fail when an empty line is expected but not present
test: Rename unit-test flags
test: Drop the blank line before test macros
test: Rename UTF_CONSOLE_REC to UTF_CONSOLE
mmc: Drop the blank line before accesses
Revert "net: wget: Support retransmission a dropped packet"
sandbox: Enable wget command
test: Update NAND test to avoid extra macros
test: bloblist: Use UTF_CONSOLE in tests
test: boot: Use UTF_CONSOLE in tests
test: fdt: Check internal-function return values
test: fdt: Move common code into the setup functions
test: cmd: Use UTF_CONSOLE in tests
test: cmd: Drop unnecessary console_record_reset_enable()
test: dm: Use UTF_CONSOLE in tests
test: hush: Use UTF_CONSOLE in tests
test: log: Use UTF_CONSOLE in tests
test: Use UTF_CONSOLE in remaining tests
test: Tidy up checking for console end
doc: Add a few notes about how to use console checking
cmd/Kconfig | 1 + cmd/mmc.c | 12 +- common/console.c | 2 + doc/develop/commands.rst | 9 +- doc/develop/tests_writing.rst | 18 +- doc/usage/cmd/ut.rst | 2 +- include/console.h | 2 +- include/dm/test.h | 2 +- include/test/log.h | 5 +- include/test/spl.h | 2 +- include/test/test.h | 32 +- include/test/ut.h | 2 +- net/wget.c | 23 +- test/bloblist.c | 14 +- test/boot/bootdev.c | 49 ++- test/boot/bootflow.c | 65 ++-- test/boot/bootmeth.c | 14 +- test/boot/cedit.c | 13 +- test/boot/expo.c | 15 +- test/boot/upl.c | 6 +- test/boot/vbe_fixup.c | 4 +- test/boot/vbe_simple.c | 2 +- test/cmd/addrmap.c | 3 +- test/cmd/armffa.c | 3 +- test/cmd/bdinfo.c | 24 +- test/cmd/exit.c | 39 +-- test/cmd/fdt.c | 544 +++++++++++++++------------------- test/cmd/font.c | 13 +- test/cmd/history.c | 2 +- test/cmd/loadm.c | 6 +- test/cmd/mbr.c | 24 +- test/cmd/mem_search.c | 31 +- test/cmd/pci_mps.c | 3 +- test/cmd/pinmux.c | 7 +- test/cmd/pwm.c | 7 +- test/cmd/rw.c | 5 +- test/cmd/seama.c | 9 +- test/cmd/setexpr.c | 24 +- test/cmd/temperature.c | 5 +- test/cmd/test_echo.c | 8 +- test/cmd/test_pause.c | 9 +- test/cmd/wget.c | 9 +- test/common/cread.c | 4 +- test/common/event.c | 2 +- test/common/test_autoboot.c | 4 +- test/dm/acpi.c | 39 +-- test/dm/acpi_dp.c | 2 +- test/dm/acpigen.c | 19 +- test/dm/adc.c | 16 +- test/dm/audio.c | 2 +- test/dm/axi.c | 9 +- test/dm/blk.c | 16 +- test/dm/blkmap.c | 4 +- test/dm/bootcount.c | 10 +- test/dm/bus.c | 26 +- test/dm/button.c | 12 +- test/dm/cache.c | 2 +- test/dm/clk.c | 7 +- test/dm/clk_ccf.c | 3 +- test/dm/core.c | 47 ++- test/dm/cpu.c | 3 +- test/dm/cros_ec.c | 18 +- test/dm/cros_ec_pwm.c | 2 +- test/dm/devres.c | 12 +- test/dm/dma.c | 6 +- test/dm/dsa.c | 6 +- test/dm/dsi_host.c | 3 +- test/dm/ecdsa.c | 2 +- test/dm/efi_media.c | 2 +- test/dm/eth.c | 24 +- test/dm/extcon.c | 3 +- test/dm/fastboot.c | 2 +- test/dm/fdtdec.c | 4 +- test/dm/ffa.c | 6 +- test/dm/firmware.c | 2 +- test/dm/fpga.c | 3 +- test/dm/fwu_mdata.c | 4 +- test/dm/gpio.c | 32 +- test/dm/host.c | 8 +- test/dm/hwspinlock.c | 3 +- test/dm/i2c.c | 19 +- test/dm/i2s.c | 2 +- test/dm/iommu.c | 8 +- test/dm/irq.c | 10 +- test/dm/led.c | 12 +- test/dm/mailbox.c | 2 +- test/dm/mdio.c | 3 +- test/dm/mdio_mux.c | 3 +- test/dm/memory.c | 3 +- test/dm/misc.c | 3 +- test/dm/mmc.c | 4 +- test/dm/mux-cmd.c | 6 +- test/dm/mux-emul.c | 4 +- test/dm/mux-mmio.c | 4 +- test/dm/nand.c | 30 +- test/dm/nop.c | 3 +- test/dm/nvmxip.c | 3 +- test/dm/of_platdata.c | 16 +- test/dm/ofnode.c | 106 +++---- test/dm/ofread.c | 2 +- test/dm/osd.c | 6 +- test/dm/p2sb.c | 2 +- test/dm/panel.c | 2 +- test/dm/part.c | 6 +- test/dm/pch.c | 4 +- test/dm/pci.c | 31 +- test/dm/pci_ep.c | 3 +- test/dm/phy.c | 10 +- test/dm/phys2bus.c | 2 +- test/dm/pinmux.c | 6 +- test/dm/pmc.c | 2 +- test/dm/pmic.c | 13 +- test/dm/power-domain.c | 2 +- test/dm/pwm.c | 2 +- test/dm/qfw.c | 6 +- test/dm/ram.c | 2 +- test/dm/read.c | 2 +- test/dm/reboot-mode.c | 6 +- test/dm/regmap.c | 18 +- test/dm/regulator.c | 20 +- test/dm/remoteproc.c | 4 +- test/dm/reset.c | 11 +- test/dm/rkmtd.c | 6 +- test/dm/rng.c | 6 +- test/dm/rtc.c | 18 +- test/dm/scmi.c | 17 +- test/dm/scsi.c | 2 +- test/dm/serial.c | 3 +- test/dm/sf.c | 4 +- test/dm/simple-bus.c | 2 +- test/dm/simple-pm-bus.c | 2 +- test/dm/sm.c | 3 +- test/dm/smem.c | 2 +- test/dm/soc.c | 3 +- test/dm/sound.c | 4 +- test/dm/spi.c | 6 +- test/dm/spmi.c | 6 +- test/dm/syscon-reset.c | 2 +- test/dm/syscon.c | 6 +- test/dm/sysinfo-gpio.c | 2 +- test/dm/sysinfo.c | 3 +- test/dm/sysreset.c | 8 +- test/dm/tag.c | 4 - test/dm/tee.c | 3 +- test/dm/test-fdt.c | 58 ++-- test/dm/timer.c | 4 +- test/dm/tpm.c | 8 +- test/dm/usb.c | 12 +- test/dm/video.c | 42 +-- test/dm/virtio.c | 2 +- test/dm/virtio_device.c | 8 +- test/dm/virtio_rng.c | 2 +- test/dm/wdt.c | 8 +- test/env/hashtable.c | 2 - test/hush/dollar.c | 10 +- test/hush/loop.c | 11 +- test/lib/asn1.c | 3 - test/lib/efi_device_path.c | 1 - test/lib/efi_image_region.c | 2 - test/lib/hexdump.c | 3 - test/lib/lmb.c | 1 - test/lib/rsa.c | 2 - test/lib/sscanf.c | 1 - test/lib/string.c | 3 - test/lib/test_aes.c | 1 - test/lib/test_crc8.c | 1 - test/lib/test_crypt.c | 1 - test/lib/test_errno_str.c | 1 - test/lib/test_print.c | 16 +- test/lib/uuid.c | 1 - test/log/cont_test.c | 7 +- test/log/log_filter.c | 7 +- test/log/log_test.c | 51 +--- test/log/nolog_ndebug.c | 3 +- test/log/nolog_test.c | 24 +- test/log/pr_cont_test.c | 3 +- test/print_ut.c | 21 +- test/test-main.c | 40 +-- test/ut.c | 8 +- tools/buildman/test.py | 1 + 180 files changed, 980 insertions(+), 1342 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/21 buildman: Make test_process_limit handle time.monotonic()
Newer versions of filelock use time.monotonic() instead of time.time(). Update the test the handle this.
It would be better if filelock had support for writing unit tests which use locking.
---
tools/buildman/test.py | 1 + 1 file changed, 1 insertion(+)
tools/buildman/test.py +1 -0
@@ -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
Signature · 1 line
2.34.1
PATCH 2/21 test: Fail when an empty line is expected but not present
In reply to Simon GlassThe existing implementation of ut_assert_nextline_empty() cannot distinguish between an empty line and no line at all. It can in fact be called at the end of the recorded output and will happily return success.
Adjust the logic so that this condition is detected. Show a failure message in this case.
Fix the one test which falls foul of this fix.
---
common/console.c | 2 ++ include/console.h | 2 +- test/boot/bootflow.c | 2 -- test/ut.c | 8 +++++--- 4 files changed, 8 insertions(+), 6 deletions(-)
common/console.c +2 -0
@@ -845,6 +845,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);
include/console.h +1 -1
@@ -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);
test/boot/bootflow.c +0 -2
@@ -1151,8 +1151,6 @@ 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 ;
test/ut.c +5 -3
@@ -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,"<no-more-output>" ); } -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); }
Signature · 1 line
2.34.1
Re: [PATCH 02/21] test: Fail when an empty line is expected but not present
Hi Simon,
Thank you for the patch.
Quoted 5 lines · Simon Glass
The existing implementation of
ut_assert_nextline_empty()cannot distinguish between an empty line and no line at all. It can in fact be called at the end of the recorded output and will happily return success.
Quoted 7 lines
Adjust the logic so that this condition is detected. Show a failure message in this case.
Fix the one test which falls foul of this fix.
Signed-off-by Simon Glass <[email protected]>Fixes 400175b0a7d ("test: Add a way to check each line of console...")
Quoted 77 lines
---
common/console.c | 2 ++ include/console.h | 2 +- test/boot/bootflow.c | 2 -- test/ut.c | 8 +++++--- 4 files changed, 8 insertions(+), 6 deletions(-)common/console.c +2
-0@@ -845,6 +845,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);include/console.h +1
-1@@ -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);test/boot/bootflow.c +0
-2@@ -1151,8 +1151,6 @@ 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 ;test/ut.c +5
-3@@ -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,"<no-more-output>" ); } -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); }Signature · 1 line
2.34.1
PATCH 3/21 test: Rename unit-test flags
In reply to Simon GlassThe UT_TESTF_ macros read as 'unit test test flags' which is not right. Rename to UTF ('unit test flags').
This has the benefit of being shorter, which helps keep UNIT_TEST() declarations on a single line.
Give the enum a name and reference it from the UNIT_TEST() macros while we are here.
---
doc/develop/commands.rst | 2 +- doc/develop/tests_writing.rst | 14 ++--- doc/usage/cmd/ut.rst | 2 +- include/dm/test.h | 2 +- include/test/spl.h | 2 +- include/test/test.h | 32 +++++----- include/test/ut.h | 2 +- test/boot/bootdev.c | 36 +++++------- test/boot/bootflow.c | 38 ++++++------ test/boot/bootmeth.c | 10 ++-- test/boot/expo.c | 14 ++--- test/boot/upl.c | 6 +- test/boot/vbe_fixup.c | 4 +- test/boot/vbe_simple.c | 2 +- test/cmd/addrmap.c | 2 +- test/cmd/armffa.c | 2 +- test/cmd/bdinfo.c | 8 +-- test/cmd/exit.c | 2 +- test/cmd/fdt.c | 38 ++++++------ test/cmd/font.c | 4 +- test/cmd/history.c | 2 +- test/cmd/loadm.c | 4 +- test/cmd/mbr.c | 4 +- test/cmd/mem_search.c | 18 +++--- test/cmd/pci_mps.c | 2 +- test/cmd/pinmux.c | 2 +- test/cmd/pwm.c | 2 +- test/cmd/rw.c | 2 +- test/cmd/seama.c | 6 +- test/cmd/setexpr.c | 22 +++---- test/cmd/temperature.c | 2 +- test/common/event.c | 2 +- test/dm/acpi.c | 32 +++++----- test/dm/acpi_dp.c | 2 +- test/dm/acpigen.c | 19 +++--- test/dm/adc.c | 16 ++--- test/dm/audio.c | 2 +- test/dm/axi.c | 6 +- test/dm/blk.c | 16 ++--- test/dm/bootcount.c | 6 +- test/dm/bus.c | 26 ++++----- test/dm/button.c | 12 ++-- test/dm/cache.c | 2 +- test/dm/clk.c | 6 +- test/dm/clk_ccf.c | 2 +- test/dm/core.c | 46 +++++++-------- test/dm/cpu.c | 2 +- test/dm/cros_ec.c | 12 ++-- test/dm/cros_ec_pwm.c | 2 +- test/dm/devres.c | 12 ++-- test/dm/dma.c | 6 +- test/dm/dsa.c | 4 +- test/dm/dsi_host.c | 2 +- test/dm/ecdsa.c | 2 +- test/dm/efi_media.c | 2 +- test/dm/eth.c | 20 +++---- test/dm/extcon.c | 2 +- test/dm/fastboot.c | 2 +- test/dm/fdtdec.c | 4 +- test/dm/ffa.c | 4 +- test/dm/firmware.c | 2 +- test/dm/fpga.c | 2 +- test/dm/fwu_mdata.c | 4 +- test/dm/gpio.c | 32 +++++----- test/dm/host.c | 6 +- test/dm/hwspinlock.c | 2 +- test/dm/i2c.c | 18 +++--- test/dm/i2s.c | 2 +- test/dm/iommu.c | 8 +-- test/dm/irq.c | 10 ++-- test/dm/led.c | 12 ++-- test/dm/mailbox.c | 2 +- test/dm/mdio.c | 2 +- test/dm/mdio_mux.c | 2 +- test/dm/memory.c | 2 +- test/dm/misc.c | 2 +- test/dm/mmc.c | 4 +- test/dm/mux-cmd.c | 6 +- test/dm/mux-emul.c | 4 +- test/dm/mux-mmio.c | 4 +- test/dm/nand.c | 4 +- test/dm/nop.c | 2 +- test/dm/nvmxip.c | 2 +- test/dm/of_platdata.c | 16 ++--- test/dm/ofnode.c | 106 +++++++++++++++++----------------- test/dm/ofread.c | 2 +- test/dm/osd.c | 4 +- test/dm/p2sb.c | 2 +- test/dm/panel.c | 2 +- test/dm/part.c | 6 +- test/dm/pch.c | 4 +- test/dm/pci.c | 31 +++++----- test/dm/pci_ep.c | 2 +- test/dm/phy.c | 10 ++-- test/dm/phys2bus.c | 2 +- test/dm/pinmux.c | 6 +- test/dm/pmc.c | 2 +- test/dm/pmic.c | 12 ++-- test/dm/power-domain.c | 2 +- test/dm/pwm.c | 2 +- test/dm/qfw.c | 4 +- test/dm/ram.c | 2 +- test/dm/read.c | 2 +- test/dm/reboot-mode.c | 4 +- test/dm/regmap.c | 17 +++--- test/dm/regulator.c | 20 +++---- test/dm/remoteproc.c | 4 +- test/dm/reset.c | 10 ++-- test/dm/rkmtd.c | 6 +- test/dm/rng.c | 4 +- test/dm/rtc.c | 14 ++--- test/dm/scmi.c | 14 ++--- test/dm/scsi.c | 2 +- test/dm/serial.c | 2 +- test/dm/sf.c | 4 +- test/dm/simple-bus.c | 2 +- test/dm/simple-pm-bus.c | 2 +- test/dm/sm.c | 2 +- test/dm/smem.c | 2 +- test/dm/soc.c | 2 +- test/dm/sound.c | 4 +- test/dm/spi.c | 6 +- test/dm/spmi.c | 6 +- test/dm/syscon-reset.c | 2 +- test/dm/syscon.c | 6 +- test/dm/sysinfo-gpio.c | 2 +- test/dm/sysinfo.c | 2 +- test/dm/sysreset.c | 8 +-- test/dm/tee.c | 2 +- test/dm/test-fdt.c | 57 +++++++++--------- test/dm/timer.c | 4 +- test/dm/tpm.c | 8 +-- test/dm/usb.c | 12 ++-- test/dm/video.c | 42 +++++++------- test/dm/virtio.c | 2 +- test/dm/virtio_device.c | 8 +-- test/dm/virtio_rng.c | 2 +- test/dm/wdt.c | 8 +-- test/log/log_filter.c | 4 +- test/log/log_test.c | 32 +++++----- test/print_ut.c | 6 +- test/test-main.c | 40 ++++++------- 142 files changed, 633 insertions(+), 653 deletions(-)
doc/develop/commands.rst +1 -1
@@ -223,4 +223,4 @@ 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);
doc/develop/tests_writing.rst +7 -7
@@ -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.
@@ -167,7 +167,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_REC); 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 +226,14 @@ 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); 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 +263,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_REC); Note that the MEM_TEST() macros is defined at the top of the file.
doc/usage/cmd/ut.rst +1 -1
@@ -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.
include/dm/test.h +1 -1
@@ -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_REC | (_flags), dm_test)/* * struct sandbox_sdl_plat - Platform data for the SDL video driver
include/test/spl.h +1 -1
@@ -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 */
include/test/test.h +16 -16
@@ -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_REC =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 <suite> <test>'. 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) \
include/test/ut.h +1 -1
@@ -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
test/boot/bootdev.c +16 -20
@@ -49,7 +49,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 );/* Check 'bootdev select' and 'info' commands */ static int bootdev_test_cmd_select (struct unit_test_state *uts)
@@ -99,7 +99,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 );/* Check bootdev labels */ static int bootdev_test_labels (struct unit_test_state *uts)
@@ -131,8 +131,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)
@@ -186,8 +185,7 @@ 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 );/* * Check bootdev ordering with the bootdev-order property and boot_targets
@@ -274,7 +272,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 +299,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)
@@ -350,7 +348,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)
@@ -390,7 +388,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 );/* Check 'bootdev hunt' command */ static int bootdev_test_cmd_hunt (struct unit_test_state *uts)
@@ -464,8 +462,7 @@ 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 );/* Check searching for bootdevs using the hunters */ static int bootdev_test_hunt_scan (struct unit_test_state *uts)
@@ -485,7 +482,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 +519,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)
@@ -547,7 +544,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 );/* Check hunting for bootdevs with a particular label */ static int bootdev_test_hunt_label (struct unit_test_state *uts)
@@ -600,7 +597,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 );/* Check iterating to the next label in a list */ static int bootdev_test_next_label (struct unit_test_state *uts)
@@ -677,8 +674,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 );/* Check iterating to the next prioirty in a list */ static int bootdev_test_next_prio (struct unit_test_state *uts)
@@ -762,5 +759,4 @@ 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 );
test/boot/bootflow.c +17 -21
@@ -76,7 +76,7 @@ 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 );/* Check 'bootflow scan' with a label / seq */ static int bootflow_cmd_label (struct unit_test_state *uts)
@@ -123,8 +123,7 @@ 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 );/* Check 'bootflow scan/list' commands using all bootdevs */ static int bootflow_cmd_glob (struct unit_test_state *uts)
@@ -156,7 +155,7 @@ 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 );/* Check 'bootflow scan -e' */ static int bootflow_cmd_scan_e (struct unit_test_state *uts)
@@ -207,7 +206,7 @@ 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 );/* Check 'bootflow info' */ static int bootflow_cmd_info (struct unit_test_state *uts)
@@ -248,7 +247,7 @@ 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 );/* Check 'bootflow scan -b' to boot the first available bootdev */ static int bootflow_scan_boot (struct unit_test_state *uts)
@@ -270,7 +269,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 );/* Check iterating through available bootflows */ static int bootflow_iter (struct unit_test_state *uts)
@@ -368,7 +367,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 */
@@ -396,8 +395,7 @@ 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 );#endif /* Check disabling a bootmethod if it requests it */
@@ -438,7 +436,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 );/* Check 'bootflow scan' with a bootmeth ordering including a global bootmeth */ static int bootflow_scan_glob_bootmeth (struct unit_test_state *uts)
@@ -479,7 +477,7 @@ 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 );/* Check 'bootflow boot' to boot a selected bootflow */ static int bootflow_cmd_boot (struct unit_test_state *uts)
@@ -508,7 +506,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 );/** * prep_mmc_bootdev() - Set up an mmc bootdev so we can access other distros
@@ -675,7 +673,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 );/* Check 'bootflow scan -m' to select a bootflow using a menu */ static int bootflow_scan_menu (struct unit_test_state *uts)
@@ -723,8 +721,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_REC );/* 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 +767,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_REC );/* Check searching for a single bootdev using the hunters */ static int bootflow_cmd_hunt_single (struct unit_test_state *uts)
@@ -794,7 +790,7 @@ 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 );/* Check searching for a uclass label using the hunters */ static int bootflow_cmd_hunt_label (struct unit_test_state *uts)
@@ -831,7 +827,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 );/** * check_font() - Check that the font size for an item matches expectations
@@ -891,7 +887,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 );/** * check_arg() - Check both the normal case and the buffer-overflow case
test/boot/bootmeth.c +5 -5
@@ -31,7 +31,7 @@ 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 );/* Check 'bootmeth order' command */ static int bootmeth_cmd_order (struct unit_test_state *uts)
@@ -104,7 +104,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 );/* Check 'bootmeth order' command with global bootmeths */ static int bootmeth_cmd_order_glob (struct unit_test_state *uts)
@@ -128,7 +128,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 );/* Check 'bootmeths' env var */ static int bootmeth_env (struct unit_test_state *uts)
@@ -154,7 +154,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 );/* Check the get_state_desc() method */ static int bootmeth_state (struct unit_test_state *uts)
@@ -170,4 +170,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 );
test/boot/expo.c +7 -7
@@ -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)
@@ -633,7 +633,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 );/* Check building an expo from a devicetree description */ static int expo_test_build (struct unit_test_state *uts)
@@ -712,4 +712,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 );
test/boot/upl.c +3 -3
@@ -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_REC );/* 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_REC );/* 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_REC |UTF_MANUAL );int do_ut_upl (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/boot/vbe_fixup.c +2 -2
@@ -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 );
test/boot/vbe_simple.c +1 -1
@@ -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 );
test/cmd/addrmap.c +1 -1
@@ -24,7 +24,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_REC );int do_ut_addrmap (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/armffa.c +1 -1
@@ -29,4 +29,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_REC );
test/cmd/bdinfo.c +4 -4
@@ -245,7 +245,7 @@ static int bdinfo_test_full(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_full,UT_TESTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_full,UTF_CONSOLE_REC );static int bdinfo_test_help (struct unit_test_state *uts) {
@@ -267,7 +267,7 @@ static int bdinfo_test_help(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_help,UT_TESTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_help,UTF_CONSOLE_REC );static int bdinfo_test_memory (struct unit_test_state *uts) {
@@ -283,7 +283,7 @@ static int bdinfo_test_memory(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_memory,UT_TESTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_memory,UTF_CONSOLE_REC );static int bdinfo_test_eth (struct unit_test_state *uts) {
@@ -299,7 +299,7 @@ static int bdinfo_test_eth(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_eth,UT_TESTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_eth,UTF_CONSOLE_REC );int do_ut_bdinfo (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/exit.c +1 -1
@@ -122,7 +122,7 @@ static int cmd_exit_test(struct unit_test_state *uts)return 0 ; } -EXIT_TEST (cmd_exit_test,UT_TESTF_CONSOLE_REC ); +EXIT_TEST (cmd_exit_test,UTF_CONSOLE_REC );int do_ut_exit (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/fdt.c +19 -19
@@ -213,7 +213,7 @@ static int fdt_test_addr(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_addr,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_addr,UTF_CONSOLE_REC );/* Test 'fdt addr' resizing an fdt */ static int fdt_test_addr_resize (struct unit_test_state *uts)
@@ -247,7 +247,7 @@ static int fdt_test_addr_resize(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_addr_resize,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_addr_resize,UTF_CONSOLE_REC );static int fdt_test_move (struct unit_test_state *uts) {
@@ -281,7 +281,7 @@ static int fdt_test_move(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_move,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_move,UTF_CONSOLE_REC );static int fdt_test_resize (struct unit_test_state *uts) {
@@ -305,7 +305,7 @@ static int fdt_test_resize(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_resize,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_resize,UTF_CONSOLE_REC );static int fdt_test_print_list_common (struct unit_test_state *uts,const char *opc,const char *node)
@@ -442,13 +442,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_REC );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_REC );/* Test 'fdt get value' reading an fdt */ static int fdt_test_get_value_string(struct unit_test_state *uts,
@@ -554,7 +554,7 @@ static int fdt_test_get_value(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_value,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_get_value,UTF_CONSOLE_REC );static int fdt_test_get_name (struct unit_test_state *uts) {
@@ -633,7 +633,7 @@ static int fdt_test_get_name(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_name,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_get_name,UTF_CONSOLE_REC );static int fdt_test_get_addr_common (struct unit_test_state *uts,char *fdt,const char *path,const char *prop)
@@ -700,7 +700,7 @@ static int fdt_test_get_addr(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_addr,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_get_addr,UTF_CONSOLE_REC ); static int fdt_test_get_size_common(struct unit_test_state *uts, const char *path, const char *prop,
@@ -787,7 +787,7 @@ static int fdt_test_get_size(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_size,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_get_size,UTF_CONSOLE_REC ); static int fdt_test_set_single(struct unit_test_state *uts, const char *path, const char *prop,
@@ -929,7 +929,7 @@ static int fdt_test_set(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_set,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_set,UTF_CONSOLE_REC );static int fdt_test_mknode (struct unit_test_state *uts) {
@@ -997,7 +997,7 @@ static int fdt_test_mknode(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_mknode,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_mknode,UTF_CONSOLE_REC );static int fdt_test_rm (struct unit_test_state *uts) {
@@ -1081,7 +1081,7 @@ static int fdt_test_rm(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_rm,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_rm,UTF_CONSOLE_REC );static int fdt_test_bootcpu (struct unit_test_state *uts) {
@@ -1114,7 +1114,7 @@ static int fdt_test_bootcpu(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_bootcpu,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_bootcpu,UTF_CONSOLE_REC );static int fdt_test_header_get (struct unit_test_state *uts,const char *field,const unsigned long val)
@@ -1173,7 +1173,7 @@ static int fdt_test_header(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_header,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_header,UTF_CONSOLE_REC );static int fdt_test_memory_cells (struct unit_test_state *uts,const unsigned int cells)
@@ -1256,7 +1256,7 @@ 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_REC );static int fdt_test_rsvmem (struct unit_test_state *uts) {
@@ -1319,7 +1319,7 @@ static int fdt_test_rsvmem(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_rsvmem,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_rsvmem,UTF_CONSOLE_REC );static int fdt_test_chosen (struct unit_test_state *uts) {
@@ -1375,7 +1375,7 @@ static int fdt_test_chosen(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_chosen,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_chosen,UTF_CONSOLE_REC );static int fdt_test_apply (struct unit_test_state *uts) {
@@ -1527,7 +1527,7 @@ static int fdt_test_apply(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_apply,UT_TESTF_CONSOLE_REC ); +FDT_TEST (fdt_test_apply,UTF_CONSOLE_REC );int do_ut_fdt (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/font.c +2 -2
@@ -69,8 +69,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_REC | +UTF_DM );int do_ut_font (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/history.c +1 -1
@@ -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_REC );
test/cmd/loadm.c +2 -2
@@ -41,7 +41,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_REC );static int loadm_test_load (struct unit_test_state *uts) {
@@ -59,7 +59,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_REC );int do_ut_loadm (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/mbr.c +2 -2
@@ -465,7 +465,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_REC , mbr_test);int do_ut_mbr (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
@@ -480,4 +480,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_REC );
test/cmd/mem_search.c +9 -9
@@ -43,7 +43,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_REC );/* Test 'ms' command with 16-bit values */ static int mem_test_ms_w (struct unit_test_state *uts)
@@ -68,7 +68,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_REC );/* Test 'ms' command with 32-bit values */ static int mem_test_ms_l (struct unit_test_state *uts)
@@ -102,7 +102,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_REC );/* Test 'ms' command with continuation */ static int mem_test_ms_cont (struct unit_test_state *uts)
@@ -152,7 +152,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_REC );/* 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)
@@ -196,7 +196,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_REC );/* Test 'ms' command with multiple values */ static int mem_test_ms_mult (struct unit_test_state *uts)
@@ -225,7 +225,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_REC );/* Test 'ms' command with string */ static int mem_test_ms_s (struct unit_test_state *uts)
@@ -268,7 +268,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_REC );/* Test 'ms' command with limit */ static int mem_test_ms_limit (struct unit_test_state *uts)
@@ -297,7 +297,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_REC );/* Test 'ms' command in quiet mode */ static int mem_test_ms_quiet (struct unit_test_state *uts)
@@ -321,4 +321,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_REC );
test/cmd/pci_mps.c +1 -1
@@ -28,7 +28,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_REC );int do_ut_pci_mps (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[])
test/cmd/pinmux.c +1 -1
@@ -37,4 +37,4 @@ 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 );
test/cmd/pwm.c +1 -1
@@ -72,4 +72,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_REC );
test/cmd/rw.c +1 -1
@@ -100,4 +100,4 @@ static int dm_test_read_write(struct unit_test_state *uts)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_REC );
test/cmd/seama.c +3 -3
@@ -26,7 +26,7 @@ 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_REC );static int seama_test_addr (struct unit_test_state *uts) {
@@ -42,7 +42,7 @@ 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_REC );static int seama_test_index (struct unit_test_state *uts) {
@@ -58,7 +58,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_REC );int do_ut_seama (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/setexpr.c +11 -11
@@ -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_REC );/* 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_REC );/* 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_REC );/* 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_REC );/* 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_REC );/* 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_REC );/* 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_REC );/* 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_REC );/* Test 'setexpr' command with concatenating strings */ static int setexpr_test_str_oper (struct unit_test_state *uts)
@@ -376,7 +376,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_REC );/* Test 'setexpr' command with a string that is too long */ static int setexpr_test_str_long (struct unit_test_state *uts)
@@ -396,7 +396,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_REC );#ifdef CONFIG_CMD_SETEXPR_FMT /* Test 'setexpr' command with simply setting integers */
@@ -479,7 +479,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_REC );#endif int do_ut_setexpr (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[])
test/cmd/temperature.c +1 -1
@@ -35,4 +35,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_REC );
test/common/event.c +1 -1
@@ -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 );
test/dm/acpi.c +15 -17
@@ -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)
@@ -418,7 +416,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 );/* Test 'acpi dump' command */ static int dm_test_acpi_cmd_dump (struct unit_test_state *uts)
@@ -450,7 +448,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 );/* Test acpi_device_path() */ static int dm_test_acpi_device_path (struct unit_test_state *uts)
@@ -487,7 +485,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 +497,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 +528,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 +559,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)
@@ -610,7 +608,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 );/* Test 'acpi set' command */ static int dm_test_acpi_cmd_set (struct unit_test_state *uts)
@@ -648,7 +646,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 );/** * dm_test_write_test_table() - create test ACPI table
test/dm/acpi_dp.c +1 -1
@@ -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 );
test/dm/acpigen.c +9 -10
@@ -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)
test/dm/adc.c +8 -8
@@ -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 );
test/dm/audio.c +1 -1
@@ -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 );
test/dm/axi.c +3 -3
@@ -22,7 +22,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)
@@ -34,7 +34,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)
@@ -75,4 +75,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 );
test/dm/blk.c +8 -8
@@ -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 );
test/dm/bootcount.c +3 -3
@@ -36,7 +36,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) {
@@ -57,7 +57,7 @@ static int dm_test_bootcount_syscon_four_bytes(struct unit_test_state *uts) }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) {
@@ -78,4 +78,4 @@ static int dm_test_bootcount_syscon_two_bytes(struct unit_test_state *uts) }DM_TEST (dm_test_bootcount_syscon_two_bytes, -UT_TESTF_SCAN_PDATA |UT_TESTF_SCAN_FDT ); +UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/bus.c +13 -13
@@ -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 );
test/dm/button.c +6 -6
@@ -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 );
test/dm/cache.c +1 -1
@@ -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 );
test/dm/clk.c +3 -3
@@ -47,7 +47,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 +187,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 +225,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 );
test/dm/clk_ccf.c +1 -1
@@ -209,4 +209,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 );
test/dm/core.c +23 -23
181 lines not on this page · raw message
test/dm/cpu.c +1 -1
@@ -48,4 +48,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 );
test/dm/cros_ec.c +6 -6
@@ -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) {
@@ -45,7 +45,7 @@ static int dm_test_cros_ec_sku_id(struct unit_test_state *uts)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 );static int dm_test_cros_ec_features (struct unit_test_state *uts) {
@@ -75,7 +75,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 );static int dm_test_cros_ec_switches (struct unit_test_state *uts) {
@@ -101,7 +101,7 @@ static int dm_test_cros_ec_switches(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_cros_ec_switches,UT_TESTF_SCAN_FDT ); +DM_TEST (dm_test_cros_ec_switches,UTF_SCAN_FDT );static int dm_test_cros_ec_events (struct unit_test_state *uts) {
@@ -138,7 +138,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 );static int dm_test_cros_ec_vstore (struct unit_test_state *uts) {
@@ -174,4 +174,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 );
test/dm/cros_ec_pwm.c +1 -1
@@ -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 );
test/dm/devres.c +6 -6
@@ -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 );
test/dm/dma.c +3 -3
@@ -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 );
test/dm/dsa.c +2 -2
@@ -57,7 +57,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.
@@ -79,4 +79,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 );
test/dm/dsi_host.c +1 -1
@@ -55,4 +55,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 );
test/dm/ecdsa.c +1 -1
@@ -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 );
test/dm/efi_media.c +1 -1
@@ -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 );
test/dm/eth.c +10 -10
@@ -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)
@@ -529,7 +529,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)
@@ -614,7 +614,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 )
test/dm/extcon.c +1 -1
@@ -18,4 +18,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 );
test/dm/fastboot.c +1 -1
@@ -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 );
test/dm/fdtdec.c +2 -2
@@ -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 );
test/dm/ffa.c +2 -2
@@ -198,7 +198,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_REC );static int dm_test_ffa_nack (struct unit_test_state *uts) {
@@ -257,4 +257,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_REC );
test/dm/firmware.c +1 -1
@@ -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 );
test/dm/fpga.c +1 -1
@@ -17,4 +17,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 );
test/dm/fwu_mdata.c +2 -2
@@ -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 );
test/dm/gpio.c +16 -16
@@ -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 );
test/dm/host.c +3 -3
@@ -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)
@@ -199,4 +199,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 );
test/dm/hwspinlock.c +1 -1
@@ -37,4 +37,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 );
test/dm/i2c.c +9 -9
@@ -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) {
@@ -302,7 +302,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 +331,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 );
test/dm/i2s.c +1 -1
@@ -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 );
test/dm/iommu.c +4 -4
@@ -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 );
test/dm/irq.c +5 -5
@@ -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 );
test/dm/led.c +6 -6
@@ -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
test/dm/mailbox.c +1 -1
@@ -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 );
test/dm/mdio.c +1 -1
@@ -54,4 +54,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 );
test/dm/mdio_mux.c +1 -1
@@ -77,4 +77,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 );
test/dm/memory.c +1 -1
@@ -18,4 +18,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 );
test/dm/misc.c +1 -1
@@ -80,4 +80,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 );
test/dm/mmc.c +2 -2
@@ -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 );
test/dm/mux-cmd.c +3 -3
@@ -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 );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 );
test/dm/mux-emul.c +2 -2
@@ -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 );
test/dm/mux-mmio.c +2 -2
@@ -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 );
test/dm/nand.c +2 -2
@@ -93,12 +93,12 @@ 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); \ +DM_TEST(dm_test_nand##dev##_start, UTF_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) +DM_TEST(dm_test_nand##dev##_end, UTF_SCAN_FDT)DM_NAND_TEST (0 );DM_NAND_TEST (1 );
test/dm/nop.c +1 -1
@@ -70,4 +70,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 );
test/dm/nvmxip.c +1 -1
@@ -143,4 +143,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_REC );
test/dm/of_platdata.c +8 -8
@@ -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 );
test/dm/ofnode.c +53 -53
421 lines not on this page · raw message
test/dm/ofread.c +1 -1
@@ -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 );
test/dm/osd.c +2 -2
@@ -131,7 +131,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) {
@@ -215,4 +215,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 );
test/dm/p2sb.c +1 -1
@@ -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 );
test/dm/panel.c +1 -1
@@ -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 );
test/dm/part.c +3 -3
@@ -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 );
test/dm/pch.c +2 -2
@@ -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 );
test/dm/pci.c +15 -16
@@ -19,7 +19,7 @@ static int dm_test_pci_base(struct unit_test_state *uts)
Lines of this file are not shown. View the raw message.
test/dm/test-fdt.c +28 -29
57 lines not on this page · raw message
test/dm/video.c +21 -21
42 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.34.1
Part of the diff is not shown here. View the raw message.
PATCH 4/21 test: Drop the blank line before test macros
In reply to Simon GlassMost tests don't have this. It helps to keep the test declaration clearly associated with the function it relates to, rather than the next one in the file. Remove the extra blank line and mention this in the docs.
---
doc/develop/tests_writing.rst | 3 +++ test/cmd/armffa.c | 1 - test/cmd/bdinfo.c | 4 ---- test/cmd/exit.c | 1 - test/cmd/mbr.c | 1 - test/cmd/pci_mps.c | 1 - test/cmd/pinmux.c | 1 - test/cmd/pwm.c | 1 - test/cmd/rw.c | 1 - test/cmd/setexpr.c | 1 - test/cmd/temperature.c | 1 - test/cmd/test_echo.c | 1 - test/cmd/wget.c | 1 - test/common/test_autoboot.c | 1 - test/dm/axi.c | 3 --- test/dm/bootcount.c | 6 +----- test/dm/clk.c | 1 - test/dm/clk_ccf.c | 1 - test/dm/core.c | 1 - test/dm/cpu.c | 1 - test/dm/dsa.c | 2 -- test/dm/dsi_host.c | 1 - test/dm/eth.c | 4 ---- test/dm/extcon.c | 1 - test/dm/ffa.c | 2 -- test/dm/fpga.c | 1 - test/dm/hwspinlock.c | 1 - test/dm/i2c.c | 1 - test/dm/mdio.c | 1 - test/dm/mdio_mux.c | 1 - test/dm/memory.c | 1 - test/dm/misc.c | 1 - test/dm/nop.c | 1 - test/dm/nvmxip.c | 1 - test/dm/osd.c | 2 -- test/dm/pci_ep.c | 1 - test/dm/pmic.c | 1 - test/dm/qfw.c | 2 -- test/dm/reboot-mode.c | 2 -- test/dm/regmap.c | 1 - test/dm/reset.c | 1 - test/dm/scmi.c | 3 --- test/dm/serial.c | 1 - test/dm/sm.c | 1 - test/dm/soc.c | 1 - test/dm/sysinfo.c | 1 - test/dm/tag.c | 4 ---- test/dm/tee.c | 1 - test/dm/test-fdt.c | 1 - test/env/hashtable.c | 2 -- test/lib/asn1.c | 3 --- test/lib/efi_device_path.c | 1 - test/lib/efi_image_region.c | 2 -- test/lib/hexdump.c | 3 --- test/lib/lmb.c | 1 - test/lib/rsa.c | 2 -- test/lib/sscanf.c | 1 - test/lib/string.c | 3 --- test/lib/test_aes.c | 1 - test/lib/test_crc8.c | 1 - test/lib/test_crypt.c | 1 - test/lib/test_errno_str.c | 1 - test/lib/test_print.c | 2 -- test/lib/uuid.c | 1 - 64 files changed, 4 insertions(+), 95 deletions(-)
doc/develop/tests_writing.rst +3 -0
@@ -228,6 +228,9 @@ Declare the test with:: } 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.
test/cmd/armffa.c +0 -1
@@ -28,5 +28,4 @@ static int dm_test_armffa_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_armffa_cmd,UTF_SCAN_FDT |UTF_CONSOLE_REC );
test/cmd/bdinfo.c +0 -4
@@ -244,7 +244,6 @@ static int bdinfo_test_full(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_full,UTF_CONSOLE_REC );static int bdinfo_test_help (struct unit_test_state *uts)
@@ -266,7 +265,6 @@ static int bdinfo_test_help(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_help,UTF_CONSOLE_REC );static int bdinfo_test_memory (struct unit_test_state *uts)
@@ -282,7 +280,6 @@ static int bdinfo_test_memory(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_memory,UTF_CONSOLE_REC );static int bdinfo_test_eth (struct unit_test_state *uts)
@@ -298,7 +295,6 @@ static int bdinfo_test_eth(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_eth,UTF_CONSOLE_REC );int do_ut_bdinfo (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[])
test/cmd/exit.c +0 -1
@@ -121,7 +121,6 @@ static int cmd_exit_test(struct unit_test_state *uts)return 0 ; } -EXIT_TEST (cmd_exit_test,UTF_CONSOLE_REC );int do_ut_exit (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[])
test/cmd/mbr.c +0 -1
@@ -479,5 +479,4 @@ static int dm_test_cmd_mbr(struct unit_test_state *uts) {return mbr_test_run (uts); } -DM_TEST (dm_test_cmd_mbr,UTF_SCAN_FDT |UTF_CONSOLE_REC );
test/cmd/pci_mps.c +0 -1
@@ -27,7 +27,6 @@ static int test_pci_mps_safe(struct unit_test_state *uts)return 0 ; } -PCI_MPS_TEST (test_pci_mps_safe,UTF_CONSOLE_REC ); int do_ut_pci_mps(struct cmd_tbl *cmdtp, int flag, int argc,
test/cmd/pinmux.c +0 -1
@@ -36,5 +36,4 @@ static int dm_test_cmd_pinmux_status_pinname(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_cmd_pinmux_status_pinname,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/cmd/pwm.c +0 -1
@@ -71,5 +71,4 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_pwm_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE_REC );
test/cmd/rw.c +0 -1
@@ -99,5 +99,4 @@ static int dm_test_read_write(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_read_write,UTF_SCAN_FDT |UTF_CONSOLE_REC );
test/cmd/setexpr.c +0 -1
@@ -478,7 +478,6 @@ static int setexpr_test_fmt(struct unit_test_state *uts) return 0; } -SETEXPR_TEST (setexpr_test_fmt,UTF_CONSOLE_REC );#endif
test/cmd/temperature.c +0 -1
@@ -34,5 +34,4 @@ static int dm_test_cmd_temperature(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_cmd_temperature,UTF_SCAN_FDT |UTF_CONSOLE_REC );
test/cmd/test_echo.c +0 -1
@@ -56,5 +56,4 @@ static int lib_test_hush_echo(struct unit_test_state *uts) }return 0 ; } -LIB_TEST (lib_test_hush_echo,0 );
test/cmd/wget.c +0 -1
@@ -201,5 +201,4 @@ static int net_test_wget(struct unit_test_state *uts)return 0 ; } -LIB_TEST (net_test_wget,0 );
test/common/test_autoboot.c +0 -1
@@ -91,5 +91,4 @@ static int test_autoboot(struct unit_test_state *uts)return CMD_RET_SUCCESS ; } -COMMON_TEST (test_autoboot,0 );
test/dm/axi.c +0 -3
@@ -21,7 +21,6 @@ static int dm_test_axi_base(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_axi_base,UTF_SCAN_PDATA |UTF_SCAN_FDT );/* Test that sandbox PCI bus numbering works correctly */
@@ -33,7 +32,6 @@ static int dm_test_axi_busnum(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_axi_busnum,UTF_SCAN_PDATA |UTF_SCAN_FDT );/* Test that we can use the store device correctly */
@@ -74,5 +72,4 @@ static int dm_test_axi_store(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_axi_store,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/bootcount.c +1 -5
@@ -35,7 +35,6 @@ static int dm_test_bootcount_rtc(struct unit_test_state *uts)return 0 ; } -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,7 +54,6 @@ static int dm_test_bootcount_syscon_four_bytes(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_bootcount_syscon_four_bytes,UTF_SCAN_PDATA |UTF_SCAN_FDT );
@@ -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, -UTF_SCAN_PDATA |UTF_SCAN_FDT ); +DM_TEST (dm_test_bootcount_syscon_two_bytes,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/clk.c +0 -1
@@ -46,7 +46,6 @@ static int dm_test_clk_base(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_clk_base,UTF_SCAN_FDT );static int dm_test_clk (struct unit_test_state *uts)
test/dm/clk_ccf.c +0 -1
@@ -208,5 +208,4 @@ static int dm_test_clk_ccf(struct unit_test_state *uts)return 1 ; } -DM_TEST (dm_test_clk_ccf,UTF_SCAN_FDT );
test/dm/core.c +0 -1
@@ -188,7 +188,6 @@ static int dm_test_compare_node_name(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_compare_node_name,UTF_SCAN_PDATA );/* Test that binding with uclass plat setting occurs correctly */
test/dm/cpu.c +0 -1
@@ -47,5 +47,4 @@ static int dm_test_cpu(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_cpu,UTF_SCAN_FDT );
test/dm/dsa.c +0 -2
@@ -56,7 +56,6 @@ static int dm_test_dsa_probe(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_dsa_probe,UTF_SCAN_FDT );/* This test sends ping requests with the local address through each DSA port
@@ -78,5 +77,4 @@ static int dm_test_dsa(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_dsa,UTF_SCAN_FDT );
test/dm/dsi_host.c +0 -1
@@ -54,5 +54,4 @@ static int dm_test_dsi_host(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_dsi_host,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/eth.c +0 -4
@@ -528,7 +528,6 @@ static int dm_test_eth_async_arp_reply(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_eth_async_arp_reply,UTF_SCAN_FDT ); static int sb_check_ping_reply(struct udevice *dev, void *packet,
@@ -613,7 +612,6 @@ static int dm_test_eth_async_ping_reply(struct unit_test_state *uts)return 0 ; } -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
test/dm/extcon.c +0 -1
@@ -17,5 +17,4 @@ static int dm_test_extcon(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_extcon,UTF_SCAN_FDT );
test/dm/ffa.c +0 -2
@@ -197,7 +197,6 @@ static int dm_test_ffa_ack(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_ffa_ack,UTF_SCAN_FDT |UTF_CONSOLE_REC );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,UTF_SCAN_FDT |UTF_CONSOLE_REC );
test/dm/fpga.c +0 -1
@@ -16,5 +16,4 @@ static int dm_test_fpga(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_fpga,UTF_SCAN_FDT );
test/dm/hwspinlock.c +0 -1
@@ -36,5 +36,4 @@ static int dm_test_hwspinlock_base(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_hwspinlock_base,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/i2c.c +0 -1
@@ -301,7 +301,6 @@ static int dm_test_i2c_addr_offset(struct unit_test_state *uts)return 0 ; } -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)
test/dm/mdio.c +0 -1
@@ -53,5 +53,4 @@ static int dm_test_mdio(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_mdio,UTF_SCAN_FDT );
test/dm/mdio_mux.c +0 -1
@@ -76,5 +76,4 @@ static int dm_test_mdio_mux(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_mdio_mux,UTF_SCAN_FDT );
test/dm/memory.c +0 -1
@@ -17,5 +17,4 @@ static int dm_test_memory(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_memory,UTF_SCAN_FDT );
test/dm/misc.c +0 -1
@@ -79,5 +79,4 @@ static int dm_test_misc(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_misc,UTF_SCAN_FDT );
test/dm/nop.c +0 -1
@@ -69,5 +69,4 @@ static int dm_test_nop(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_nop,UTF_FLAT_TREE |UTF_SCAN_FDT );
test/dm/nvmxip.c +0 -1
@@ -142,5 +142,4 @@ static int dm_test_nvmxip(struct unit_test_state *uts)return CMD_RET_SUCCESS ; } -DM_TEST (dm_test_nvmxip,UTF_SCAN_FDT |UTF_CONSOLE_REC );
test/dm/osd.c +0 -2
@@ -130,7 +130,6 @@ static int dm_test_osd_basics(struct unit_test_state *uts)return 0 ; } -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,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/pci_ep.c +0 -1
@@ -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,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/pmic.c +0 -1
@@ -52,7 +52,6 @@ static int dm_test_power_pmic_mc34708_get(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_power_pmic_mc34708_get,UTF_SCAN_FDT );/* Test PMIC I/O */
test/dm/qfw.c +0 -2
@@ -23,7 +23,6 @@ static int dm_test_qfw_cpus(struct unit_test_state *uts)return 0 ; } -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,UTF_SCAN_PDATA );
test/dm/reboot-mode.c +0 -2
@@ -39,7 +39,6 @@ static int dm_test_reboot_mode_gpio(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_reboot_mode_gpio,UTF_PROBE_TEST |UTF_SCAN_FDT |UTF_FLAT_TREE );
@@ -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,UTF_PROBE_TEST |UTF_SCAN_FDT |UTF_FLAT_TREE );
test/dm/regmap.c +0 -1
@@ -157,7 +157,6 @@ static int dm_test_regmap_getset(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_regmap_getset,UTF_SCAN_PDATA |UTF_SCAN_FDT );/* Read polling test */
test/dm/reset.c +0 -1
@@ -66,7 +66,6 @@ static int dm_test_reset_base(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_reset_base,UTF_SCAN_FDT );static int dm_test_reset (struct unit_test_state *uts)
test/dm/scmi.c +0 -3
@@ -202,7 +202,6 @@ static int dm_test_scmi_base(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_scmi_base,UTF_SCAN_FDT );static int dm_test_scmi_cmd (struct unit_test_state *uts)
@@ -282,7 +281,6 @@ static int dm_test_scmi_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_scmi_cmd,UTF_SCAN_FDT );static int dm_test_scmi_power_domains (struct unit_test_state *uts)
@@ -388,7 +386,6 @@ 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,UTF_SCAN_FDT );static int dm_test_scmi_clocks (struct unit_test_state *uts)
test/dm/serial.c +0 -1
@@ -87,5 +87,4 @@ static int dm_test_serial(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_serial,UTF_SCAN_FDT );
test/dm/sm.c +0 -1
@@ -60,5 +60,4 @@ static int dm_test_sm(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_sm,UTF_SCAN_FDT );
test/dm/soc.c +0 -1
@@ -115,5 +115,4 @@ static int dm_test_soc(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_soc,UTF_SCAN_FDT );
test/dm/sysinfo.c +0 -1
@@ -59,5 +59,4 @@ static int dm_test_sysinfo(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_sysinfo,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/dm/tag.c +0 -4
@@ -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 );
test/dm/tee.c +0 -1
@@ -215,5 +215,4 @@ out:return rc; } -DM_TEST (dm_test_tee,UTF_SCAN_FDT );
test/dm/test-fdt.c +0 -1
@@ -1224,5 +1224,4 @@ static int dm_test_read_resource(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_read_resource,UTF_SCAN_PDATA |UTF_SCAN_FDT );
test/env/hashtable.c +0 -2
@@ -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 );
test/lib/asn1.c +0 -3
@@ -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 */
test/lib/efi_device_path.c +0 -1
@@ -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 );
test/lib/efi_image_region.c +0 -2
@@ -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 );
test/lib/hexdump.c +0 -3
@@ -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 );
test/lib/lmb.c +0 -1
@@ -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)
test/lib/rsa.c +0 -2
@@ -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 */
test/lib/sscanf.c +0 -1
@@ -169,5 +169,4 @@ static int lib_sscanf(struct unit_test_state *uts)return 0 ; } -LIB_TEST (lib_sscanf,0 );
test/lib/string.c +0 -3
@@ -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() */
test/lib/test_aes.c +0 -1
@@ -163,5 +163,4 @@ static int lib_test_aes(struct unit_test_state *uts)return ret; } -LIB_TEST (lib_test_aes,0 );
test/lib/test_crc8.c +0 -1
@@ -25,5 +25,4 @@ static int lib_crc8(struct unit_test_state *uts) {return 0 ; } -LIB_TEST (lib_crc8,0 );
test/lib/test_crypt.c +0 -1
@@ -59,5 +59,4 @@ static int lib_crypt(struct unit_test_state *uts)return CMD_RET_SUCCESS ; } -LIB_TEST (lib_crypt,0 );
test/lib/test_errno_str.c +0 -1
@@ -41,5 +41,4 @@ static int lib_errno_str(struct unit_test_state *uts)return 0 ; } -LIB_TEST (lib_errno_str,0 );
test/lib/test_print.c +0 -2
@@ -41,7 +41,6 @@ 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 ); static int test_print_size(struct unit_test_state *uts,
@@ -74,5 +73,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 );
test/lib/uuid.c +0 -1
@@ -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 );
Signature · 1 line
2.34.1
PATCH 5/21 test: Rename UTF_CONSOLE_REC to UTF_CONSOLE
In reply to Simon GlassThe _REC suffix doesn't add much. Really what we want to know is whether the test uses the console, so rename this flag.
---
doc/develop/tests_writing.rst | 4 ++-- include/dm/test.h | 2 +- include/test/test.h | 2 +- test/boot/bootflow.c | 4 ++-- test/boot/upl.c | 6 +++--- test/cmd/addrmap.c | 2 +- test/cmd/armffa.c | 2 +- test/cmd/bdinfo.c | 8 ++++---- test/cmd/exit.c | 2 +- test/cmd/fdt.c | 38 +++++++++++++++++------------------ test/cmd/font.c | 2 +- test/cmd/history.c | 2 +- test/cmd/loadm.c | 4 ++-- test/cmd/mbr.c | 4 ++-- test/cmd/mem_search.c | 18 ++++++++--------- test/cmd/pci_mps.c | 2 +- test/cmd/pwm.c | 2 +- test/cmd/rw.c | 2 +- test/cmd/seama.c | 6 +++--- test/cmd/setexpr.c | 22 ++++++++++---------- test/cmd/temperature.c | 2 +- test/dm/ffa.c | 4 ++-- test/dm/nvmxip.c | 2 +- test/dm/rkmtd.c | 2 +- test/dm/rng.c | 2 +- test/log/log_filter.c | 4 ++-- test/log/log_test.c | 32 ++++++++++++++--------------- test/print_ut.c | 6 +++--- test/test-main.c | 2 +- 29 files changed, 95 insertions(+), 95 deletions(-)
doc/develop/tests_writing.rst +2 -2
@@ -167,7 +167,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, UTF_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
@@ -266,7 +266,7 @@ with the suite. For example, to add a new mem_search test:: return 0; } - MEM_TEST(mem_test_ms_new_thing, UTF_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.
include/dm/test.h +1 -1
@@ -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, UTF_DM | UTF_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
include/test/test.h +1 -1
@@ -61,7 +61,7 @@ enum ut_flags {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_REC =BIT (5 ),/* needs console recording */ +UTF_CONSOLE =BIT (5 ),/* needs console recording */ /* do extra driver model init and uninit */ UTF_DM =BIT (6 ), UTF_OTHER_FDT = BIT(7), /* read in other device tree */
test/boot/bootflow.c +2 -2
@@ -721,7 +721,7 @@ static int bootflow_scan_menu(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_scan_menu,UTF_DM |UTF_SCAN_FDT |UTF_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)
@@ -767,7 +767,7 @@ static int bootflow_scan_menu_boot(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_scan_menu_boot,UTF_DM |UTF_SCAN_FDT |UTF_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)
test/boot/upl.c +3 -3
@@ -374,7 +374,7 @@ static int upl_test_info(struct unit_test_state *uts)return 0 ; } -UPL_TEST (upl_test_info,UTF_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,UTF_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,UTF_CONSOLE_REC |UTF_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[]) {
test/cmd/addrmap.c +1 -1
@@ -24,7 +24,7 @@ static int addrmap_test_basic(struct unit_test_state *uts)return 0 ; } -ADDRMAP_TEST (addrmap_test_basic,UTF_CONSOLE_REC ); +ADDRMAP_TEST (addrmap_test_basic,UTF_CONSOLE );int do_ut_addrmap (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/armffa.c +1 -1
@@ -28,4 +28,4 @@ static int dm_test_armffa_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_armffa_cmd,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_armffa_cmd,UTF_SCAN_FDT |UTF_CONSOLE );
test/cmd/bdinfo.c +4 -4
@@ -244,7 +244,7 @@ static int bdinfo_test_full(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_full,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_full,UTF_CONSOLE );static int bdinfo_test_help (struct unit_test_state *uts) {
@@ -265,7 +265,7 @@ static int bdinfo_test_help(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_help,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_help,UTF_CONSOLE );static int bdinfo_test_memory (struct unit_test_state *uts) {
@@ -280,7 +280,7 @@ static int bdinfo_test_memory(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_memory,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_memory,UTF_CONSOLE );static int bdinfo_test_eth (struct unit_test_state *uts) {
@@ -295,7 +295,7 @@ static int bdinfo_test_eth(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_eth,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_eth,UTF_CONSOLE );int do_ut_bdinfo (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/exit.c +1 -1
@@ -121,7 +121,7 @@ static int cmd_exit_test(struct unit_test_state *uts)return 0 ; } -EXIT_TEST (cmd_exit_test,UTF_CONSOLE_REC ); +EXIT_TEST (cmd_exit_test,UTF_CONSOLE );int do_ut_exit (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/fdt.c +19 -19
@@ -213,7 +213,7 @@ static int fdt_test_addr(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_addr,UTF_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)
@@ -247,7 +247,7 @@ static int fdt_test_addr_resize(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_addr_resize,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_addr_resize,UTF_CONSOLE );static int fdt_test_move (struct unit_test_state *uts) {
@@ -281,7 +281,7 @@ static int fdt_test_move(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_move,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_move,UTF_CONSOLE );static int fdt_test_resize (struct unit_test_state *uts) {
@@ -305,7 +305,7 @@ static int fdt_test_resize(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_resize,UTF_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)
@@ -442,13 +442,13 @@ static int fdt_test_print(struct unit_test_state *uts) {return fdt_test_print_list (uts, true); } -FDT_TEST (fdt_test_print,UTF_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,UTF_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,
@@ -554,7 +554,7 @@ static int fdt_test_get_value(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_value,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_get_value,UTF_CONSOLE );static int fdt_test_get_name (struct unit_test_state *uts) {
@@ -633,7 +633,7 @@ static int fdt_test_get_name(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_name,UTF_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)
@@ -700,7 +700,7 @@ static int fdt_test_get_addr(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_addr,UTF_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,
@@ -787,7 +787,7 @@ static int fdt_test_get_size(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_size,UTF_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,
@@ -929,7 +929,7 @@ static int fdt_test_set(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_set,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_set,UTF_CONSOLE );static int fdt_test_mknode (struct unit_test_state *uts) {
@@ -997,7 +997,7 @@ static int fdt_test_mknode(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_mknode,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_mknode,UTF_CONSOLE );static int fdt_test_rm (struct unit_test_state *uts) {
@@ -1081,7 +1081,7 @@ static int fdt_test_rm(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_rm,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_rm,UTF_CONSOLE );static int fdt_test_bootcpu (struct unit_test_state *uts) {
@@ -1114,7 +1114,7 @@ static int fdt_test_bootcpu(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_bootcpu,UTF_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)
@@ -1173,7 +1173,7 @@ static int fdt_test_header(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_header,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_header,UTF_CONSOLE );static int fdt_test_memory_cells (struct unit_test_state *uts,const unsigned int cells)
@@ -1256,7 +1256,7 @@ static int fdt_test_memory(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_memory,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_memory,UTF_CONSOLE );static int fdt_test_rsvmem (struct unit_test_state *uts) {
@@ -1319,7 +1319,7 @@ static int fdt_test_rsvmem(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_rsvmem,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_rsvmem,UTF_CONSOLE );static int fdt_test_chosen (struct unit_test_state *uts) {
@@ -1375,7 +1375,7 @@ static int fdt_test_chosen(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_chosen,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_chosen,UTF_CONSOLE );static int fdt_test_apply (struct unit_test_state *uts) {
@@ -1527,7 +1527,7 @@ static int fdt_test_apply(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_apply,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_apply,UTF_CONSOLE );int do_ut_fdt (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/font.c +1 -1
@@ -69,7 +69,7 @@ static int font_test_base(struct unit_test_state *uts)return 0 ; } -FONT_TEST (font_test_base,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE_REC | +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[])
test/cmd/history.c +1 -1
@@ -45,4 +45,4 @@ static int lib_test_history(struct unit_test_state *uts)return 0 ; } -LIB_TEST (lib_test_history,UTF_CONSOLE_REC ); +LIB_TEST (lib_test_history,UTF_CONSOLE );
test/cmd/loadm.c +2 -2
@@ -41,7 +41,7 @@ static int loadm_test_params(struct unit_test_state *uts)return 0 ; } -LOADM_TEST (loadm_test_params,UTF_CONSOLE_REC ); +LOADM_TEST (loadm_test_params,UTF_CONSOLE );static int loadm_test_load (struct unit_test_state *uts) {
@@ -59,7 +59,7 @@ static int loadm_test_load (struct unit_test_state *uts)return 0 ; } -LOADM_TEST (loadm_test_load,UTF_CONSOLE_REC ); +LOADM_TEST (loadm_test_load,UTF_CONSOLE );int do_ut_loadm (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/mbr.c +2 -2
@@ -465,7 +465,7 @@ static int mbr_test_run(struct unit_test_state *uts) }/* Declare mbr test */ -UNIT_TEST (mbr_test_run,UTF_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,4 +479,4 @@ static int dm_test_cmd_mbr(struct unit_test_state *uts) {return mbr_test_run (uts); } -DM_TEST (dm_test_cmd_mbr,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_cmd_mbr,UTF_SCAN_FDT |UTF_CONSOLE );
test/cmd/mem_search.c +9 -9
@@ -43,7 +43,7 @@ static int mem_test_ms_b(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_b,UTF_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)
@@ -68,7 +68,7 @@ static int mem_test_ms_w(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_w,UTF_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)
@@ -102,7 +102,7 @@ static int mem_test_ms_l(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_l,UTF_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)
@@ -152,7 +152,7 @@ static int mem_test_ms_cont(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_cont,UTF_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)
@@ -196,7 +196,7 @@ static int mem_test_ms_cont_end(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_cont_end,UTF_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 +225,7 @@ static int mem_test_ms_mult(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_mult,UTF_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)
@@ -268,7 +268,7 @@ static int mem_test_ms_s(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_s,UTF_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)
@@ -297,7 +297,7 @@ static int mem_test_ms_limit(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_limit,UTF_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)
@@ -321,4 +321,4 @@ static int mem_test_ms_quiet(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_quiet,UTF_CONSOLE_REC ); +MEM_TEST (mem_test_ms_quiet,UTF_CONSOLE );
test/cmd/pci_mps.c +1 -1
@@ -27,7 +27,7 @@ static int test_pci_mps_safe(struct unit_test_state *uts)return 0 ; } -PCI_MPS_TEST (test_pci_mps_safe,UTF_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[])
test/cmd/pwm.c +1 -1
@@ -71,4 +71,4 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_pwm_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_pwm_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE );
test/cmd/rw.c +1 -1
@@ -99,4 +99,4 @@ static int dm_test_read_write(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_read_write,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_read_write,UTF_SCAN_FDT |UTF_CONSOLE );
test/cmd/seama.c +3 -3
@@ -26,7 +26,7 @@ static int seama_test_noargs(struct unit_test_state *uts)ut_assert_console_end ();return 0 ; } -SEAMA_TEST (seama_test_noargs,UTF_CONSOLE_REC ); +SEAMA_TEST (seama_test_noargs,UTF_CONSOLE );static int seama_test_addr (struct unit_test_state *uts) {
@@ -42,7 +42,7 @@ static int seama_test_addr(struct unit_test_state *uts)ut_assert_console_end ();return 0 ; } -SEAMA_TEST (seama_test_addr,UTF_CONSOLE_REC ); +SEAMA_TEST (seama_test_addr,UTF_CONSOLE );static int seama_test_index (struct unit_test_state *uts) {
@@ -58,7 +58,7 @@ static int seama_test_index(struct unit_test_state *uts)ut_assert_console_end ();return 0 ; } -SEAMA_TEST (seama_test_index,UTF_CONSOLE_REC ); +SEAMA_TEST (seama_test_index,UTF_CONSOLE );int do_ut_seama (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {
test/cmd/setexpr.c +11 -11
@@ -63,7 +63,7 @@ static int setexpr_test_int(struct unit_test_state *uts)return 0 ; } -SETEXPR_TEST (setexpr_test_int,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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)
@@ -376,7 +376,7 @@ static int setexpr_test_str_oper(struct unit_test_state *uts)return 0 ; } -SETEXPR_TEST (setexpr_test_str_oper,UTF_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 +396,7 @@ static int setexpr_test_str_long(struct unit_test_state *uts)return 0 ; } -SETEXPR_TEST (setexpr_test_str_long,UTF_CONSOLE_REC ); +SETEXPR_TEST (setexpr_test_str_long,UTF_CONSOLE );#ifdef CONFIG_CMD_SETEXPR_FMT /* Test 'setexpr' command with simply setting integers */
@@ -478,7 +478,7 @@ static int setexpr_test_fmt(struct unit_test_state *uts) return 0; } -SETEXPR_TEST (setexpr_test_fmt,UTF_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[])
test/cmd/temperature.c +1 -1
@@ -34,4 +34,4 @@ static int dm_test_cmd_temperature(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_cmd_temperature,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_cmd_temperature,UTF_SCAN_FDT |UTF_CONSOLE );
test/dm/ffa.c +2 -2
@@ -197,7 +197,7 @@ static int dm_test_ffa_ack(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_ffa_ack,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_ffa_ack,UTF_SCAN_FDT |UTF_CONSOLE );static int dm_test_ffa_nack (struct unit_test_state *uts) {
@@ -255,4 +255,4 @@ static int dm_test_ffa_nack(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_ffa_nack,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_ffa_nack,UTF_SCAN_FDT |UTF_CONSOLE );
test/dm/nvmxip.c +1 -1
@@ -142,4 +142,4 @@ static int dm_test_nvmxip(struct unit_test_state *uts)return CMD_RET_SUCCESS ; } -DM_TEST (dm_test_nvmxip,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_nvmxip,UTF_SCAN_FDT |UTF_CONSOLE );
test/dm/rkmtd.c +1 -1
@@ -196,4 +196,4 @@ static int dm_test_rkmtd_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_rkmtd_cmd,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_rkmtd_cmd,UTF_SCAN_FDT |UTF_CONSOLE );
test/dm/rng.c +1 -1
@@ -52,4 +52,4 @@ static int dm_test_rng_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_rng_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_rng_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE );
test/log/log_filter.c +2 -2
@@ -24,7 +24,7 @@ static int log_test_filter_invalid(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_filter_invalid,UTF_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)
@@ -105,4 +105,4 @@ static int log_test_filter(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_filter,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_filter,UTF_CONSOLE );
test/log/log_test.c +16 -16
@@ -121,7 +121,7 @@ int log_test_cat_allow(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_cat_allow,UTF_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)
@@ -141,7 +141,7 @@ int log_test_cat_deny_implicit(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_cat_deny_implicit,UTF_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)
@@ -162,7 +162,7 @@ int log_test_file(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_file,UTF_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)
@@ -179,7 +179,7 @@ int log_test_file_second(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_file_second,UTF_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)
@@ -197,7 +197,7 @@ int log_test_file_mid(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_file_mid,UTF_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)
@@ -215,7 +215,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,UTF_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)
@@ -235,7 +235,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,UTF_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)
@@ -258,7 +258,7 @@ int log_test_triple(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt3));return 0 ; } -LOG_TEST_FLAGS (log_test_triple,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_triple,UTF_CONSOLE );int do_log_test_helpers (struct unit_test_state *uts) {
@@ -292,7 +292,7 @@ int log_test_helpers(struct unit_test_state *uts) gd->log_fmt =log_get_default_format ();return ret; } -LOG_TEST_FLAGS (log_test_helpers,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_helpers,UTF_CONSOLE );int do_log_test_disable (struct unit_test_state *uts) {
@@ -319,7 +319,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,UTF_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)
@@ -343,7 +343,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,UTF_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)
@@ -364,7 +364,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,UTF_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)
@@ -387,7 +387,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,UTF_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)
@@ -410,7 +410,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,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_min,UTF_CONSOLE );/* Check dropped traces */ int log_test_dropped (struct unit_test_state *uts)
@@ -432,7 +432,7 @@ int log_test_dropped(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_dropped,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_dropped,UTF_CONSOLE );/* Check log_buffer() */ int log_test_buffer (struct unit_test_state *uts)
@@ -459,4 +459,4 @@ int log_test_buffer(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_buffer,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_buffer,UTF_CONSOLE );
test/print_ut.c +3 -3
@@ -246,7 +246,7 @@ static int print_display_buffer(struct unit_test_state *uts)return 0 ; } -PRINT_TEST (print_display_buffer,UTF_CONSOLE_REC ); +PRINT_TEST (print_display_buffer,UTF_CONSOLE );static int print_hexdump_line (struct unit_test_state *uts) {
@@ -272,7 +272,7 @@ static int print_hexdump_line(struct unit_test_state *uts)return 0 ; } -PRINT_TEST (print_hexdump_line,UTF_CONSOLE_REC ); +PRINT_TEST (print_hexdump_line,UTF_CONSOLE );static int print_do_hex_dump (struct unit_test_state *uts) {
@@ -365,7 +365,7 @@ static int print_do_hex_dump(struct unit_test_state *uts)return 0 ; } -PRINT_TEST (print_do_hex_dump,UTF_CONSOLE_REC ); +PRINT_TEST (print_do_hex_dump,UTF_CONSOLE );static int snprint (struct unit_test_state *uts) {
test/test-main.c +1 -1
@@ -333,7 +333,7 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) } } -if (test->flags &UTF_CONSOLE_REC ) { +if (test->flags &UTF_CONSOLE ) {int ret =console_record_reset_enable ();if (ret) {
Signature · 1 line
2.34.1
Re: [PATCH 05/21] test: Rename UTF_CONSOLE_REC to UTF_CONSOLE
Hi Simon,
Thank you for the patch.
Quoted 4 lines · Simon Glass
The
_RECsuffix doesn't add much. Really what we want to know is whether the test uses the console, so rename this flag.Signed-off-by Simon Glass <[email protected]>
On next: commit 158cf0270cb6 ("Merge tag 'v2024.10-rc3' into next"), this does not build:
$ ./test/py/test.py --bd sandbox --build -k test_ut
../test/env/cmd_ut_env.c:37:28: error: ‘UT_TESTF_CONSOLE_REC’ undeclared here (not in a function)
37 | ENV_TEST(env_test_env_cmd, UT_TESTF_CONSOLE_REC);
| ^~~~~~~~~~~~~~~~~~~~Since next has:
https://source.denx.de/u-boot/u-boot/-/commit/2a521d01e62c012f627d426a4c43082b6402928d
We also need to update:test/env/cmd_ut_env.c
With that fixed:
Quoted 965 lines
---
doc/develop/tests_writing.rst | 4 ++-- include/dm/test.h | 2 +- include/test/test.h | 2 +- test/boot/bootflow.c | 4 ++-- test/boot/upl.c | 6 +++--- test/cmd/addrmap.c | 2 +- test/cmd/armffa.c | 2 +- test/cmd/bdinfo.c | 8 ++++---- test/cmd/exit.c | 2 +- test/cmd/fdt.c | 38 +++++++++++++++++------------------ test/cmd/font.c | 2 +- test/cmd/history.c | 2 +- test/cmd/loadm.c | 4 ++-- test/cmd/mbr.c | 4 ++-- test/cmd/mem_search.c | 18 ++++++++--------- test/cmd/pci_mps.c | 2 +- test/cmd/pwm.c | 2 +- test/cmd/rw.c | 2 +- test/cmd/seama.c | 6 +++--- test/cmd/setexpr.c | 22 ++++++++++---------- test/cmd/temperature.c | 2 +- test/dm/ffa.c | 4 ++-- test/dm/nvmxip.c | 2 +- test/dm/rkmtd.c | 2 +- test/dm/rng.c | 2 +- test/log/log_filter.c | 4 ++-- test/log/log_test.c | 32 ++++++++++++++--------------- test/print_ut.c | 6 +++--- test/test-main.c | 2 +- 29 files changed, 95 insertions(+), 95 deletions(-)doc/develop/tests_writing.rst +2
-2@@ -167,7 +167,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, UTF_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@@ -266,7 +266,7 @@ with the suite. For example, to add a new mem_search test:: return 0; } - MEM_TEST(mem_test_ms_new_thing, UTF_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.include/dm/test.h +1
-1@@ -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, UTF_DM | UTF_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 include/test/test.h +1
-1@@ -61,7 +61,7 @@ enum ut_flags {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_REC =BIT (5 ),/* needs console recording */ +UTF_CONSOLE =BIT (5 ),/* needs console recording */ /* do extra driver model init and uninit */ UTF_DM =BIT (6 ), UTF_OTHER_FDT = BIT(7), /* read in other device tree */test/boot/bootflow.c +2
-2@@ -721,7 +721,7 @@ static int bootflow_scan_menu(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_scan_menu,UTF_DM |UTF_SCAN_FDT |UTF_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)@@ -767,7 +767,7 @@ static int bootflow_scan_menu_boot(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_scan_menu_boot,UTF_DM |UTF_SCAN_FDT |UTF_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)test/boot/upl.c +3
-3@@ -374,7 +374,7 @@ static int upl_test_info(struct unit_test_state *uts)return 0 ; } -UPL_TEST (upl_test_info,UTF_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,UTF_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,UTF_CONSOLE_REC |UTF_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[]) {test/cmd/addrmap.c +1
-1@@ -24,7 +24,7 @@ static int addrmap_test_basic(struct unit_test_state *uts)return 0 ; } -ADDRMAP_TEST (addrmap_test_basic,UTF_CONSOLE_REC ); +ADDRMAP_TEST (addrmap_test_basic,UTF_CONSOLE );int do_ut_addrmap (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {test/cmd/armffa.c +1
-1@@ -28,4 +28,4 @@ static int dm_test_armffa_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_armffa_cmd,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_armffa_cmd,UTF_SCAN_FDT |UTF_CONSOLE );test/cmd/bdinfo.c +4
-4@@ -244,7 +244,7 @@ static int bdinfo_test_full(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_full,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_full,UTF_CONSOLE );static int bdinfo_test_help (struct unit_test_state *uts) {@@ -265,7 +265,7 @@ static int bdinfo_test_help(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_help,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_help,UTF_CONSOLE );static int bdinfo_test_memory (struct unit_test_state *uts) {@@ -280,7 +280,7 @@ static int bdinfo_test_memory(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_memory,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_memory,UTF_CONSOLE );static int bdinfo_test_eth (struct unit_test_state *uts) {@@ -295,7 +295,7 @@ static int bdinfo_test_eth(struct unit_test_state *uts)return 0 ; } -BDINFO_TEST (bdinfo_test_eth,UTF_CONSOLE_REC ); +BDINFO_TEST (bdinfo_test_eth,UTF_CONSOLE );int do_ut_bdinfo (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {test/cmd/exit.c +1
-1@@ -121,7 +121,7 @@ static int cmd_exit_test(struct unit_test_state *uts)return 0 ; } -EXIT_TEST (cmd_exit_test,UTF_CONSOLE_REC ); +EXIT_TEST (cmd_exit_test,UTF_CONSOLE );int do_ut_exit (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {test/cmd/fdt.c +19
-19@@ -213,7 +213,7 @@ static int fdt_test_addr(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_addr,UTF_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)@@ -247,7 +247,7 @@ static int fdt_test_addr_resize(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_addr_resize,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_addr_resize,UTF_CONSOLE );static int fdt_test_move (struct unit_test_state *uts) {@@ -281,7 +281,7 @@ static int fdt_test_move(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_move,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_move,UTF_CONSOLE );static int fdt_test_resize (struct unit_test_state *uts) {@@ -305,7 +305,7 @@ static int fdt_test_resize(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_resize,UTF_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)@@ -442,13 +442,13 @@ static int fdt_test_print(struct unit_test_state *uts) {return fdt_test_print_list (uts, true); } -FDT_TEST (fdt_test_print,UTF_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,UTF_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,@@ -554,7 +554,7 @@ static int fdt_test_get_value(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_value,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_get_value,UTF_CONSOLE );static int fdt_test_get_name (struct unit_test_state *uts) {@@ -633,7 +633,7 @@ static int fdt_test_get_name(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_name,UTF_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)@@ -700,7 +700,7 @@ static int fdt_test_get_addr(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_addr,UTF_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,@@ -787,7 +787,7 @@ static int fdt_test_get_size(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_get_size,UTF_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,@@ -929,7 +929,7 @@ static int fdt_test_set(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_set,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_set,UTF_CONSOLE );static int fdt_test_mknode (struct unit_test_state *uts) {@@ -997,7 +997,7 @@ static int fdt_test_mknode(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_mknode,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_mknode,UTF_CONSOLE );static int fdt_test_rm (struct unit_test_state *uts) {@@ -1081,7 +1081,7 @@ static int fdt_test_rm(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_rm,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_rm,UTF_CONSOLE );static int fdt_test_bootcpu (struct unit_test_state *uts) {@@ -1114,7 +1114,7 @@ static int fdt_test_bootcpu(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_bootcpu,UTF_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)@@ -1173,7 +1173,7 @@ static int fdt_test_header(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_header,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_header,UTF_CONSOLE );static int fdt_test_memory_cells (struct unit_test_state *uts,const unsigned int cells)@@ -1256,7 +1256,7 @@ static int fdt_test_memory(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_memory,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_memory,UTF_CONSOLE );static int fdt_test_rsvmem (struct unit_test_state *uts) {@@ -1319,7 +1319,7 @@ static int fdt_test_rsvmem(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_rsvmem,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_rsvmem,UTF_CONSOLE );static int fdt_test_chosen (struct unit_test_state *uts) {@@ -1375,7 +1375,7 @@ static int fdt_test_chosen(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_chosen,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_chosen,UTF_CONSOLE );static int fdt_test_apply (struct unit_test_state *uts) {@@ -1527,7 +1527,7 @@ static int fdt_test_apply(struct unit_test_state *uts)return 0 ; } -FDT_TEST (fdt_test_apply,UTF_CONSOLE_REC ); +FDT_TEST (fdt_test_apply,UTF_CONSOLE );int do_ut_fdt (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {test/cmd/font.c +1
-1@@ -69,7 +69,7 @@ static int font_test_base(struct unit_test_state *uts)return 0 ; } -FONT_TEST (font_test_base,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE_REC | +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[])test/cmd/history.c +1
-1@@ -45,4 +45,4 @@ static int lib_test_history(struct unit_test_state *uts)return 0 ; } -LIB_TEST (lib_test_history,UTF_CONSOLE_REC ); +LIB_TEST (lib_test_history,UTF_CONSOLE );test/cmd/loadm.c +2
-2@@ -41,7 +41,7 @@ static int loadm_test_params(struct unit_test_state *uts)return 0 ; } -LOADM_TEST (loadm_test_params,UTF_CONSOLE_REC ); +LOADM_TEST (loadm_test_params,UTF_CONSOLE );static int loadm_test_load (struct unit_test_state *uts) {@@ -59,7 +59,7 @@ static int loadm_test_load (struct unit_test_state *uts)return 0 ; } -LOADM_TEST (loadm_test_load,UTF_CONSOLE_REC ); +LOADM_TEST (loadm_test_load,UTF_CONSOLE );int do_ut_loadm (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {test/cmd/mbr.c +2
-2@@ -465,7 +465,7 @@ static int mbr_test_run(struct unit_test_state *uts) }/* Declare mbr test */ -UNIT_TEST (mbr_test_run,UTF_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,4 +479,4 @@ static int dm_test_cmd_mbr(struct unit_test_state *uts) {return mbr_test_run (uts); } -DM_TEST (dm_test_cmd_mbr,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_cmd_mbr,UTF_SCAN_FDT |UTF_CONSOLE );test/cmd/mem_search.c +9
-9@@ -43,7 +43,7 @@ static int mem_test_ms_b(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_b,UTF_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)@@ -68,7 +68,7 @@ static int mem_test_ms_w(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_w,UTF_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)@@ -102,7 +102,7 @@ static int mem_test_ms_l(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_l,UTF_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)@@ -152,7 +152,7 @@ static int mem_test_ms_cont(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_cont,UTF_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)@@ -196,7 +196,7 @@ static int mem_test_ms_cont_end(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_cont_end,UTF_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 +225,7 @@ static int mem_test_ms_mult(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_mult,UTF_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)@@ -268,7 +268,7 @@ static int mem_test_ms_s(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_s,UTF_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)@@ -297,7 +297,7 @@ static int mem_test_ms_limit(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_limit,UTF_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)@@ -321,4 +321,4 @@ static int mem_test_ms_quiet(struct unit_test_state *uts)return 0 ; } -MEM_TEST (mem_test_ms_quiet,UTF_CONSOLE_REC ); +MEM_TEST (mem_test_ms_quiet,UTF_CONSOLE );test/cmd/pci_mps.c +1
-1@@ -27,7 +27,7 @@ static int test_pci_mps_safe(struct unit_test_state *uts)return 0 ; } -PCI_MPS_TEST (test_pci_mps_safe,UTF_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[])test/cmd/pwm.c +1
-1@@ -71,4 +71,4 @@ static int dm_test_pwm_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_pwm_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_pwm_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE );test/cmd/rw.c +1
-1@@ -99,4 +99,4 @@ static int dm_test_read_write(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_read_write,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_read_write,UTF_SCAN_FDT |UTF_CONSOLE );test/cmd/seama.c +3
-3@@ -26,7 +26,7 @@ static int seama_test_noargs(struct unit_test_state *uts)ut_assert_console_end ();return 0 ; } -SEAMA_TEST (seama_test_noargs,UTF_CONSOLE_REC ); +SEAMA_TEST (seama_test_noargs,UTF_CONSOLE );static int seama_test_addr (struct unit_test_state *uts) {@@ -42,7 +42,7 @@ static int seama_test_addr(struct unit_test_state *uts)ut_assert_console_end ();return 0 ; } -SEAMA_TEST (seama_test_addr,UTF_CONSOLE_REC ); +SEAMA_TEST (seama_test_addr,UTF_CONSOLE );static int seama_test_index (struct unit_test_state *uts) {@@ -58,7 +58,7 @@ static int seama_test_index(struct unit_test_state *uts)ut_assert_console_end ();return 0 ; } -SEAMA_TEST (seama_test_index,UTF_CONSOLE_REC ); +SEAMA_TEST (seama_test_index,UTF_CONSOLE );int do_ut_seama (struct cmd_tbl *cmdtp,int flag,int argc,char *const argv[]) {test/cmd/setexpr.c +11
-11@@ -63,7 +63,7 @@ static int setexpr_test_int(struct unit_test_state *uts)return 0 ; } -SETEXPR_TEST (setexpr_test_int,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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,UTF_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)@@ -376,7 +376,7 @@ static int setexpr_test_str_oper(struct unit_test_state *uts)return 0 ; } -SETEXPR_TEST (setexpr_test_str_oper,UTF_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 +396,7 @@ static int setexpr_test_str_long(struct unit_test_state *uts)return 0 ; } -SETEXPR_TEST (setexpr_test_str_long,UTF_CONSOLE_REC ); +SETEXPR_TEST (setexpr_test_str_long,UTF_CONSOLE );#ifdef CONFIG_CMD_SETEXPR_FMT /* Test 'setexpr' command with simply setting integers */ @@ -478,7 +478,7 @@ static int setexpr_test_fmt(struct unit_test_state *uts) return 0; } -SETEXPR_TEST (setexpr_test_fmt,UTF_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[])test/cmd/temperature.c +1
-1@@ -34,4 +34,4 @@ static int dm_test_cmd_temperature(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_cmd_temperature,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_cmd_temperature,UTF_SCAN_FDT |UTF_CONSOLE );test/dm/ffa.c +2
-2@@ -197,7 +197,7 @@ static int dm_test_ffa_ack(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_ffa_ack,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_ffa_ack,UTF_SCAN_FDT |UTF_CONSOLE );static int dm_test_ffa_nack (struct unit_test_state *uts) {@@ -255,4 +255,4 @@ static int dm_test_ffa_nack(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_ffa_nack,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_ffa_nack,UTF_SCAN_FDT |UTF_CONSOLE );test/dm/nvmxip.c +1
-1@@ -142,4 +142,4 @@ static int dm_test_nvmxip(struct unit_test_state *uts)return CMD_RET_SUCCESS ; } -DM_TEST (dm_test_nvmxip,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_nvmxip,UTF_SCAN_FDT |UTF_CONSOLE );test/dm/rkmtd.c +1
-1@@ -196,4 +196,4 @@ static int dm_test_rkmtd_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_rkmtd_cmd,UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_rkmtd_cmd,UTF_SCAN_FDT |UTF_CONSOLE );test/dm/rng.c +1
-1@@ -52,4 +52,4 @@ static int dm_test_rng_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_rng_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE_REC ); +DM_TEST (dm_test_rng_cmd,UTF_SCAN_PDATA |UTF_SCAN_FDT |UTF_CONSOLE );test/log/log_filter.c +2
-2@@ -24,7 +24,7 @@ static int log_test_filter_invalid(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_filter_invalid,UTF_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)@@ -105,4 +105,4 @@ static int log_test_filter(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_filter,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_filter,UTF_CONSOLE );test/log/log_test.c +16
-16@@ -121,7 +121,7 @@ int log_test_cat_allow(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_cat_allow,UTF_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)@@ -141,7 +141,7 @@ int log_test_cat_deny_implicit(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_cat_deny_implicit,UTF_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)@@ -162,7 +162,7 @@ int log_test_file(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_file,UTF_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)@@ -179,7 +179,7 @@ int log_test_file_second(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_file_second,UTF_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)@@ -197,7 +197,7 @@ int log_test_file_mid(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt));return 0 ; } -LOG_TEST_FLAGS (log_test_file_mid,UTF_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)@@ -215,7 +215,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,UTF_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)@@ -235,7 +235,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,UTF_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)@@ -258,7 +258,7 @@ int log_test_triple(struct unit_test_state *uts)ut_assertok (log_remove_filter ("console" , filt3));return 0 ; } -LOG_TEST_FLAGS (log_test_triple,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_triple,UTF_CONSOLE );int do_log_test_helpers (struct unit_test_state *uts) {@@ -292,7 +292,7 @@ int log_test_helpers(struct unit_test_state *uts) gd->log_fmt =log_get_default_format ();return ret; } -LOG_TEST_FLAGS (log_test_helpers,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_helpers,UTF_CONSOLE );int do_log_test_disable (struct unit_test_state *uts) {@@ -319,7 +319,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,UTF_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)@@ -343,7 +343,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,UTF_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)@@ -364,7 +364,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,UTF_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)@@ -387,7 +387,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,UTF_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)@@ -410,7 +410,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,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_min,UTF_CONSOLE );/* Check dropped traces */ int log_test_dropped (struct unit_test_state *uts)@@ -432,7 +432,7 @@ int log_test_dropped(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_dropped,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_dropped,UTF_CONSOLE );/* Check log_buffer() */ int log_test_buffer (struct unit_test_state *uts)@@ -459,4 +459,4 @@ int log_test_buffer(struct unit_test_state *uts)return 0 ; } -LOG_TEST_FLAGS (log_test_buffer,UTF_CONSOLE_REC ); +LOG_TEST_FLAGS (log_test_buffer,UTF_CONSOLE );test/print_ut.c +3
-3@@ -246,7 +246,7 @@ static int print_display_buffer(struct unit_test_state *uts)return 0 ; } -PRINT_TEST (print_display_buffer,UTF_CONSOLE_REC ); +PRINT_TEST (print_display_buffer,UTF_CONSOLE );static int print_hexdump_line (struct unit_test_state *uts) {@@ -272,7 +272,7 @@ static int print_hexdump_line(struct unit_test_state *uts)return 0 ; } -PRINT_TEST (print_hexdump_line,UTF_CONSOLE_REC ); +PRINT_TEST (print_hexdump_line,UTF_CONSOLE );static int print_do_hex_dump (struct unit_test_state *uts) {@@ -365,7 +365,7 @@ static int print_do_hex_dump(struct unit_test_state *uts)return 0 ; } -PRINT_TEST (print_do_hex_dump,UTF_CONSOLE_REC ); +PRINT_TEST (print_do_hex_dump,UTF_CONSOLE );static int snprint (struct unit_test_state *uts) {test/test-main.c +1
-1@@ -333,7 +333,7 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) } } -if (test->flags &UTF_CONSOLE_REC ) { +if (test->flags &UTF_CONSOLE ) {int ret =console_record_reset_enable ();if (ret) {Signature · 1 line
2.34.1
PATCH 6/21 mmc: Drop the blank line before accesses
In reply to Simon GlassSeveral mmc subcommand print a blank line before starting and after finishing. It isn't necessary to do both, so drop the first one.
It is questionable whether these command should produce any output at all, but leave it for now.
---
cmd/mmc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
cmd/mmc.c +6 -6
@@ -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 ) {
Signature · 1 line
2.34.1
Re: [PATCH 06/21] mmc: Drop the blank line before accesses
Quoted 62 lines · Simon Glass
Several mmc subcommand print a blank line before starting and after finishing. It isn't necessary to do both, so drop the first one.
It is questionable whether these command should produce any output at all, but leave it for now.
Signed-off-by Simon Glass <[email protected]>---
cmd/mmc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)cmd/mmc.c +5
-5@@ -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 ) {
cmd/mmc.c static int do_mmc_erase(struct cmd_tbl *cmdtp, int flag, · line 490
Quoted 8 lines
cmd/mmc.c +1
-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 ) {
Did you confirm things look right still, on hardware?
Signature · 1 line
Tom
Re: [PATCH 06/21] mmc: Drop the blank line before accesses
Hi Tom,
Quoted 68 lines · Tom Rini
Quoted 65 lines · Simon Glass
Several mmc subcommand print a blank line before starting and after finishing. It isn't necessary to do both, so drop the first one.
It is questionable whether these command should produce any output at all, but leave it for now.
Signed-off-by Simon Glass <[email protected]>---
cmd/mmc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)cmd/mmc.c +5
-5@@ -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 ;
Quoted 7 lines
cmd/mmc.c static int do_mmc_erase(struct cmd_tbl *cmdtp, int flag, · line 490
Quoted 5 lines
cmd/mmc.c +1
-1-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 ) {Did you confirm things look right still, on hardware?
Yes that's why I decided to drop it. See here for example:
$ ub-int ff3399 Building U-Boot in sourcedir for firefly-rk3399 Bootstrapping U-Boot from dir /tmp/b/firefly-rk3399 Writing U-Boot using method rockchip
U-Boot TPL 2024.10-rc2-00093-gcbaae70baf39 (Aug 15 2024 - 13:27:51) Channel 0: DDR3, 800MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB Channel 1: DDR3, 800MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB 256B stride
Trying to boot from BOOTROM
Returning to boot ROM...
U-Boot SPL 2024.10-rc2-00093-gcbaae70baf39 (Aug 15 2024 - 13:27:51 -0600) Trying to boot from MMC2
## Checking hash(es) for config config-1 ... OK
## Checking hash(es) for Image atf-1 ... sha256+ OK
## Checking hash(es) for Image u-boot ... sha256+ OK
## Checking hash(es) for Image fdt-1 ... sha256+ OK
## Checking hash(es) for Image atf-2 ... sha256+ OK
## Checking hash(es) for Image atf-3 ... sha256+ OK
## Checking hash(es) for Image atf-4 ... sha256+ OKload_simple_fit: Skip load 'atf-5': image size is 0!
U-Boot 2024.10-rc2-00093-gcbaae70baf39 (Aug 15 2024 - 13:27:51 -0600)
SoC: Rockchip rk3399 Reset cause: POR Model: Firefly-RK3399 Board DRAM: 4 GiB (effective 3.9 GiB) PMIC: RK808 Core: 308 devices, 29 uclasses, devicetree: separate MMC: mmc@fe310000: 3, mmc@fe320000: 1, mmc@fe330000: 0
Loading Environment from MMC... Reading from MMC(1)... *** Warning - bad CRC, using default environment
In: serial@ff1a0000 Out: serial@ff1a0000 Err: serial@ff1a0000 Model: Firefly-RK3399 Board Net: eth0: ethernet@fe300000 Hit any key to stop autoboot: 0
=> mmc read 1000 0 100
MMC read: dev # 0, block # 0, count 256 ... 256 blocks read: OK =>
With this patch, the blank line above is gone.
BTW, this whole series is marked as needing changes. I've dropped the wget patches. Should I send it again, or just wait?
Regards,
Simon
Re: [PATCH 06/21] mmc: Drop the blank line before accesses
Quoted 125 lines · Simon Glass
Hi Tom,
Quoted 68 lines · Tom Rini
Quoted 65 lines · Simon Glass
Several mmc subcommand print a blank line before starting and after finishing. It isn't necessary to do both, so drop the first one.
It is questionable whether these command should produce any output at all, but leave it for now.
Signed-off-by Simon Glass <[email protected]>---
cmd/mmc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)cmd/mmc.c +5
-5@@ -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 ;Quoted 7 lines
cmd/mmc.c static int do_mmc_erase(struct cmd_tbl *cmdtp, int flag, · line 490
Quoted 5 lines
cmd/mmc.c +1
-1-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 ) {Did you confirm things look right still, on hardware?
Yes that's why I decided to drop it. See here for example:
$ ub-int ff3399 Building U-Boot in sourcedir for firefly-rk3399 Bootstrapping U-Boot from dir /tmp/b/firefly-rk3399 Writing U-Boot using method rockchipU-Boot TPL 2024.10-rc2-00093-gcbaae70baf39 (Aug 15 2024 - 13:27:51) Channel 0: DDR3, 800MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB Channel 1: DDR3, 800MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB 256B stride
Trying to boot from BOOTROM
Returning to boot ROM...U-Boot SPL 2024.10-rc2-00093-gcbaae70baf39 (Aug 15 2024 - 13:27:51 -0600) Trying to boot from MMC2
## Checking hash(es) for config config-1 ... OK
## Checking hash(es) for Image atf-1 ... sha256+ OK
## Checking hash(es) for Image u-boot ... sha256+ OK
## Checking hash(es) for Image fdt-1 ... sha256+ OK
## Checking hash(es) for Image atf-2 ... sha256+ OK
## Checking hash(es) for Image atf-3 ... sha256+ OK
## Checking hash(es) for Image atf-4 ... sha256+ OKload_simple_fit: Skip load 'atf-5': image size is 0!U-Boot 2024.10-rc2-00093-gcbaae70baf39 (Aug 15 2024 - 13:27:51 -0600)
SoC: Rockchip rk3399 Reset cause: POR Model: Firefly-RK3399 Board DRAM: 4 GiB (effective 3.9 GiB) PMIC: RK808 Core: 308 devices, 29 uclasses, devicetree: separate MMC: mmc@fe310000: 3, mmc@fe320000: 1, mmc@fe330000: 0Loading Environment from MMC... Reading from MMC(1)... *** Warning - bad CRC, using default environment
In: serial@ff1a0000 Out: serial@ff1a0000 Err: serial@ff1a0000 Model: Firefly-RK3399 Board Net: eth0: ethernet@fe300000 Hit any key to stop autoboot: 0
Quoted 6 lines
=> mmc read 1000 0 100
MMC read: dev # 0, block # 0, count 256 ... 256 blocks read: OK =>
With this patch, the blank line above is gone.
Ah thanks.
Quoted 2 lines
BTW, this whole series is marked as needing changes. I've dropped the wget patches. Should I send it again, or just wait?
Yeah, wait a bit for other feedback, esp from the corstone-1000 people, and repost.
Signature · 1 line
Tom
PATCH 7/21 Revert "net: wget: Support retransmission a dropped packet"
In reply to Simon GlassThis breaks the wget tests, so revert it until a proper fix can be figured out.
This reverts commit cab7867cff33f9c21025102ea9ca3b26e362fb52.
---
net/wget.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
net/wget.c +5 -11
@@ -49,7 +49,6 @@ static unsigned long content_length;static unsigned int packets;static unsigned int initial_data_seq_num; -static unsigned int next_data_seq_num;static enum wget_state current_wget_state;
@@ -272,18 +271,17 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num, current_wget_state =WGET_TRANSFERRING ; - initial_data_seq_num = tcp_seq_num + hlen; - next_data_seq_num = tcp_seq_num + len; -if (strstr ((char *)pkt, http_ok) ==0 ) {debug_cond (DEBUG_WGET ,"wget: Connected Bad Xfer\n" ); + initial_data_seq_num = tcp_seq_num + hlen; wget_loop_state =NETLOOP_FAIL ;wget_send (action, tcp_seq_num, tcp_ack_num, len); }else {debug_cond (DEBUG_WGET ,"wget: Connctd pkt %p hlen %x\n" , pkt, hlen); + initial_data_seq_num = tcp_seq_num + hlen; pos =strstr ((char *)pkt, content_len);if (!pos) {
@@ -397,13 +395,9 @@ static void wget_handler(uchar *pkt, u16 dport,"wget: Transferring, seq=%x, ack=%x,len=%x\n" , tcp_seq_num, tcp_ack_num, len); -if (next_data_seq_num != tcp_seq_num) { -debug_cond (DEBUG_WGET ,"wget: seq=%x packet was lost\n" , next_data_seq_num); -return ; - } - next_data_seq_num = tcp_seq_num + len; - -if (store_block (pkt, tcp_seq_num - initial_data_seq_num, len) !=0 ) { +if (tcp_seq_num >= initial_data_seq_num && +store_block (pkt, tcp_seq_num - initial_data_seq_num, + len) !=0 ) {wget_fail ("wget: store error\n" , tcp_seq_num, tcp_ack_num, action);net_set_state (NETLOOP_FAIL );
Signature · 1 line
2.34.1
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.
Best regards,
Yasuharu Shibata
Quoted 65 lines · Simon Glass
This breaks the wget tests, so revert it until a proper fix can be figured out.
This reverts commit
cab7867cff33f9c21025102ea9ca3b26e362fb52.Signed-off-by Simon Glass <[email protected]>---
net/wget.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)net/wget.c +5
-12@@ -49,7 +49,6 @@ static unsigned long content_length;static unsigned int packets;static unsigned int initial_data_seq_num; -static unsigned int next_data_seq_num;static enum wget_state current_wget_state;@@ -272,18 +271,17 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num, current_wget_state =WGET_TRANSFERRING ; - initial_data_seq_num = tcp_seq_num + hlen; - next_data_seq_num = tcp_seq_num + len; -if (strstr ((char *)pkt, http_ok) ==0 ) {debug_cond (DEBUG_WGET ,"wget: Connected Bad Xfer\n" ); + initial_data_seq_num = tcp_seq_num + hlen; wget_loop_state =NETLOOP_FAIL ;wget_send (action, tcp_seq_num, tcp_ack_num, len); }else {debug_cond (DEBUG_WGET ,"wget: Connctd pkt %p hlen %x\n" , pkt, hlen); + initial_data_seq_num = tcp_seq_num + hlen; pos =strstr ((char *)pkt, content_len);if (!pos) {@@ -397,13 +395,9 @@ static void wget_handler(uchar *pkt, u16 dport,"wget: Transferring, seq=%x, ack=%x,len=%x\n" , tcp_seq_num, tcp_ack_num, len); -if (next_data_seq_num != tcp_seq_num) { -debug_cond (DEBUG_WGET ,"wget: seq=%x packet was lost\n" , next_data_seq_num); -return ; - } - next_data_seq_num = tcp_seq_num + len; - -if (store_block (pkt, tcp_seq_num - initial_data_seq_num, len) !=0 ) { +if (tcp_seq_num >= initial_data_seq_num && +store_block (pkt, tcp_seq_num - initial_data_seq_num, + len) !=0 ) {wget_fail ("wget: store error\n" , tcp_seq_num, tcp_ack_num, action);net_set_state (NETLOOP_FAIL ); --2.34.1
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
+Ying-Chun Liu (PaulLiu) <[email protected]>
Hi Yasuharu,
Quoted 10 lines · Yasuharu Shibata
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.Best regards,
Yasuharu Shibata
Yes, I should have mentioned that. It is test/cmd/wget.c - see also [1].
This is a good run:
Test: net_test_wget: wget.c
HTTP/1.1 200 OK
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ... 0002001f ==> 234af48e94b0085060249ecb5942ab57
Failures: 0
With your patch it hangs:
Test: net_test_wget: wget.c
HTTP/1.1 200 OKT
Quoted 6 lines · Simon Glass
Quoted 4 lines
This breaks the wget tests, so revert it until a proper fix can be figured out.
Quoted 7 lines
Quoted 7 lines
This reverts commit
cab7867cff33f9c21025102ea9ca3b26e362fb52.Signed-off-by Simon Glass <[email protected]>---
net/wget.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
[..]
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
Quoted 27 lines · Simon Glass
+Ying-Chun Liu (PaulLiu) <[email protected]>
Hi Yasuharu,
Quoted 10 lines · Yasuharu Shibata
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.Best regards,
Yasuharu ShibataYes, I should have mentioned that. It is
test/cmd/wget.c- see also [1].This is a good run:
Test:net_test_wget:wget.c
HTTP/1.1 200 OK
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ...0002001f==>234af48e94b0085060249ecb5942ab57
Failures: 0
Quoted 4 lines
With your patch it hangs:
Test:
net_test_wget:wget.c
HTTP/1.1 200 OKT
Can you please figure out what's going on with the sandbox test then? The change in question fixes wget support on real hardware, and also the other wget tests (as part of the lwIP series) work fine as well. This seems like something specific to that test.
Signature · 1 line
Tom
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
Dear Simon and Tom,
Thank you for your details of the test and your advice.
The test has a problem that tcp_ack isn't calculated by the received data size. sb_ack_handler() in test/cmd/wget.c, tcp_send->tcp_ack calculated by following code:
tcp_send->tcp_seq = htonl(ntohl(tcp->tcp_ack));
tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) + 1);tcp_ack needs to be calculated by the received TCP payload size.
Also, wget command may have a problem that
HTTP response from server must be divided into more than two packets. wget command receive packets and change internal state in wget_handler() as follows:
1. When current_wget_state is WGET_CONNECTED, wget_handler() calls wget_connected().
It receives HTTP response and moves WGET_TRANSFERRING.
2. When current_wget_state is WGET_TRANSFERRING and wget_tcp_state is TCP_ESTABLISHED, wget_handler() receives HTTP response and wget_loop_state sets NETLOOP_SUCCESS.
3. When current_wget_state is WGET_TRANSFERRING and wget_tcp_state is TCP_CLOSE_WAIT,
call net_set_state with wget_loop_state.
If there are more than two HTTP response packets,
wget executes in the order 1 -> 2 -> 3 and terminates properly. If there is only one HTTP response packet, wget executes in the order 1 -> 3, wget_loop_state remains NETLOOP_CONTINUE and wget doesn't terminate successfully.
I wrote the patch at the end of this mail.
The wget issue is temporarily fixed on the test side.
This may need to be fixed on the wget side in the future. In addition, I fixed the HTTP response returned at the correct timing. If the patch is OK, I will send format-patch.
Best regards,
Yasuharu Shibata
—
test/cmd/wget.c +2 -0
@@ -26,6 +26,8 @@#define SHIFT_TO_TCPHDRLEN_FIELD (x) ((x) << 4)#define LEN_B_TO_DW (x) ((x) >> 2) +int net_set_ack_options (union tcp_build_pkt *b); +static int sb_arp_handler (struct udevice *dev,void *packet,unsigned int len) {
@@ -105,6 +107,10 @@ static int sb_ack_handler(struct udevice *dev,
void *packet,
const char *payload1 = "HTTP/1.1 200 OK\r\n"
"Content-Length: 30\r\n\r\n\r\n"
"<html><body>Hi</body></html>\r\n";+ union tcp_build_pkt *b = (union tcp_build_pkt *)tcp;
+ const int recv_payload_len = len - net_set_ack_options(b) -IP_HDR_SIZE - ETHER_HDR_SIZE;
+ static int next_seq = 0;
+ const int bottom_payload_len = 10;
/* Don't allow the buffer to overrun */
if (priv->recv_packets >= PKTBUFSRX)
@@ -119,13 +125,31 @@ static int sb_ack_handler(struct udevice *dev,
void *packet,
tcp_send->tcp_dst = tcp->tcp_src;
data = (void *)tcp_send + IP_TCP_HDR_SIZE;- if (ntohl(tcp->tcp_seq) == 1 && ntohl(tcp->tcp_ack) == 1) {
+ if (ntohl(tcp->tcp_seq) == 1 && ntohl(tcp->tcp_ack) == 1 &&recv_payload_len == 0) {
+ // ignore ACK for three-way handshaking
+ return 0;
+ } else if (ntohl(tcp->tcp_seq) == 1 && ntohl(tcp->tcp_ack) == 1) {
+ // recv HTTP request message and reply top half data
tcp_send->tcp_seq = htonl(ntohl(tcp->tcp_ack));
- tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) + 1);
- payload_len = strlen(payload1);
+ tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) +
recv_payload_len);
+
+ payload_len = strlen(payload1) - bottom_payload_len;
memcpy(data, payload1, payload_len);
tcp_send->tcp_flags = TCP_ACK;- } else if (ntohl(tcp->tcp_seq) == 2) {
+
+ next_seq = ntohl(tcp_send->tcp_seq) + payload_len;
+ } else if (ntohl(tcp->tcp_ack) == next_seq) {
+ // reply bottom half data
+ const int top_payload_len = strlen(payload1) -bottom_payload_len;
+
+ tcp_send->tcp_seq = htonl(next_seq);
+ tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) +recv_payload_len);
+
+ payload_len = bottom_payload_len;
+ memcpy(data, payload1 + top_payload_len, payload_len);
+ tcp_send->tcp_flags = TCP_ACK;
+ } else {
+ // close connection
tcp_send->tcp_seq = htonl(ntohl(tcp->tcp_ack));
tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) + 1);
payload_len = 0;
@@ -148,11 +172,9 @@ static int sb_ack_handler(struct udevice *dev,
void *packet,
pkt_len,
IPPROTO_TCP);- if (ntohl(tcp->tcp_seq) == 1 || ntohl(tcp->tcp_seq) == 2) {
- priv->recv_packet_length[priv->recv_packets] =
- ETHER_HDR_SIZE + IP_TCP_HDR_SIZE + payload_len;
- ++priv->recv_packets;
- }
+ priv->recv_packet_length[priv->recv_packets] =
+ ETHER_HDR_SIZE + IP_TCP_HDR_SIZE + payload_len;
+ ++priv->recv_packets;
return 0;
}
Quoted 41 lines · Tom Rini
Quoted 27 lines · Simon Glass
+Ying-Chun Liu (PaulLiu) <[email protected]>
Hi Yasuharu,
Quoted 10 lines · Yasuharu Shibata
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.Best regards,
Yasuharu ShibataYes, I should have mentioned that. It is
test/cmd/wget.c- see also [1].This is a good run:
Test:net_test_wget:wget.c
HTTP/1.1 200 OK
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ...0002001f==>234af48e94b0085060249ecb5942ab57
Failures: 0Quoted 4 lines
With your patch it hangs:
Test:
net_test_wget:wget.c
HTTP/1.1 200 OKTCan you please figure out what's going on with the sandbox test then? The change in question fixes wget support on real hardware, and also the other wget tests (as part of the lwIP series) work fine as well. This seems like something specific to that test.
--
Tom
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
Hi Yasuharu,
Quoted 35 lines · Yasuharu Shibata
Dear Simon and Tom,
Thank you for your details of the test and your advice.
The test has a problem thattcp_ackisn't calculated by the received data size.sb_ack_handler()intest/cmd/wget.c,tcp_send->tcp_ackcalculated by following code:tcp_send->tcp_seq = htonl(ntohl(tcp->tcp_ack)); tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) + 1);
tcp_ackneeds to be calculated by the received TCP payload size.Also, wget command may have a problem that
HTTP response from server must be divided into more than two packets. wget command receive packets and change internal state inwget_handler()as follows:1. When
current_wget_stateisWGET_CONNECTED,wget_handler()callswget_connected().
It receives HTTP response and movesWGET_TRANSFERRING.
2. Whencurrent_wget_stateisWGET_TRANSFERRINGandwget_tcp_stateisTCP_ESTABLISHED,wget_handler()receives HTTP response andwget_loop_statesetsNETLOOP_SUCCESS.
3. Whencurrent_wget_stateisWGET_TRANSFERRINGandwget_tcp_stateisTCP_CLOSE_WAIT,
callnet_set_statewithwget_loop_state.If there are more than two HTTP response packets,
wget executes in the order 1 -> 2 -> 3 and terminates properly. If there is only one HTTP response packet, wget executes in the order 1 -> 3,wget_loop_stateremainsNETLOOP_CONTINUEand wget doesn't terminate successfully.
Quoted 5 lines
I wrote the patch at the end of this mail.
The wget issue is temporarily fixed on the test side.
This may need to be fixed on the wget side in the future. In addition, I fixed the HTTP response returned at the correct timing. If the patch is OK, I will send format-patch.
Thank you for looking at this and for all the info. Yes, the patch looks good to me.
Regards,
Simon
Quoted 133 lines
Best regards,
Yasuharu Shibata—
test/cmd/wget.c +6
-0@@ -26,6 +26,8 @@#define SHIFT_TO_TCPHDRLEN_FIELD (x) ((x) << 4)#define LEN_B_TO_DW (x) ((x) >> 2) +int net_set_ack_options (union tcp_build_pkt *b); +static int sb_arp_handler (struct udevice *dev,void *packet,unsigned int len) {@@ -105,6 +107,10 @@ static int sb_ack_handler(struct udevice *dev,void *packet, const char *payload1 = "HTTP/1.1 200 OK\r\n""Content-Length: 30\r\n\r\n\r\n" "<html><body>Hi</body></html>\r\n" ; +union tcp_build_pkt *b = (union tcp_build_pkt *)tcp; +const int recv_payload_len = len -net_set_ack_options (b) -IP_HDR_SIZE -ETHER_HDR_SIZE ; +static int next_seq =0 ; +const int bottom_payload_len =10 ;/* Don't allow the buffer to overrun */ if (priv->recv_packets >= PKTBUFSRX)test/cmd/wget.c +13
-4@@ -119,13 +125,31 @@ static int sb_ack_handler(struct udevice *dev,void *packet, tcp_send->tcp_dst = tcp->tcp_src; data = (void *)tcp_send +IP_TCP_HDR_SIZE ; -if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 ) { +if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 && recv_payload_len ==0 ) { +// ignore ACK for three-way handshaking +return 0 ; + }else if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 ) { +// recv HTTP request message and reply top half data tcp_send->tcp_seq =htonl (ntohl (tcp->tcp_ack)); - tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) +1 ); - payload_len =strlen (payload1); + tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) + recv_payload_len); + + payload_len =strlen (payload1) - bottom_payload_len;memcpy (data, payload1, payload_len); tcp_send->tcp_flags =TCP_ACK ; - } else if (ntohl(tcp->tcp_seq) == 2) { + + next_seq =ntohl (tcp_send->tcp_seq) + payload_len; + }else if (ntohl (tcp->tcp_ack) == next_seq) { +// reply bottom half data + const int top_payload_len = strlen(payload1) -
bottom_payload_len;test/cmd/wget.c +3
-0+ + tcp_send->tcp_seq =htonl (next_seq); + tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) +
recv_payload_len);test/cmd/wget.c +9
-5+ + payload_len = bottom_payload_len; +memcpy (data, payload1 + top_payload_len, payload_len); + tcp_send->tcp_flags =TCP_ACK ; + }else { +// close connection tcp_send->tcp_seq =htonl (ntohl (tcp->tcp_ack)); tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) +1 ); payload_len =0 ;@@ -148,11 +172,9 @@ static int sb_ack_handler(struct udevice *dev,void *packet, pkt_len, IPPROTO_TCP); -if (ntohl (tcp->tcp_seq) ==1 ||ntohl (tcp->tcp_seq) ==2 ) { - priv->recv_packet_length[priv->recv_packets] = -ETHER_HDR_SIZE +IP_TCP_HDR_SIZE + payload_len; - ++priv->recv_packets; - } + priv->recv_packet_length[priv->recv_packets] = +ETHER_HDR_SIZE +IP_TCP_HDR_SIZE + payload_len; + ++priv->recv_packets;return 0 ;}
Quoted 41 lines · Tom Rini
Quoted 27 lines · Simon Glass
+Ying-Chun Liu (PaulLiu) <[email protected]>
Hi Yasuharu,
Quoted 10 lines · Yasuharu Shibata
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.Best regards,
Yasuharu ShibataYes, I should have mentioned that. It is
test/cmd/wget.c- see also [1].This is a good run:
Test:net_test_wget:wget.c
HTTP/1.1 200 OK
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ...0002001f==>234af48e94b0085060249ecb5942ab57
Failures: 0Quoted 4 lines
With your patch it hangs:
Test:
net_test_wget:wget.c
HTTP/1.1 200 OKTCan you please figure out what's going on with the sandbox test then? The change in question fixes wget support on real hardware, and also the other wget tests (as part of the lwIP series) work fine as well. This seems like something specific to that test.
--
Tom
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
Hi Yasuharu,
Quoted 40 lines · Simon Glass
Hi Yasuharu,
Quoted 35 lines · Yasuharu Shibata
Dear Simon and Tom,
Thank you for your details of the test and your advice.
The test has a problem thattcp_ackisn't calculated by the received data size.sb_ack_handler()intest/cmd/wget.c,tcp_send->tcp_ackcalculated by following code:tcp_send->tcp_seq = htonl(ntohl(tcp->tcp_ack)); tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) + 1);
tcp_ackneeds to be calculated by the received TCP payload size.Also, wget command may have a problem that
HTTP response from server must be divided into more than two packets. wget command receive packets and change internal state inwget_handler()as follows:1. When
current_wget_stateisWGET_CONNECTED,wget_handler()callswget_connected().
It receives HTTP response and movesWGET_TRANSFERRING.
2. Whencurrent_wget_stateisWGET_TRANSFERRINGandwget_tcp_stateisTCP_ESTABLISHED,wget_handler()receives HTTP response andwget_loop_statesetsNETLOOP_SUCCESS.
3. Whencurrent_wget_stateisWGET_TRANSFERRINGandwget_tcp_stateisTCP_CLOSE_WAIT,
callnet_set_statewithwget_loop_state.If there are more than two HTTP response packets,
wget executes in the order 1 -> 2 -> 3 and terminates properly. If there is only one HTTP response packet, wget executes in the order 1 -> 3,wget_loop_stateremainsNETLOOP_CONTINUEand wget doesn't terminate successfully.
Quoted 8 lines
Quoted 5 lines
I wrote the patch at the end of this mail.
The wget issue is temporarily fixed on the test side.
This may need to be fixed on the wget side in the future. In addition, I fixed the HTTP response returned at the correct timing. If the patch is OK, I will send format-patch.Thank you for looking at this and for all the info. Yes, the patch looks good to me.
Also, would you mind adding a patch to enable the command for sandbox, so the test runs in CI?
Thanks,
Simon
Quoted 137 lines
Regards,
SimonQuoted 133 lines
Best regards,
Yasuharu Shibata—
test/cmd/wget.c +6
-0@@ -26,6 +26,8 @@#define SHIFT_TO_TCPHDRLEN_FIELD (x) ((x) << 4)#define LEN_B_TO_DW (x) ((x) >> 2) +int net_set_ack_options (union tcp_build_pkt *b); +static int sb_arp_handler (struct udevice *dev,void *packet,unsigned int len) {@@ -105,6 +107,10 @@ static int sb_ack_handler(struct udevice *dev,void *packet, const char *payload1 = "HTTP/1.1 200 OK\r\n""Content-Length: 30\r\n\r\n\r\n" "<html><body>Hi</body></html>\r\n" ; +union tcp_build_pkt *b = (union tcp_build_pkt *)tcp; +const int recv_payload_len = len -net_set_ack_options (b) -IP_HDR_SIZE -ETHER_HDR_SIZE ; +static int next_seq =0 ; +const int bottom_payload_len =10 ;/* Don't allow the buffer to overrun */ if (priv->recv_packets >= PKTBUFSRX)test/cmd/wget.c +13
-4@@ -119,13 +125,31 @@ static int sb_ack_handler(struct udevice *dev,void *packet, tcp_send->tcp_dst = tcp->tcp_src; data = (void *)tcp_send +IP_TCP_HDR_SIZE ; -if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 ) { +if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 && recv_payload_len ==0 ) { +// ignore ACK for three-way handshaking +return 0 ; + }else if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 ) { +// recv HTTP request message and reply top half data tcp_send->tcp_seq =htonl (ntohl (tcp->tcp_ack)); - tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) +1 ); - payload_len =strlen (payload1); + tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) + recv_payload_len); + + payload_len =strlen (payload1) - bottom_payload_len;memcpy (data, payload1, payload_len); tcp_send->tcp_flags =TCP_ACK ; - } else if (ntohl(tcp->tcp_seq) == 2) { + + next_seq =ntohl (tcp_send->tcp_seq) + payload_len; + }else if (ntohl (tcp->tcp_ack) == next_seq) { +// reply bottom half data + const int top_payload_len = strlen(payload1) -
bottom_payload_len;test/cmd/wget.c +3
-0+ + tcp_send->tcp_seq =htonl (next_seq); + tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) +
recv_payload_len);test/cmd/wget.c +9
-5+ + payload_len = bottom_payload_len; +memcpy (data, payload1 + top_payload_len, payload_len); + tcp_send->tcp_flags =TCP_ACK ; + }else { +// close connection tcp_send->tcp_seq =htonl (ntohl (tcp->tcp_ack)); tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) +1 ); payload_len =0 ;@@ -148,11 +172,9 @@ static int sb_ack_handler(struct udevice *dev,void *packet, pkt_len, IPPROTO_TCP); -if (ntohl (tcp->tcp_seq) ==1 ||ntohl (tcp->tcp_seq) ==2 ) { - priv->recv_packet_length[priv->recv_packets] = -ETHER_HDR_SIZE +IP_TCP_HDR_SIZE + payload_len; - ++priv->recv_packets; - } + priv->recv_packet_length[priv->recv_packets] = +ETHER_HDR_SIZE +IP_TCP_HDR_SIZE + payload_len; + ++priv->recv_packets;return 0 ;}
Quoted 41 lines · Tom Rini
Quoted 27 lines · Simon Glass
+Ying-Chun Liu (PaulLiu) <[email protected]>
Hi Yasuharu,
Quoted 10 lines · Yasuharu Shibata
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.Best regards,
Yasuharu ShibataYes, I should have mentioned that. It is
test/cmd/wget.c- see also [1].This is a good run:
Test:net_test_wget:wget.c
HTTP/1.1 200 OK
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ...0002001f==>234af48e94b0085060249ecb5942ab57
Failures: 0Quoted 4 lines
With your patch it hangs:
Test:
net_test_wget:wget.c
HTTP/1.1 200 OKTCan you please figure out what's going on with the sandbox test then? The change in question fixes wget support on real hardware, and also the other wget tests (as part of the lwIP series) work fine as well. This seems like something specific to that test.
--
Tom
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
Dear Simon,
Thank you for checking my patch.
I sent patch series including enabling wget command for sandbox.
https://lore.kernel.org/u-boot/[email protected]/T/#u
Best regards,
Yasuharu Shibata
Quoted 197 lines · Simon Glass
Hi Yasuharu,
Quoted 40 lines · Simon Glass
Hi Yasuharu,
Quoted 35 lines · Yasuharu Shibata
Dear Simon and Tom,
Thank you for your details of the test and your advice.
The test has a problem thattcp_ackisn't calculated by the received data size.sb_ack_handler()intest/cmd/wget.c,tcp_send->tcp_ackcalculated by following code:tcp_send->tcp_seq = htonl(ntohl(tcp->tcp_ack)); tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) + 1);
tcp_ackneeds to be calculated by the received TCP payload size.Also, wget command may have a problem that
HTTP response from server must be divided into more than two packets. wget command receive packets and change internal state inwget_handler()as follows:1. When
current_wget_stateisWGET_CONNECTED,wget_handler()callswget_connected().
It receives HTTP response and movesWGET_TRANSFERRING.
2. Whencurrent_wget_stateisWGET_TRANSFERRINGandwget_tcp_stateisTCP_ESTABLISHED,wget_handler()receives HTTP response andwget_loop_statesetsNETLOOP_SUCCESS.
3. Whencurrent_wget_stateisWGET_TRANSFERRINGandwget_tcp_stateisTCP_CLOSE_WAIT,
callnet_set_statewithwget_loop_state.If there are more than two HTTP response packets,
wget executes in the order 1 -> 2 -> 3 and terminates properly. If there is only one HTTP response packet, wget executes in the order 1 -> 3,wget_loop_stateremainsNETLOOP_CONTINUEand wget doesn't terminate successfully.Quoted 8 lines
Quoted 5 lines
I wrote the patch at the end of this mail.
The wget issue is temporarily fixed on the test side.
This may need to be fixed on the wget side in the future. In addition, I fixed the HTTP response returned at the correct timing. If the patch is OK, I will send format-patch.Thank you for looking at this and for all the info. Yes, the patch looks good to me.
Also, would you mind adding a patch to enable the command for sandbox, so the test runs in CI?
Thanks,
SimonQuoted 137 lines
Regards,
SimonQuoted 133 lines
Best regards,
Yasuharu Shibata—
test/cmd/wget.c +6
-0@@ -26,6 +26,8 @@#define SHIFT_TO_TCPHDRLEN_FIELD (x) ((x) << 4)#define LEN_B_TO_DW (x) ((x) >> 2) +int net_set_ack_options (union tcp_build_pkt *b); +static int sb_arp_handler (struct udevice *dev,void *packet,unsigned int len) {@@ -105,6 +107,10 @@ static int sb_ack_handler(struct udevice *dev,void *packet, const char *payload1 = "HTTP/1.1 200 OK\r\n""Content-Length: 30\r\n\r\n\r\n" "<html><body>Hi</body></html>\r\n" ; +union tcp_build_pkt *b = (union tcp_build_pkt *)tcp; +const int recv_payload_len = len -net_set_ack_options (b) -IP_HDR_SIZE -ETHER_HDR_SIZE ; +static int next_seq =0 ; +const int bottom_payload_len =10 ;/* Don't allow the buffer to overrun */ if (priv->recv_packets >= PKTBUFSRX)test/cmd/wget.c +13
-4@@ -119,13 +125,31 @@ static int sb_ack_handler(struct udevice *dev,void *packet, tcp_send->tcp_dst = tcp->tcp_src; data = (void *)tcp_send +IP_TCP_HDR_SIZE ; -if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 ) { +if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 && recv_payload_len ==0 ) { +// ignore ACK for three-way handshaking +return 0 ; + }else if (ntohl (tcp->tcp_seq) ==1 &&ntohl (tcp->tcp_ack) ==1 ) { +// recv HTTP request message and reply top half data tcp_send->tcp_seq =htonl (ntohl (tcp->tcp_ack)); - tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) +1 ); - payload_len =strlen (payload1); + tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) + recv_payload_len); + + payload_len =strlen (payload1) - bottom_payload_len;memcpy (data, payload1, payload_len); tcp_send->tcp_flags =TCP_ACK ; - } else if (ntohl(tcp->tcp_seq) == 2) { + + next_seq =ntohl (tcp_send->tcp_seq) + payload_len; + }else if (ntohl (tcp->tcp_ack) == next_seq) { +// reply bottom half data + const int top_payload_len = strlen(payload1) -
bottom_payload_len;test/cmd/wget.c +3
-0+ + tcp_send->tcp_seq =htonl (next_seq); + tcp_send->tcp_ack = htonl(ntohl(tcp->tcp_seq) +
recv_payload_len);test/cmd/wget.c +9
-5+ + payload_len = bottom_payload_len; +memcpy (data, payload1 + top_payload_len, payload_len); + tcp_send->tcp_flags =TCP_ACK ; + }else { +// close connection tcp_send->tcp_seq =htonl (ntohl (tcp->tcp_ack)); tcp_send->tcp_ack =htonl (ntohl (tcp->tcp_seq) +1 ); payload_len =0 ;@@ -148,11 +172,9 @@ static int sb_ack_handler(struct udevice *dev,void *packet, pkt_len, IPPROTO_TCP); -if (ntohl (tcp->tcp_seq) ==1 ||ntohl (tcp->tcp_seq) ==2 ) { - priv->recv_packet_length[priv->recv_packets] = -ETHER_HDR_SIZE +IP_TCP_HDR_SIZE + payload_len; - ++priv->recv_packets; - } + priv->recv_packet_length[priv->recv_packets] = +ETHER_HDR_SIZE +IP_TCP_HDR_SIZE + payload_len; + ++priv->recv_packets;return 0 ;}
Quoted 41 lines · Tom Rini
Quoted 27 lines · Simon Glass
+Ying-Chun Liu (PaulLiu) <[email protected]>
Hi Yasuharu,
Quoted 10 lines · Yasuharu Shibata
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.Best regards,
Yasuharu ShibataYes, I should have mentioned that. It is
test/cmd/wget.c- see also [1].This is a good run:
Test:net_test_wget:wget.c
HTTP/1.1 200 OK
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ...0002001f==>234af48e94b0085060249ecb5942ab57
Failures: 0Quoted 4 lines
With your patch it hangs:
Test:
net_test_wget:wget.c
HTTP/1.1 200 OKTCan you please figure out what's going on with the sandbox test then? The change in question fixes wget support on real hardware, and also the other wget tests (as part of the lwIP series) work fine as well. This seems like something specific to that test.
--
Tom
Re: [PATCH 07/21] Revert "net: wget: Support retransmission a dropped packet"
In reply to Tom RiniHi Tom,
Quoted 31 lines · Tom Rini
Quoted 29 lines · Simon Glass
+Ying-Chun Liu (PaulLiu) <[email protected]>
Hi Yasuharu,
Quoted 10 lines · Yasuharu Shibata
Dear Simon,
Could you inform me how the wget test was broken?
As I explained in the commit log, I fixed the bug in specific conditions. Without the details of how the break happened,
it is difficult to find a proper patch.Best regards,
Yasuharu ShibataYes, I should have mentioned that. It is
test/cmd/wget.c- see also [1].This is a good run:
Test:net_test_wget:wget.c
HTTP/1.1 200 OK
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ...0002001f==>234af48e94b0085060249ecb5942ab57
Failures: 0With your patch it hangs:
Quoted 7 lines
Quoted 2 lines
Test:
net_test_wget:wget.c
HTTP/1.1 200 OKTCan you please figure out what's going on with the sandbox test then? The change in question fixes wget support on real hardware, and also the other wget tests (as part of the lwIP series) work fine as well. This seems like something specific to that test.
The sandbox test is pretty simple, but it seems that something is very odd in the wget code. I'm really not sure what it is supposed to be doing.
Here is a good run, with both of these reverts:
(1) 1fd9476ec7d Revert "net: wget: Support retransmission a dropped packet"
(2) 3ebd131f7af Revert "net: wget: fix TCP sequence number wrap around issue"
Test: net_test_wget: wget.c
wget: Transfer HTTP Server 1.1.2.2; our IP 192.0.2.1 URL '/index.html'
wget:Load address: 0x20000
Loading: wget: send SYN
wget: Connecting In len=0, Seq=0, Ack=1
wget: Cting, send, len=0
wget: Connected seq=1, len=47
wget: Connected HTTP Header 0000560ee4323456 HTTP/1.1 200 OKwget: Connctd pkt 0000560ee4323456 hlen 27
wget: Connected Len 0
wget: offset 0
wget: Connected Pkt 0000560ee4323456 hlen 27
wget: Transferring, seq=1, ack=2, init_seq=28, len=47
wget: Transferring, seq=48, ack=3, init_seq=28, len=0
wget: offset 20
Packets received 5, Transfer Successful
Bytes transferred = 32 (20 hex)
md5 for 00020000 ... 0002001f ==> 234af48e94b0085060249ecb5942ab57
Failures: 0
Here is a bad run, with only (1) reverted:
Test: net_test_wget: wget.c
wget: Transfer HTTP Server 1.1.2.2; our IP 192.0.2.1 URL '/index.html'
wget:Load address: 0x20000
Loading: wget: send SYN
wget: Connecting In len=0, Seq=0, Ack=1
wget: Cting, send, len=0
wget: Connected seq=1, len=47
wget: Connected HTTP Header 000055d24b26e456 HTTP/1.1 200 OKwget: Connctd pkt 000055d24b26e456 hlen 27
wget: Connected Len 0
wget: offset 0
wget: Connected Pkt 000055d24b26e456 hlen 27
wget: Transferring, seq=1, ack=2, init_seq=28, len=47
wget: offset ffffffd9
wget error: trying to overwrite reserved memory...
wget: Transfer Fail - wget: store error
wget: Transferring, seq=48, ack=3, init_seq=28, len=0
wget: offset 20
Packets received 5, Transfer Successful
T T
You can see that seq is lower than init_seq so it tries to write to memory before the buffer. I suppose in real hardware this would normally be OK, but it isn't in sandbox.
With just (2) reverted I see this:
Test: net_test_wget: wget.c
wget: Transfer HTTP Server 1.1.2.2; our IP 192.0.2.1 URL '/index.html'
wget:Load address: 0x20000
Loading: wget: send SYN
wget: Connecting In len=0, Seq=0, Ack=1
wget: Cting, send, len=0
wget: Connected seq=1, len=47
wget: Connected HTTP Header 000055a5e9a25456 HTTP/1.1 200 OKwget: Connctd pkt 000055a5e9a25456 hlen 27
wget: Connected Len 0
wget: offset 0
wget: Connected Pkt 000055a5e9a25456 hlen 27
wget: Transferring, seq=1, ack=2, init_seq=28, len=47
wget: seq=48 packet was lost
wget: Transferring, seq=48, ack=3, init_seq=28, len=0
wget: offset 20
T T
At least in this case it doesn't write to bad memory, but it still doesn't work.
Regards,
Simon
PATCH 8/21 sandbox: Enable wget command
In reply to Simon GlassEnable this so that the tests run.
Fix a few warnings in the code so that CI passes.
---
cmd/Kconfig | 1 + net/wget.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-)
cmd/Kconfig +1 -0
@@ -2010,6 +2010,7 @@ config SYS_DISABLE_AUTOLOAD config CMD_WGET bool "wget" select PROT_TCP + default y if SANDBOX help wget is a simple command to download kernel, or other files, from a http server over TCP.
net/wget.c +3 -4
@@ -243,7 +243,7 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num, pkt_in_q = (void *)image_load_addr +PKT_QUEUE_OFFSET + (pkt_q_idx *PKT_QUEUE_PACKET_SIZE ); - ptr1 =map_sysmem ((phys_addr_t )pkt_in_q, len); + ptr1 =map_sysmem ((ulong )pkt_in_q, len);memcpy (ptr1, pkt, len);unmap_sysmem (ptr1);
@@ -312,9 +312,8 @@ static void wget_connected(uchar *pkt, unsigned int tcp_seq_num,for (i =0 ; i < pkt_q_idx; i++) {int err; - ptr1 =map_sysmem ( - (phys_addr_t)(pkt_q[i].pkt), - pkt_q[i].len); + ptr1 =map_sysmem ((ulong )pkt_q[i].pkt, + pkt_q[i].len); err = store_block(ptr1, pkt_q[i].tcp_seq_num - initial_data_seq_num,
Signature · 1 line
2.34.1
PATCH 9/21 test: Update NAND test to avoid extra macros
In reply to Simon GlassUse a single test function with a for() loop instead of using macros to create multiple test functions. Add a message so it is clear what piece the test is up to, if it fails.
---
test/dm/nand.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
test/dm/nand.c +15 -15
@@ -12,7 +12,7 @@#include <linux/mtd/mtd.h> #include <linux/mtd/rawnand.h> -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;
@@ -25,6 +25,8 @@ static int dm_test_nand(struct unit_test_state *uts, int dev, bool end)loff_t off =0 ;mtd_oob_ops_t ops = { }; +printf ("running: dev %d end %d\n" , dev, end); +/* Seed RNG for bit errors */ srand ((off >>32 ) ^ off ^ ~dev);
@@ -88,17 +90,15 @@ 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, UTF_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, UTF_SCAN_FDT) - -DM_NAND_TEST (0 ); -DM_NAND_TEST (1 ); +static int dm_test_nand (struct unit_test_state *uts) +{ +int devnum; + +for (devnum =0 ; devnum <2 ; devnum++) { +ut_assertok (run_test_nand (uts, devnum, false)); +ut_assertok (run_test_nand (uts, devnum, true)); + } + +return 0 ; +} +DM_TEST (dm_test_nand,UTF_SCAN_FDT );
Signature · 1 line
2.34.1
Re: [PATCH 09/21] test: Update NAND test to avoid extra macros
Quoted 5 lines · Simon Glass
Use a single test function with a
for()loop instead of using macros to create multiple test functions. Add a message so it is clear what piece the test is up to, if it fails.Signed-off-by Simon Glass <[email protected]>
Well, the whole reason I wrote it this was was to make sure both tests run even if one fails. They flashes have different sizes/geometries/ecc and it's definitely possible for some regression to happen for one but not the other. Having two test cases makes it easy to see this.
--Sean
PATCH 10/21 test: bloblist: Use UTF_CONSOLE in tests
In reply to Simon GlassSet this flag rather than doing things manually in the test.
Drop the code which is now unnecessary.
---
test/bloblist.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
test/bloblist.c +2 -12
@@ -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)
Signature · 1 line
2.34.1
PATCH 11/21 test: boot: Use UTF_CONSOLE in tests
In reply to Simon GlassSet this flag rather than doing things manually in the test.
Drop unnecessary calls to console_record_reset_enable()
---
test/boot/bootdev.c | 31 ++++++++++---------------- test/boot/bootflow.c | 53 ++++++++++++++++++-------------------------- test/boot/bootmeth.c | 12 ++++------ test/boot/cedit.c | 13 ++++------- test/boot/expo.c | 3 +-- 5 files changed, 42 insertions(+), 70 deletions(-)
test/boot/bootdev.c +12 -19
@@ -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,UTF_DM |UTF_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,UTF_DM |UTF_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)
@@ -157,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);
@@ -185,7 +182,8 @@ static int bootdev_test_any(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_any,UTF_DM |UTF_SCAN_FDT |UTF_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
@@ -321,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);
@@ -361,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 ("----" );
@@ -388,7 +384,7 @@ static int bootdev_test_hunter(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_hunter,UTF_DM |UTF_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)
@@ -401,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 ("----" );
@@ -462,7 +457,8 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_cmd_hunt,UTF_DM |UTF_SCAN_FDT |UTF_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)
@@ -527,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" );
@@ -544,7 +539,7 @@ static int bootdev_test_hunt_prio(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_hunt_prio,UTF_DM |UTF_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)
@@ -559,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 ;
@@ -597,7 +591,7 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_hunt_label,UTF_DM |UTF_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)
@@ -624,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);
@@ -675,7 +668,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)return 0 ; }BOOTSTD_TEST (bootdev_test_next_label,UTF_DM |UTF_SCAN_FDT |UTF_ETH_BOOTDEV | -UTF_SF_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)
@@ -700,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);
@@ -759,4 +751,5 @@ static int bootdev_test_next_prio(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_next_prio,UTF_DM |UTF_SCAN_FDT |UTF_SF_BOOTDEV ); +BOOTSTD_TEST (bootdev_test_next_prio,UTF_DM |UTF_SCAN_FDT |UTF_SF_BOOTDEV | +UTF_CONSOLE );
test/boot/bootflow.c +21 -32
236 lines not on this page · raw message
test/boot/bootmeth.c +4 -8
@@ -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,UTF_DM |UTF_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,UTF_DM |UTF_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,UTF_DM |UTF_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,UTF_DM |UTF_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)
test/boot/cedit.c +4 -9
@@ -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 );
test/boot/expo.c +1 -2
@@ -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,UTF_DM |UTF_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)
Signature · 1 line
2.34.1
Re: [PATCH 11/21] test: boot: Use UTF_CONSOLE in tests
Hi Simon,
Thank you for the patch.
Quoted 5 lines · Simon Glass
Set this flag rather than doing things manually in the test.
Drop unnecessary calls to
console_record_reset_enable()Signed-off-by Simon Glass <[email protected]>
Quoted 603 lines
---
test/boot/bootdev.c | 31 ++++++++++---------------- test/boot/bootflow.c | 53 ++++++++++++++++++-------------------------- test/boot/bootmeth.c | 12 ++++------ test/boot/cedit.c | 13 ++++------- test/boot/expo.c | 3 +-- 5 files changed, 42 insertions(+), 70 deletions(-)test/boot/bootdev.c +12
-19@@ -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,UTF_DM |UTF_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,UTF_DM |UTF_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)@@ -157,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);@@ -185,7 +182,8 @@ static int bootdev_test_any(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_any,UTF_DM |UTF_SCAN_FDT |UTF_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 @@ -321,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);@@ -361,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 ("----" );@@ -388,7 +384,7 @@ static int bootdev_test_hunter(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_hunter,UTF_DM |UTF_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)@@ -401,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 ("----" );@@ -462,7 +457,8 @@ static int bootdev_test_cmd_hunt(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_cmd_hunt,UTF_DM |UTF_SCAN_FDT |UTF_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)@@ -527,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" );@@ -544,7 +539,7 @@ static int bootdev_test_hunt_prio(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_hunt_prio,UTF_DM |UTF_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)@@ -559,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 ;@@ -597,7 +591,7 @@ static int bootdev_test_hunt_label(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_hunt_label,UTF_DM |UTF_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)@@ -624,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);@@ -675,7 +668,7 @@ static int bootdev_test_next_label(struct unit_test_state *uts)return 0 ; }BOOTSTD_TEST (bootdev_test_next_label,UTF_DM |UTF_SCAN_FDT |UTF_ETH_BOOTDEV | -UTF_SF_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)@@ -700,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);@@ -759,4 +751,5 @@ static int bootdev_test_next_prio(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootdev_test_next_prio,UTF_DM |UTF_SCAN_FDT |UTF_SF_BOOTDEV ); +BOOTSTD_TEST (bootdev_test_next_prio,UTF_DM |UTF_SCAN_FDT |UTF_SF_BOOTDEV | +UTF_CONSOLE );test/boot/bootflow.c +21
-32@@ -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,UTF_DM |UTF_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,14 +121,14 @@ static int bootflow_cmd_label(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_label,UTF_DM |UTF_SCAN_FDT |UTF_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" );@@ -155,14 +153,13 @@ static int bootflow_cmd_glob(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_glob,UTF_DM |UTF_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" );@@ -206,12 +203,11 @@ static int bootflow_cmd_scan_e(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_scan_e,UTF_DM |UTF_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 ));@@ -247,12 +243,11 @@ static int bootflow_cmd_info(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_info,UTF_DM |UTF_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(@@ -269,7 +264,7 @@ static int bootflow_scan_boot(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_scan_boot,UTF_DM |UTF_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)@@ -385,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 <NULL> " );@@ -395,7 +389,8 @@ static int bootflow_system(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST (bootflow_system,UTF_DM |UTF_SCAN_PDATA |UTF_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 */ @@ -414,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 ));@@ -436,7 +430,7 @@ static int bootflow_iter_disable(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_iter_disable,UTF_DM |UTF_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)@@ -450,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" );@@ -477,12 +470,12 @@ static int bootflow_scan_glob_bootmeth(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_scan_glob_bootmeth,UTF_DM |UTF_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 ));@@ -506,7 +499,7 @@ static int bootflow_cmd_boot(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_boot,UTF_DM |UTF_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 @@ -583,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 ();@@ -611,7 +603,6 @@ static int scan_mmc_android_bootdev(struct unit_test_state *uts, const char *mmcut_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);@@ -673,7 +664,7 @@ static int bootflow_cmd_menu(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_menu,UTF_DM |UTF_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)@@ -779,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)" );@@ -790,7 +780,8 @@ static int bootflow_cmd_hunt_single(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_hunt_single,UTF_DM |UTF_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)@@ -804,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 */ @@ -827,7 +817,7 @@ static int bootflow_cmd_hunt_label(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_cmd_hunt_label,UTF_DM |UTF_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 @@ -887,7 +877,7 @@ static int bootflow_menu_theme(struct unit_test_state *uts)return 0 ; } -BOOTSTD_TEST (bootflow_menu_theme,UTF_DM |UTF_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 @@ -1123,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,7 +1140,7 @@ static int bootflow_cmdline(struct unit_test_state *uts)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)@@ -1192,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)@@ -1215,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 );test/boot/bootmeth.c +4
-8@@ -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,UTF_DM |UTF_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,UTF_DM |UTF_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,UTF_DM |UTF_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,UTF_DM |UTF_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)test/boot/cedit.c +4
-9@@ -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 );test/boot/expo.c +1
-2@@ -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,UTF_DM |UTF_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)Signature · 1 line
2.34.1
PATCH 12/21 test: fdt: Check internal-function return values
In reply to Simon GlassSome functions are using asserts but the result of the functions themselves is not checked. This means that if a test fails, the result is not noticed until later, which can be confusing to debug.
Add the missing asserts.
---
test/cmd/fdt.c | 153 +++++++++++++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 63 deletions(-)
test/cmd/fdt.c +90 -63
@@ -459,11 +459,10 @@ static int fdt_test_get_value_string(struct unit_test_state *uts,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));return 0 ;
@@ -473,16 +472,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,13 +494,16 @@ 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 ());
@@ -522,17 +528,13 @@ 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); - 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 ());
@@ -668,23 +670,31 @@ static int fdt_test_get_addr(struct unit_test_state *uts)set_working_fdt_addr (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 ());
@@ -728,30 +738,38 @@ static int fdt_test_get_size(struct unit_test_state *uts)set_working_fdt_addr (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 ());
@@ -873,14 +891,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 ; }
@@ -896,18 +914,20 @@ static int fdt_test_set(struct unit_test_state *uts)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 ());
@@ -1160,16 +1180,23 @@ static int fdt_test_header(struct unit_test_state *uts)ut_assertok (ut_check_console_end (uts));/* 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 ; }
@@ -1244,8 +1271,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
Signature · 1 line
2.34.1
PATCH 13/21 test: fdt: Move common code into the setup functions
In reply to Simon GlassQuite a lot of tests have the same two lines of code at the start. Move this into the two setup functions to reduce redundancy.
Add a line to check the output from set_working_fdt_addr() since this is always emitted.
---
test/cmd/fdt.c | 92 +++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 53 deletions(-)
test/cmd/fdt.c +39 -53
@@ -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 ; }
@@ -169,10 +188,7 @@ static int fdt_test_addr(struct unit_test_state *uts)ut_assertok (ut_check_console_end (uts));/* 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));
@@ -222,9 +238,7 @@ 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 ());
@@ -258,10 +272,8 @@ 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);
@@ -291,11 +303,9 @@ 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 ());
@@ -393,9 +403,7 @@ 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 ());
@@ -529,9 +537,7 @@ static int fdt_test_get_value(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));ut_assertok (fdt_test_get_value_common (uts,"/test-node@1234" ));ut_assertok (fdt_test_get_value_common (uts,"testnodealias" ));
@@ -563,9 +569,7 @@ 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 ());
@@ -665,9 +669,7 @@ 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" */ ut_assertok (fdt_test_get_addr_common (uts, fdt,"/" ,"compatible" ));
@@ -733,9 +735,7 @@ 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" */ ut_assertok (fdt_test_get_size_common (uts,"/" ,"compatible" ,16 ));
@@ -908,10 +908,8 @@ 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" */ ut_assertok (fdt_test_set_node (uts,"/" ,"compatible" ));
@@ -956,10 +954,8 @@ 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 ());
@@ -1024,9 +1020,7 @@ 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 ());
@@ -1109,9 +1103,7 @@ 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 ());
@@ -1158,9 +1150,7 @@ 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 ());
@@ -1290,12 +1280,10 @@ 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 ());
@@ -1354,10 +1342,8 @@ 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 ());
Signature · 1 line
2.34.1
PATCH 14/21 test: cmd: Use UTF_CONSOLE in tests
In reply to Simon GlassSet this flag rather than doing things manually in the test.
---
test/cmd/pinmux.c | 3 ++- test/cmd/wget.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
test/cmd/pinmux.c +2 -1
@@ -36,4 +36,5 @@ static int dm_test_cmd_pinmux_status_pinname(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_cmd_pinmux_status_pinname,UTF_SCAN_PDATA |UTF_SCAN_FDT ); +DM_TEST (dm_test_cmd_pinmux_status_pinname,UTF_SCAN_PDATA |UTF_SCAN_FDT | +UTF_CONSOLE );
test/cmd/wget.c +1 -1
@@ -201,4 +201,4 @@ static int net_test_wget(struct unit_test_state *uts)return 0 ; } -LIB_TEST (net_test_wget,0 ); +LIB_TEST (net_test_wget,UTF_CONSOLE );
Signature · 1 line
2.34.1
PATCH 15/21 test: cmd: Drop unnecessary console_record_reset_enable()
In reply to Simon GlassIt is seldom necessary to call this function. Drop its use in the command tests.
Add a few extra checks to the wget test so that resetting is not needed.
---
test/cmd/addrmap.c | 1 - test/cmd/bdinfo.c | 4 -- test/cmd/exit.c | 12 ------ test/cmd/fdt.c | 83 +----------------------------------------- test/cmd/font.c | 1 - test/cmd/loadm.c | 2 - test/cmd/mbr.c | 7 +--- test/cmd/mem_search.c | 13 ------- test/cmd/pinmux.c | 3 -- test/cmd/pwm.c | 4 -- test/cmd/rw.c | 2 - test/cmd/seama.c | 3 -- test/cmd/setexpr.c | 1 - test/cmd/temperature.c | 2 - test/cmd/test_echo.c | 5 +-- test/cmd/test_pause.c | 5 +-- test/cmd/wget.c | 4 +- 17 files changed, 8 insertions(+), 144 deletions(-)
test/cmd/addrmap.c +0 -1
@@ -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 ("================ ================ ================" );
test/cmd/bdinfo.c +0 -4
@@ -235,7 +235,6 @@ 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" ));
@@ -249,7 +248,6 @@ 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));
@@ -270,7 +268,6 @@ 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));
@@ -285,7 +282,6 @@ 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));
test/cmd/exit.c +0 -12
@@ -33,13 +33,11 @@ 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_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 )
@@ -47,7 +45,6 @@ static int cmd_exit_test(struct unit_test_state *uts)ut_assert_nextline ("%d" , i >0 ? i :0 );ut_assertok (ut_check_console_end (uts)); -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 )
@@ -58,20 +55,17 @@ static int cmd_exit_test(struct unit_test_state *uts) }/* 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_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_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 */
@@ -79,39 +73,33 @@ static int cmd_exit_test(struct unit_test_state *uts)ut_assertok (ut_check_console_end (uts));/* 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_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_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_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_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_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" );
test/cmd/fdt.c +2 -81
546 lines not on this page · raw message
test/cmd/font.c +0 -1
@@ -26,7 +26,6 @@ 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 ))
test/cmd/loadm.c +0 -2
@@ -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" );
@@ -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" );
test/cmd/mbr.c +1 -6
@@ -261,7 +261,6 @@ 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" );
@@ -281,9 +280,9 @@ 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!" );
@@ -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!" );
@@ -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!" );
@@ -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!" );
@@ -425,7 +421,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_assertf (0 ==run_commandf ("mbr write mmc 6" ),"Invalid partitions string: %s\n" , mbr_parts_buf);ut_assert_nextline ("MBR: write success!" );
test/cmd/mem_search.c +0 -13
@@ -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 ("--" );
@@ -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" );
@@ -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 ();
@@ -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 ("--" );
@@ -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 ();
@@ -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" );
@@ -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 ("--" );
@@ -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);
test/cmd/pinmux.c +0 -3
@@ -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 <pinname>' 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 );ut_assert_nextlinen ("single-pinctrl pinctrl-single-no-width: missing register width" );ut_assert_nextlinen ("P9 not found" );
test/cmd/pwm.c +0 -4
@@ -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 <invert> <pwm_dev_num> <channel> <polarity> */ /* 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 <invert> <pwm_dev_num> <channel> <polarity> */ ut_assertok (run_command ("pwm invert 1 0 1" ,0 ));ut_assert_console_end ();
test/cmd/rw.c +0 -2
@@ -87,12 +87,10 @@ 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 ();
test/cmd/seama.c +0 -3
@@ -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 ();
@@ -31,7 +30,6 @@ 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:" );
@@ -47,7 +45,6 @@ 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:" );
test/cmd/setexpr.c +0 -1
@@ -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));
test/cmd/temperature.c +0 -2
@@ -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" );
test/cmd/test_echo.c +1 -4
@@ -45,10 +45,7 @@ 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);
@@ -56,4 +53,4 @@ static int lib_test_hush_echo(struct unit_test_state *uts) }return 0 ; } -LIB_TEST (lib_test_hush_echo,0 ); +LIB_TEST (lib_test_hush_echo,UTF_CONSOLE );
test/cmd/test_pause.c +1 -4
@@ -14,7 +14,6 @@ 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 ));
@@ -23,7 +22,6 @@ static int lib_test_hush_pause(struct unit_test_state *uts)ut_assertok (ut_check_console_end (uts));/* 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 ));
@@ -32,7 +30,6 @@ static int lib_test_hush_pause(struct unit_test_state *uts)ut_assertok (ut_check_console_end (uts));/* 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 );
test/cmd/wget.c +3 -1
@@ -191,10 +191,12 @@ 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));
Signature · 1 line
2.34.1
PATCH 16/21 test: dm: Use UTF_CONSOLE in tests
In reply to Simon GlassSet this flag rather than doing things manually in the test.
---
test/dm/acpi.c | 15 ++++----------- test/dm/blkmap.c | 4 +--- test/dm/cros_ec.c | 14 ++++---------- test/dm/host.c | 4 +--- test/dm/mux-cmd.c | 2 +- test/dm/rng.c | 2 -- test/dm/rtc.c | 8 ++------ test/dm/scmi.c | 2 +- 8 files changed, 14 insertions(+), 37 deletions(-)
test/dm/acpi.c +4 -11
@@ -389,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 ("---- ---------------- ----- ----------------------------" );
@@ -416,7 +415,7 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_acpi_cmd_list,UTF_SCAN_PDATA |UTF_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)
@@ -433,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);
@@ -448,7 +445,7 @@ static int dm_test_acpi_cmd_dump(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_acpi_cmd_dump,UTF_SCAN_PDATA |UTF_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)
@@ -575,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 ("--- ----- -------- ---- -------------" );
@@ -586,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 ("---" );
@@ -594,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 ("---" );
@@ -608,7 +602,7 @@ static int dm_test_acpi_cmd_items(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_acpi_cmd_items,UTF_SCAN_PDATA |UTF_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)
@@ -619,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" );
@@ -646,7 +639,7 @@ static int dm_test_acpi_cmd_set(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_acpi_cmd_set,UTF_SCAN_PDATA |UTF_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
test/dm/blkmap.c +1 -3
@@ -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 );
test/dm/cros_ec.c +4 -10
@@ -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,UTF_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,UTF_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,UTF_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,UTF_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) {
test/dm/host.c +1 -3
@@ -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,UTF_SCAN_FDT ); +DM_TEST (dm_test_cmd_host,UTF_SCAN_FDT |UTF_CONSOLE );
test/dm/mux-cmd.c +1 -1
@@ -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,UTF_SCAN_PDATA |UTF_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) {
test/dm/rng.c +0 -2
@@ -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:" );
test/dm/rtc.c +2 -6
@@ -191,8 +191,6 @@ 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,UTF_SCAN_PDATA |UTF_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,UTF_SCAN_PDATA |UTF_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)
test/dm/scmi.c +1 -1
@@ -281,7 +281,7 @@ static int dm_test_scmi_cmd(struct unit_test_state *uts)return 0 ; } -DM_TEST (dm_test_scmi_cmd,UTF_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) {
Signature · 1 line
2.34.1
PATCH 17/21 test: hush: Use UTF_CONSOLE in tests
In reply to Simon GlassSet this flag rather than doing things manually in the test.
---
test/hush/dollar.c | 10 +++------- test/hush/loop.c | 11 +++-------- 2 files changed, 6 insertions(+), 15 deletions(-)
test/hush/dollar.c +3 -7
@@ -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 );
test/hush/loop.c +3 -8
@@ -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 );
Signature · 1 line
2.34.1
Re: [PATCH 17/21] test: hush: Use UTF_CONSOLE in tests
Hi Simon,
Thank you for the patch.
Quoted 3 lines · Simon Glass
Set this flag rather than doing things manually in the test.
Signed-off-by Simon Glass <[email protected]>
Quoted 100 lines
---
test/hush/dollar.c | 10 +++------- test/hush/loop.c | 11 +++-------- 2 files changed, 6 insertions(+), 15 deletions(-)test/hush/dollar.c +3
-7@@ -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 );test/hush/loop.c +3
-8@@ -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 );Signature · 1 line
2.34.1
PATCH 18/21 test: log: Use UTF_CONSOLE in tests
In reply to Simon GlassSet this flag rather than doing things manually in the test.
---
include/test/log.h | 5 +++-- test/log/cont_test.c | 1 - test/log/log_filter.c | 3 --- test/log/log_test.c | 19 ------------------- test/log/nolog_ndebug.c | 1 - test/log/nolog_test.c | 8 -------- test/log/pr_cont_test.c | 1 - 7 files changed, 3 insertions(+), 35 deletions(-)
include/test/log.h +3 -2
@@ -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__ */
test/log/cont_test.c +0 -1
@@ -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;
test/log/log_filter.c +0 -3
@@ -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 ();
test/log/log_test.c +0 -19
@@ -110,11 +110,9 @@ 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 ();
@@ -134,7 +132,6 @@ 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 ();
@@ -151,11 +148,9 @@ 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 ();
@@ -172,7 +167,6 @@ 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 );
@@ -190,7 +184,6 @@ 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 ();
@@ -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 );
@@ -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 ();
@@ -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 ();
@@ -264,7 +254,6 @@ 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 );
@@ -296,7 +285,6 @@ 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__);
@@ -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 ();
@@ -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 ();
@@ -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, LOGL_WARNING + 1,
@@ -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 );
@@ -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,
@@ -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 */
test/log/nolog_ndebug.c +0 -1
@@ -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++)
test/log/nolog_test.c +0 -8
@@ -25,7 +25,6 @@ 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" ));
@@ -39,7 +38,6 @@ 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" ));
@@ -53,7 +51,6 @@ 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" ));
@@ -67,7 +64,6 @@ 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" ));
@@ -83,7 +79,6 @@ 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));
@@ -96,7 +91,6 @@ 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,"" ));
@@ -112,7 +106,6 @@ 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" ));
@@ -126,7 +119,6 @@ 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 ;
test/log/pr_cont_test.c +0 -1
@@ -28,7 +28,6 @@ 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;
Signature · 1 line
2.34.1
PATCH 19/21 test: Use UTF_CONSOLE in remaining tests
In reply to Simon GlassSet this flag rather than doing things manually in the test.
---
test/common/cread.c | 4 +--- test/common/test_autoboot.c | 3 +-- test/lib/test_print.c | 10 ++-------- test/print_ut.c | 15 --------------- 4 files changed, 4 insertions(+), 28 deletions(-)
test/common/cread.c +1 -3
@@ -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 );
test/common/test_autoboot.c +1 -2
@@ -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,4 +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 );
test/lib/test_print.c +2 -8
@@ -17,10 +17,7 @@ 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));
@@ -41,15 +38,12 @@ 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));
@@ -73,4 +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 );
test/print_ut.c +0 -15
@@ -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 ;
@@ -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 ;
Signature · 1 line
2.34.1
PATCH 20/21 test: Tidy up checking for console end
In reply to Simon GlassUse the ut_assert_console_end() function provided, rather than doing it separately.
---
test/cmd/bdinfo.c | 8 +- test/cmd/exit.c | 24 +++--- test/cmd/fdt.c | 178 ++++++++++++++++++++-------------------- test/cmd/font.c | 8 +- test/cmd/mbr.c | 12 +-- test/cmd/test_echo.c | 2 +- test/cmd/test_pause.c | 4 +- test/cmd/wget.c | 2 +- test/lib/test_print.c | 4 +- test/log/cont_test.c | 6 +- test/log/nolog_ndebug.c | 2 +- test/log/nolog_test.c | 16 ++-- test/log/pr_cont_test.c | 2 +- 13 files changed, 134 insertions(+), 134 deletions(-)
test/cmd/bdinfo.c +4 -4
@@ -239,7 +239,7 @@ static int bdinfo_test_full(struct unit_test_state *uts)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 ; }
@@ -259,7 +259,7 @@ 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 ; }
@@ -273,7 +273,7 @@ static int bdinfo_test_memory(struct unit_test_state *uts)ut_assertok (bdinfo_test_all (uts)); elseut_assertok (bdinfo_check_mem (uts )); -ut_assertok (ut_check_console_end (uts)); +ut_assert_console_end ();return 0 ; }
@@ -287,7 +287,7 @@ static int bdinfo_test_eth(struct unit_test_state *uts)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 ; }
test/cmd/exit.c +12 -12
@@ -36,14 +36,14 @@ static int cmd_exit_test(struct unit_test_state *uts)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 (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 (run_commandf ("setenv foo 'echo bar ; exit %d ; echo baz' ; run foo || echo quux ; echo $?" , i));ut_assert_nextline ("bar" );
@@ -51,61 +51,61 @@ static int cmd_exit_test(struct unit_test_state *uts)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 (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 (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 (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 (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 (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 (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 (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 (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 (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 ; }
test/cmd/fdt.c +89 -89
639 lines not on this page · raw message
test/cmd/font.c +4 -4
@@ -30,7 +30,7 @@ static int font_test_base(struct unit_test_state *uts)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);
@@ -48,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);
test/cmd/mbr.c +6 -6
@@ -264,7 +264,7 @@ static int mbr_test_run(struct unit_test_state *uts)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 ));
@@ -289,7 +289,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 00 |...%$..@........|
@@ -324,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 |...%$..@.......%|
@@ -359,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 |...%$..@.......%|
@@ -394,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 |...%$..@.......%|
@@ -426,7 +426,7 @@ static int mbr_test_run(struct unit_test_state *uts)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 |...%$..@.......%|
test/cmd/test_echo.c +1 -1
@@ -49,7 +49,7 @@ static int lib_test_hush_echo(struct unit_test_state *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 ; }
test/cmd/test_pause.c +2 -2
@@ -19,7 +19,7 @@ static int lib_test_hush_pause(struct unit_test_state *uts)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 */ /* Cook a newline when the command is expected to pause */
@@ -27,7 +27,7 @@ static int lib_test_hush_pause(struct unit_test_state *uts)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 */ /* No newline cooked here since the command is expected to fail */
test/cmd/wget.c +1 -1
@@ -199,7 +199,7 @@ static int net_test_wget(struct unit_test_state *uts)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 ; }
test/lib/test_print.c +2 -2
@@ -20,7 +20,7 @@ static int test_print_freq(struct unit_test_state *uts,print_freq (freq,";\n" );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 ; }
@@ -46,7 +46,7 @@ static int test_print_size(struct unit_test_state *uts,print_size (freq,";\n" );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 ; }
test/log/cont_test.c +3 -3
@@ -32,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 );
@@ -43,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 );
@@ -55,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 ; }
test/log/nolog_ndebug.c +1 -1
@@ -30,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 ; }
test/log/nolog_test.c +8 -8
@@ -28,7 +28,7 @@ static int log_test_nolog_err(struct unit_test_state *uts)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);
@@ -41,7 +41,7 @@ static int log_test_nolog_warning(struct unit_test_state *uts)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);
@@ -54,7 +54,7 @@ static int log_test_nolog_notice(struct unit_test_state *uts)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,7 +67,7 @@ static int log_test_nolog_info(struct unit_test_state *uts)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);
@@ -81,7 +81,7 @@ static int nolog_test_nodebug(struct unit_test_state *uts)memset (buf,0 ,BUFFSIZE );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);
@@ -94,7 +94,7 @@ static int log_test_nolog_nodebug(struct unit_test_state *uts)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);
@@ -109,7 +109,7 @@ static int nolog_test_debug(struct unit_test_state *uts)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);
@@ -124,7 +124,7 @@ static int log_test_nolog_debug(struct unit_test_state *uts) 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);
test/log/pr_cont_test.c +1 -1
@@ -34,7 +34,7 @@ static int log_test_pr_cont(struct unit_test_state *uts) 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 ; }
Signature · 1 line
2.34.1
PATCH 21/21 doc: Add a few notes about how to use console checking
In reply to Simon GlassTidy up the existing docs in line with current conventions.
---
doc/develop/commands.rst | 9 +++++---- doc/develop/tests_writing.rst | 1 - 2 files changed, 5 insertions(+), 5 deletions(-)
doc/develop/commands.rst +5 -4
@@ -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, UTF_SCAN_PDATA | UTF_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.
doc/develop/tests_writing.rst +0 -1
@@ -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("--");
Signature · 1 line
2.34.1