summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile24
-rw-r--r--test/cmd_ut.c2
-rw-r--r--test/dm/Makefile6
-rw-r--r--test/dm/led.c72
-rw-r--r--test/dm/ofnode.c9
-rw-r--r--test/fuzz/Makefile2
-rw-r--r--test/lib/Makefile2
-rw-r--r--test/py/tests/test_efi_fit.py2
-rw-r--r--test/py/tests/test_efi_loader.py2
-rw-r--r--test/py/tests/test_efi_selftest.py2
-rw-r--r--test/test-main.c2
11 files changed, 103 insertions, 22 deletions
diff --git a/test/Makefile b/test/Makefile
index ed312cd0a48..145c952d2c3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -4,32 +4,32 @@
obj-y += test-main.o
-ifneq ($(CONFIG_$(SPL_)BLOBLIST),)
-obj-$(CONFIG_$(SPL_)CMDLINE) += bloblist.o
-obj-$(CONFIG_$(SPL_)CMDLINE) += bootm.o
+ifneq ($(CONFIG_$(XPL_)BLOBLIST),)
+obj-$(CONFIG_$(XPL_)CMDLINE) += bloblist.o
+obj-$(CONFIG_$(XPL_)CMDLINE) += bootm.o
endif
-obj-$(CONFIG_$(SPL_)CMDLINE) += cmd/
-obj-$(CONFIG_$(SPL_)CMDLINE) += cmd_ut.o
-obj-$(CONFIG_$(SPL_)CMDLINE) += command_ut.o
-obj-$(CONFIG_$(SPL_)UT_COMPRESSION) += compression.o
+obj-$(CONFIG_$(XPL_)CMDLINE) += cmd/
+obj-$(CONFIG_$(XPL_)CMDLINE) += cmd_ut.o
+obj-$(CONFIG_$(XPL_)CMDLINE) += command_ut.o
+obj-$(CONFIG_$(XPL_)UT_COMPRESSION) += compression.o
obj-y += dm/
obj-$(CONFIG_FUZZ) += fuzz/
ifndef CONFIG_SANDBOX_VPL
obj-$(CONFIG_UNIT_TEST) += lib/
endif
ifneq ($(CONFIG_HUSH_PARSER),)
-obj-$(CONFIG_$(SPL_)CMDLINE) += hush/
+obj-$(CONFIG_$(XPL_)CMDLINE) += hush/
endif
-obj-$(CONFIG_$(SPL_)CMDLINE) += print_ut.o
-obj-$(CONFIG_$(SPL_)CMDLINE) += str_ut.o
+obj-$(CONFIG_$(XPL_)CMDLINE) += print_ut.o
+obj-$(CONFIG_$(XPL_)CMDLINE) += str_ut.o
obj-$(CONFIG_UT_TIME) += time_ut.o
obj-y += ut.o
-ifeq ($(CONFIG_SPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)
obj-y += boot/
obj-$(CONFIG_UNIT_TEST) += common/
obj-y += log/
-obj-$(CONFIG_$(SPL_)UT_UNICODE) += unicode_ut.o
+obj-$(CONFIG_$(XPL_)UT_UNICODE) += unicode_ut.o
else
obj-$(CONFIG_SPL_UT_LOAD) += image/
endif
diff --git a/test/cmd_ut.c b/test/cmd_ut.c
index 38ba89ee33e..53fddebd49d 100644
--- a/test/cmd_ut.c
+++ b/test/cmd_ut.c
@@ -256,7 +256,7 @@ U_BOOT_LONGHELP(ut,
"\ntime - very basic test of time functions"
#endif
#if defined(CONFIG_UT_UNICODE) && \
- !defined(CONFIG_SPL_BUILD) && !defined(API_BUILD)
+ !defined(CONFIG_XPL_BUILD) && !defined(API_BUILD)
"\nunicode - Unicode functions"
#endif
);
diff --git a/test/dm/Makefile b/test/dm/Makefile
index c12589d487c..6c9ebb8d07c 100644
--- a/test/dm/Makefile
+++ b/test/dm/Makefile
@@ -7,7 +7,7 @@ obj-$(CONFIG_UT_DM) += test-dm.o
# Tests for particular subsystems - when enabling driver model for a new
# subsystem you must add sandbox tests here.
-ifeq ($(CONFIG_SPL_BUILD),y)
+ifeq ($(CONFIG_XPL_BUILD),y)
obj-$(CONFIG_SPL_OF_PLATDATA) += of_platdata.o
else
obj-$(CONFIG_UT_DM) += bus.o
@@ -42,7 +42,7 @@ obj-$(CONFIG_CLK) += clk.o clk_ccf.o
obj-$(CONFIG_CPU) += cpu.o
obj-$(CONFIG_CROS_EC) += cros_ec.o
obj-$(CONFIG_PWM_CROS_EC) += cros_ec_pwm.o
-obj-$(CONFIG_$(SPL_TPL_)DEVRES) += devres.o
+obj-$(CONFIG_$(PHASE_)DEVRES) += devres.o
obj-$(CONFIG_DMA) += dma.o
obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi_host.o
obj-$(CONFIG_DM_DSA) += dsa.o
@@ -102,7 +102,7 @@ obj-$(CONFIG_DM_RESET) += reset.o
obj-$(CONFIG_SYSRESET) += sysreset.o
obj-$(CONFIG_DM_REGULATOR) += regulator.o
obj-$(CONFIG_CMD_RKMTD) += rkmtd.o
-obj-$(CONFIG_$(SPL_TPL_)DM_RNG) += rng.o
+obj-$(CONFIG_$(PHASE_)DM_RNG) += rng.o
obj-$(CONFIG_DM_RTC) += rtc.o
obj-$(CONFIG_SCMI_FIRMWARE) += scmi.o
obj-$(CONFIG_SCSI) += scsi.o
diff --git a/test/dm/led.c b/test/dm/led.c
index e1509c397d8..884f6410b70 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -137,3 +137,75 @@ static int dm_test_led_blink(struct unit_test_state *uts)
}
DM_TEST(dm_test_led_blink, UTF_SCAN_PDATA | UTF_SCAN_FDT);
#endif
+
+/* Test LED boot */
+#ifdef CONFIG_LED_BOOT
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/boot-led is set to "sandbox:green" */
+ ut_assertok(led_get_by_label("sandbox:green", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_boot_on());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_boot_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+
+/* Test LED boot blink fallback */
+#ifndef CONFIG_LED_BLINK
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/boot-led is set to "sandbox:green" */
+ ut_assertok(led_get_by_label("sandbox:green", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_boot_blink());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_boot_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+#endif
+#endif
+
+/* Test LED activity */
+#ifdef CONFIG_LED_ACTIVITY
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/activity-led is set to "sandbox:red" */
+ ut_assertok(led_get_by_label("sandbox:red", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_activity_on());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_activity_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+
+/* Test LED activity blink fallback */
+#ifndef CONFIG_LED_BLINK
+static int dm_test_led_boot(struct unit_test_state *uts)
+{
+ struct udevice *dev
+
+ /* options/u-boot/activity-led is set to "sandbox:red" */
+ ut_assertok(led_get_by_label("sandbox:red", &dev));
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+ ut_assertok(led_activity_blink());
+ ut_asserteq(LEDST_ON, led_get_state(dev));
+ ut_assertok(led_activity_off());
+ ut_asserteq(LEDST_OFF, led_get_state(dev));
+
+ return 0;
+}
+#endif
+#endif
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index 859fc3ae0d0..ce996567c3c 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -614,6 +614,15 @@ static int dm_test_ofnode_options(struct unit_test_state *uts)
u64 bootscr_address, bootscr_offset;
u64 bootscr_flash_offset, bootscr_flash_size;
+ ut_assert(!ofnode_options_read_bool("missing"));
+ ut_assert(ofnode_options_read_bool("testing-bool"));
+
+ ut_asserteq(123, ofnode_options_read_int("testing-int", 0));
+ ut_asserteq(6, ofnode_options_read_int("missing", 6));
+
+ ut_assertnull(ofnode_options_read_str("missing"));
+ ut_asserteq_str("testing", ofnode_options_read_str("testing-str"));
+
ut_assertok(ofnode_read_bootscript_address(&bootscr_address,
&bootscr_offset));
ut_asserteq_64(0, bootscr_address);
diff --git a/test/fuzz/Makefile b/test/fuzz/Makefile
index 663b79ce80b..8a135b65e4b 100644
--- a/test/fuzz/Makefile
+++ b/test/fuzz/Makefile
@@ -4,5 +4,5 @@
# Written by Andrew Scull <ascull@google.com>
#
-obj-$(CONFIG_$(SPL_)CMDLINE) += cmd_fuzz.o
+obj-$(CONFIG_$(XPL_)CMDLINE) += cmd_fuzz.o
obj-$(CONFIG_VIRTIO_SANDBOX) += virtio.o
diff --git a/test/lib/Makefile b/test/lib/Makefile
index 70f14c46b1e..a54387a058e 100644
--- a/test/lib/Makefile
+++ b/test/lib/Makefile
@@ -2,7 +2,7 @@
#
# (C) Copyright 2018
# Mario Six, Guntermann & Drunck GmbH, mario.six@gdsys.cc
-ifeq ($(CONFIG_SPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)
obj-y += cmd_ut_lib.o
obj-y += abuf.o
obj-y += alist.o
diff --git a/test/py/tests/test_efi_fit.py b/test/py/tests/test_efi_fit.py
index 0ad483500f8..550058a30fd 100644
--- a/test/py/tests/test_efi_fit.py
+++ b/test/py/tests/test_efi_fit.py
@@ -119,7 +119,7 @@ FDT_DATA = '''
'''
@pytest.mark.buildconfigspec('bootm_efi')
-@pytest.mark.buildconfigspec('cmd_bootefi_hello_compile')
+@pytest.mark.buildconfigspec('BOOTEFI_HELLO_COMPILE')
@pytest.mark.buildconfigspec('fit')
@pytest.mark.notbuildconfigspec('generate_acpi_table')
@pytest.mark.requiredtool('dtc')
diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
index 5f3b448a066..707b2c9e795 100644
--- a/test/py/tests/test_efi_loader.py
+++ b/test/py/tests/test_efi_loader.py
@@ -170,7 +170,7 @@ def do_test_efi_helloworld_net(u_boot_console, proto):
assert expected_text not in output
@pytest.mark.buildconfigspec('of_control')
-@pytest.mark.buildconfigspec('cmd_bootefi_hello_compile')
+@pytest.mark.buildconfigspec('bootefi_hello_compile')
@pytest.mark.buildconfigspec('cmd_tftpboot')
def test_efi_helloworld_net_tftp(u_boot_console):
"""Run the helloworld.efi binary via TFTP.
diff --git a/test/py/tests/test_efi_selftest.py b/test/py/tests/test_efi_selftest.py
index 43f24245582..310d8ed294a 100644
--- a/test/py/tests/test_efi_selftest.py
+++ b/test/py/tests/test_efi_selftest.py
@@ -58,7 +58,7 @@ def test_efi_selftest_watchdog_reboot(u_boot_console):
u_boot_console.run_command(cmd='bootefi selftest', wait_for_prompt=False)
if u_boot_console.p.expect(['resetting', 'U-Boot']):
raise Exception('Reset failed in \'watchdog reboot\' test')
- u_boot_console.restart_uboot()
+ u_boot_console.run_command(cmd='', send_nl=False, wait_for_reboot=True)
@pytest.mark.buildconfigspec('cmd_bootefi_selftest')
def test_efi_selftest_text_input(u_boot_console):
diff --git a/test/test-main.c b/test/test-main.c
index b3d3e24cdce..479dbb33b72 100644
--- a/test/test-main.c
+++ b/test/test-main.c
@@ -47,7 +47,7 @@ enum fdtchk_t {
static enum fdtchk_t fdt_action(void)
{
/* For sandbox SPL builds, do nothing */
- if (IS_ENABLED(CONFIG_SANDBOX) && IS_ENABLED(CONFIG_SPL_BUILD))
+ if (IS_ENABLED(CONFIG_SANDBOX) && IS_ENABLED(CONFIG_XPL_BUILD))
return FDTCHK_NONE;
/* Do a copy for sandbox (but only the U-Boot build, not SPL) */