1# -*- Mode: makefile -*-
2#
3# Multiarch system tests
4#
5# We just collect the tests together here and rely on the actual guest
6# architecture to add to the test dependencies and deal with the
7# complications of building.
8#
9
10MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
11MULTIARCH_SYSTEM_SRC=$(MULTIARCH_SRC)/system
12VPATH+=$(MULTIARCH_SYSTEM_SRC)
13
14MULTIARCH_TEST_SRCS=$(wildcard $(MULTIARCH_SYSTEM_SRC)/*.c)
15MULTIARCH_TESTS = $(patsubst $(MULTIARCH_SYSTEM_SRC)/%.c, %, $(MULTIARCH_TEST_SRCS))
16
17ifneq ($(HAVE_GDB_BIN),)
18ifeq ($(HOST_GDB_SUPPORTS_ARCH),y)
19GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
20
21run-gdbstub-memory: memory
22	$(call run-test, $@, $(GDB_SCRIPT) \
23		--gdb $(HAVE_GDB_BIN) \
24		--qemu $(QEMU) \
25		--output $<.gdb.out \
26		--qargs \
27		"-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
28		--bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \
29	softmmu gdbstub support)
30run-gdbstub-interrupt: interrupt
31	$(call run-test, $@, $(GDB_SCRIPT) \
32		--gdb $(HAVE_GDB_BIN) \
33		--qemu $(QEMU) \
34		--output $<.gdb.out \
35		--qargs \
36		"-smp 2 -monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
37		--bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \
38	softmmu gdbstub support)
39run-gdbstub-untimely-packet: hello
40	$(call run-test, $@, $(GDB_SCRIPT) \
41		--gdb $(HAVE_GDB_BIN) \
42		--gdb-args "-ex 'set debug remote 1'" \
43		--output untimely-packet.gdb.out \
44		--stderr untimely-packet.gdb.err \
45		--qemu $(QEMU) \
46		--bin $< --qargs \
47		"-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \
48	softmmu gdbstub untimely packets)
49	$(call quiet-command, \
50		(! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \
51		"GREP", file untimely-packet.gdb.err)
52else
53run-gdbstub-%:
54	$(call skip-test, "gdbstub test $*", "no guest arch support")
55endif
56else
57run-gdbstub-%:
58	$(call skip-test, "gdbstub test $*", "need working gdb")
59endif
60
61MULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt run-gdbstub-untimely-packet
62