]> git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/multiarch/Makefile.target
semihosting: move semihosting tests to multiarch
[mirror_qemu.git] / tests / tcg / multiarch / Makefile.target
1 # -*- Mode: makefile -*-
2 #
3 # Multiarch Tests - included from tests/tcg/Makefile.target
4 #
5 # These tests are plain C and built without any architecture specific code.
6 #
7
8 MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
9
10 # Set search path for all sources
11 VPATH += $(MULTIARCH_SRC)
12 MULTIARCH_SRCS =$(notdir $(wildcard $(MULTIARCH_SRC)/*.c))
13 MULTIARCH_TESTS =$(filter-out float_helpers, $(MULTIARCH_SRCS:.c=))
14
15 #
16 # The following are any additional rules needed to build things
17 #
18
19
20 float_%: LDFLAGS+=-lm
21 float_%: float_%.c float_helpers.c
22 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/float_helpers.c -o $@ $(LDFLAGS)
23
24 run-float_%: float_%
25 $(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<,"$< on $(TARGET_NAME)")
26 $(call conditional-diff-out,$<,$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/$<.ref)
27
28
29 testthread: LDFLAGS+=-lpthread
30
31 threadcount: LDFLAGS+=-lpthread
32
33 # We define the runner for test-mmap after the individual
34 # architectures have defined their supported pages sizes. If no
35 # additional page sizes are defined we only run the default test.
36
37 # default case (host page size)
38 run-test-mmap: test-mmap
39 $(call run-test, test-mmap, $(QEMU) $<, \
40 "$< (default) on $(TARGET_NAME)")
41
42 # additional page sizes (defined by each architecture adding to EXTRA_RUNS)
43 run-test-mmap-%: test-mmap
44 $(call run-test, test-mmap-$*, $(QEMU) -p $* $<,\
45 "$< ($* byte pages) on $(TARGET_NAME)")
46
47 ifneq ($(HAVE_GDB_BIN),)
48 GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
49
50 run-gdbstub-sha1: sha1
51 $(call run-test, $@, $(GDB_SCRIPT) \
52 --gdb $(HAVE_GDB_BIN) \
53 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
54 --bin $< --test $(MULTIARCH_SRC)/gdbstub/sha1.py, \
55 "basic gdbstub support")
56
57 EXTRA_RUNS += run-gdbstub-sha1
58
59 run-gdbstub-qxfer-auxv-read: sha1
60 $(call run-test, $@, $(GDB_SCRIPT) \
61 --gdb $(HAVE_GDB_BIN) \
62 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \
63 --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-qxfer-auxv-read.py, \
64 "basic gdbstub qXfer:auxv:read support")
65
66 else
67 run-gdbstub-%:
68 $(call skip-test, "gdbstub test $*", "need working gdb")
69 endif
70 EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read
71
72 # ARM Compatible Semi Hosting Tests
73 #
74 # Despite having ARM in the name we actually have several
75 # architectures that implement it. We gate the tests on the feature
76 # appearing in config.
77 #
78 ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y)
79 VPATH += $(MULTIARCH_SRC)/arm-compat-semi
80
81 # Add -I path back to TARGET_NAME for semicall.h
82 semihosting: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
83
84 run-semihosting: semihosting
85 $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)")
86
87 run-plugin-semihosting-with-%:
88 $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
89 -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
90 $(call strip-plugin,$<) 2> $<.err, \
91 "$< on $(TARGET_NAME) with $*")
92
93 semiconsole: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME)
94
95 run-semiconsole: semiconsole
96 $(call skip-test, $<, "MANUAL ONLY")
97
98 run-plugin-semiconsole-with-%:
99 $(call skip-test, $<, "MANUAL ONLY")
100
101 TESTS += semihosting semiconsole
102 endif
103
104 # Update TESTS
105 TESTS += $(MULTIARCH_TESTS)