[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 03/11] tests/tcg: move some multiarch files and make condition
From: |
Alex Bennée |
Subject: |
[PATCH v1 03/11] tests/tcg: move some multiarch files and make conditional |
Date: |
Fri, 17 Sep 2021 17:23:24 +0100 |
We had some messy code to filter out stuff we can't build. Lets junk
that and simplify the logic by pushing some stuff into subdirs. In
particular we move:
float_helpers into libs - not a standalone test
linux-test into linux - so we only build on Linux hosts
This allows for at least some of the tests to be nominally usable
by *BSD user builds.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Warner Losh <imp@bsdimp.com>
---
tests/tcg/multiarch/{ => libs}/float_helpers.c | 2 +-
tests/tcg/multiarch/{ => linux}/linux-test.c | 0
tests/tcg/multiarch/Makefile.target | 15 ++++++++++-----
tests/tcg/x86_64/Makefile.target | 4 ++++
4 files changed, 15 insertions(+), 6 deletions(-)
rename tests/tcg/multiarch/{ => libs}/float_helpers.c (99%)
rename tests/tcg/multiarch/{ => linux}/linux-test.c (100%)
diff --git a/tests/tcg/multiarch/float_helpers.c
b/tests/tcg/multiarch/libs/float_helpers.c
similarity index 99%
rename from tests/tcg/multiarch/float_helpers.c
rename to tests/tcg/multiarch/libs/float_helpers.c
index bc530e5732..4e68d2b659 100644
--- a/tests/tcg/multiarch/float_helpers.c
+++ b/tests/tcg/multiarch/libs/float_helpers.c
@@ -22,7 +22,7 @@
#include <float.h>
#include <fenv.h>
-#include "float_helpers.h"
+#include "../float_helpers.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
diff --git a/tests/tcg/multiarch/linux-test.c
b/tests/tcg/multiarch/linux/linux-test.c
similarity index 100%
rename from tests/tcg/multiarch/linux-test.c
rename to tests/tcg/multiarch/linux/linux-test.c
diff --git a/tests/tcg/multiarch/Makefile.target
b/tests/tcg/multiarch/Makefile.target
index 85a6fb7a2e..3763df2019 100644
--- a/tests/tcg/multiarch/Makefile.target
+++ b/tests/tcg/multiarch/Makefile.target
@@ -8,18 +8,23 @@
MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
# Set search path for all sources
-VPATH += $(MULTIARCH_SRC)
-MULTIARCH_SRCS =$(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
-MULTIARCH_TESTS =$(filter-out float_helpers, $(MULTIARCH_SRCS:.c=))
+VPATH += $(MULTIARCH_SRC)
+MULTIARCH_SRCS = $(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
+ifneq ($(CONFIG_LINUX),)
+VPATH += $(MULTIARCH_SRC)/linux
+MULTIARCH_SRCS += $(notdir $(wildcard $(MULTIARCH_SRC)/linux/*.c))
+endif
+MULTIARCH_TESTS = $(MULTIARCH_SRCS:.c=)
+$(info SRCS=${MULTIARCH_SRCS} and ${MULTIARCH_TESTS})
#
# The following are any additional rules needed to build things
#
float_%: LDFLAGS+=-lm
-float_%: float_%.c float_helpers.c
- $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/float_helpers.c -o
$@ $(LDFLAGS)
+float_%: float_%.c libs/float_helpers.c
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $<
$(MULTIARCH_SRC)/libs/float_helpers.c -o $@ $(LDFLAGS)
run-float_%: float_%
$(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<,"$< on $(TARGET_NAME)")
diff --git a/tests/tcg/x86_64/Makefile.target b/tests/tcg/x86_64/Makefile.target
index 2151ea6302..d7a7385583 100644
--- a/tests/tcg/x86_64/Makefile.target
+++ b/tests/tcg/x86_64/Makefile.target
@@ -8,8 +8,12 @@
include $(SRC_PATH)/tests/tcg/i386/Makefile.target
+ifneq ($(CONFIG_LINUX),)
X86_64_TESTS += vsyscall
TESTS=$(MULTIARCH_TESTS) $(X86_64_TESTS) test-x86_64
+else
+TESTS=$(MULTIARCH_TESTS)
+endif
QEMU_OPTS += -cpu max
test-x86_64: LDFLAGS+=-lm -lc
--
2.30.2
- [PATCH v1 00/11] testing and plugin pre-PR (configure, gitlab, plugins), Alex Bennée, 2021/09/17
- [PATCH v1 01/11] configure: don't override the selected host test compiler if defined, Alex Bennée, 2021/09/17
- [PATCH v1 08/11] gitlab: skip the check-patch job on the upstream repo, Alex Bennée, 2021/09/17
- [PATCH v1 04/11] tests/docker: promote debian-riscv64-cross to a full image, Alex Bennée, 2021/09/17
- [PATCH v1 02/11] tests/tcg/sha1: remove endian include, Alex Bennée, 2021/09/17
- [PATCH v1 03/11] tests/tcg: move some multiarch files and make conditional,
Alex Bennée <=
- [PATCH v1 05/11] gitlab: Add cross-riscv64-system, cross-riscv64-user, Alex Bennée, 2021/09/17
- [PATCH v1 06/11] python: Update for pylint 2.10, Alex Bennée, 2021/09/17
- [PATCH v1 10/11] plugins/: Add missing functions to symbol list, Alex Bennée, 2021/09/17
- [PATCH v1 07/11] travis.yml: Remove the "Release tarball" job, Alex Bennée, 2021/09/17
- [PATCH v1 11/11] accel/tcg: re-factor plugin_inject_cb so we can assert insn_idx is valid, Alex Bennée, 2021/09/17
- [PATCH v1 09/11] gitlab: fix passing of TEST_TARGETS env to cirrus, Alex Bennée, 2021/09/17