]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: dm: Use UTF_CONSOLE in tests
authorSimon Glass <sjg@chromium.org>
Thu, 22 Aug 2024 13:57:59 +0000 (07:57 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 27 Aug 2024 00:51:49 +0000 (18:51 -0600)
Set this flag rather than doing things manually in the test.

Signed-off-by: Simon Glass <sjg@chromium.org>
test/dm/acpi.c
test/dm/blkmap.c
test/dm/cros_ec.c
test/dm/host.c
test/dm/mux-cmd.c
test/dm/rng.c
test/dm/rtc.c
test/dm/scmi.c

index 4c5f8b593c72501c89754282d45735ec51084e0f..7ccd7f8d20a56f41010ddf2f4d6d43bd2f029a8c 100644 (file)
@@ -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
index 7581e62df3bb1b5d34cd5ad0073398b040a8983f..a6a0b4d4e208f6b9b50b90d24f254d5b77d3f9ad 100644 (file)
@@ -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);
index 1108af4396cceff494dd735edd4d835d88d6cbd6..089f6670a3f85d45035edcfa64b03095238a37b5 100644 (file)
@@ -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)
 {
index ff6f43b3e317c10cac55a61009c43a0ccaa7566b..f577377da6a0fb0a6ab1a500836b6e3dd16c7131 100644 (file)
@@ -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);
index 3aadc159ae825f423376fa3724c28ead55423f68..6eb3b283161096adb4348e8eaae0deaa96f45ddb 100644 (file)
@@ -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)
 {
index 8ed4e1373ea799f9610dc747e2dcb96faa3247d3..d7ef0722ff547493f308bc3261aaff0b43b7e3d2 100644 (file)
@@ -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:");
index e52abbc49da9abdea69739f2009ab1d7dc6f6fa4..88f080b64a8380e711ca271d7fed29393d277174 100644 (file)
@@ -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)
index 5c540fc0583ec445de7464fdd68b92d2df486ed6..3655594c26d60e3c991b287746e0927c647a199e 100644 (file)
@@ -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)
 {