diff mbox series

[1/4] semihosting-tests: add timeout support

Message ID 20230105110007.1977399-2-alex.bennee@linaro.org
State New
Headers show
Series Some tweaks for semihosting-tests | expand

Commit Message

Alex Bennée Jan. 5, 2023, 11 a.m. UTC
If you break semihosting in a way that hangs you need to be able to
detect that. Add support for a timeout.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 1296fde..f58b79e 100644
--- a/Makefile
+++ b/Makefile
@@ -57,10 +57,14 @@  SYSGDB := -gdb tcp::$(GDBPORT)
 USRGDB := -g $(GDBPORT)
 endif
 
+ifdef TIMEOUT
+SYSTIMEOUT := timeout --foreground 10s
+endif
+
 QEMU_ARM = $(QEMU_BUILDDIR)/arm-linux-user/qemu-arm $(USRGDB)
 QEMU_AARCH64 = $(QEMU_BUILDDIR)/aarch64-linux-user/qemu-aarch64 $(USRGDB)
-QEMU_SYSTEM_ARM = $(QEMU_BUILDDIR)/arm-softmmu/qemu-system-arm $(SYSGDB)
-QEMU_SYSTEM_AARCH64 = $(QEMU_BUILDDIR)/aarch64-softmmu/qemu-system-aarch64 $(SYSGDB)
+QEMU_SYSTEM_ARM = $(SYSTIMEOUT) $(QEMU_BUILDDIR)/arm-softmmu/qemu-system-arm $(SYSGDB)
+QEMU_SYSTEM_AARCH64 = $(SYSTIMEOUT) $(QEMU_BUILDDIR)/aarch64-softmmu/qemu-system-aarch64 $(SYSGDB)
 
 all: usertest-a32 usertest-a64 usertest-t32 \
 	systest-a32.axf systest-t32.axf \