mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-27 16:01:27 +00:00
test: dm: Use UTF_CONSOLE in tests
Set this flag rather than doing things manually in the test. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
0af38d12d9
commit
675fde825a
8 changed files with 14 additions and 37 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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:");
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue