[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 14/14] tests/tcg: add user version of dumb-as-bricks semiconsol
From: |
Alex Bennée |
Subject: |
[PULL v2 14/14] tests/tcg: add user version of dumb-as-bricks semiconsole test |
Date: |
Thu, 9 Jan 2020 14:18:58 +0000 |
There are linux-user users of semihosting so we'd better check things
work for them as well.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
diff --git a/tests/tcg/arm/semiconsole.c b/tests/tcg/arm/semiconsole.c
new file mode 100644
index 00000000000..6ef0bd24500
--- /dev/null
+++ b/tests/tcg/arm/semiconsole.c
@@ -0,0 +1,27 @@
+/*
+ * linux-user semihosting console
+ *
+ * Copyright (c) 2019
+ * Written by Alex Bennée <address@hidden>
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include "semicall.h"
+
+int main(void)
+{
+ char c;
+
+ printf("Semihosting Console Test\n");
+ printf("hit X to exit:");
+
+ do {
+ c = __semi_call(SYS_READC, 0);
+ printf("got '%c'\n", c);
+ } while (c != 'X');
+
+ return 0;
+}
diff --git a/tests/tcg/aarch64/Makefile.target
b/tests/tcg/aarch64/Makefile.target
index 96d2321045a..df3fe8032c3 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -32,4 +32,11 @@ run-plugin-semihosting-with-%:
$(call strip-plugin,$<) 2> $<.err, \
"$< on $(TARGET_NAME) with $*")
+AARCH64_TESTS += semiconsole
+run-semiconsole: semiconsole
+ $(call skip-test, $<, "MANUAL ONLY")
+
+run-plugin-semiconsole-with-%:
+ $(call skip-test, $<, "MANUAL ONLY")
+
TESTS += $(AARCH64_TESTS)
diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target
index 41aa26f4e17..11c39c601ea 100644
--- a/tests/tcg/arm/Makefile.target
+++ b/tests/tcg/arm/Makefile.target
@@ -49,6 +49,25 @@ run-plugin-semihosting-with-%:
$(call strip-plugin,$<) 2> $<.err, \
"$< on $(TARGET_NAME) with $*")
+ARM_TESTS += semiconsole semiconsole-arm
+
+semiconsole: CFLAGS += -mthumb
+run-semiconsole: semiconsole
+ $(call skip-test, $<, "MANUAL ONLY")
+
+run-plugin-semiconsole-with-%:
+ $(call skip-test, $<, "MANUAL ONLY")
+
+semiconsole-arm: CFLAGS += -marm
+semiconsole-arm: semiconsole.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
+
+run-semiconsole-arm: semiconsole-arm
+ $(call skip-test, $<, "MANUAL ONLY")
+
+run-plugin-semiconsole-arm-with-%:
+ $(call skip-test, $<, "MANUAL ONLY")
+
TESTS += $(ARM_TESTS)
# On ARM Linux only supports 4k pages
--
2.20.1
- [PULL v2 01/14] hw/i386/x86-iommu: Add missing stubs, (continued)
- [PULL v2 01/14] hw/i386/x86-iommu: Add missing stubs, Alex Bennée, 2020/01/09
- [PULL v2 03/14] freebsd: use python37, Alex Bennée, 2020/01/09
- [PULL v2 04/14] travis.yml: avocado: Print logs of non-pass tests only, Alex Bennée, 2020/01/09
- [PULL v2 05/14] travis.yml: Detach build and test steps, Alex Bennée, 2020/01/09
- [PULL v2 06/14] travis.yml: duplicate before_script for MacOSX, Alex Bennée, 2020/01/09
- [PULL v2 07/14] travis.yml: install homebrew python for OS X, Alex Bennée, 2020/01/09
- [PULL v2 09/14] target/arm: remove unused EXCP_SEMIHOST leg, Alex Bennée, 2020/01/09
- [PULL v2 08/14] testing: don't nest build for fp-test, Alex Bennée, 2020/01/09
- [PULL v2 13/14] tests/tcg: extract __semi_call into a header and expand, Alex Bennée, 2020/01/09
- [PULL v2 10/14] target/arm: only update pc after semihosting completes, Alex Bennée, 2020/01/09
- [PULL v2 14/14] tests/tcg: add user version of dumb-as-bricks semiconsole test,
Alex Bennée <=
- [PULL v2 11/14] semihosting: add qemu_semihosting_console_inc for SYS_READC, Alex Bennée, 2020/01/09
- [PULL v2 12/14] tests/tcg: add a dumb-as-bricks semihosting console test, Alex Bennée, 2020/01/09
- Re: [PULL v2 00/14] testing fixes and semihosting console support, Peter Maydell, 2020/01/10