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 ($(GDB),)
18GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
19
20run-gdbstub-memory: memory
21	$(call run-test, $@, $(GDB_SCRIPT) \
22		--gdb $(GDB) \
23		--qemu $(QEMU) \
24		--output $<.gdb.out \
25		--qargs \
26		"-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
27		--bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \
28	softmmu gdbstub support)
29run-gdbstub-interrupt: interrupt
30	$(call run-test, $@, $(GDB_SCRIPT) \
31		--gdb $(GDB) \
32		--qemu $(QEMU) \
33		--output $<.gdb.out \
34		--qargs \
35		"-smp 2 -monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
36		--bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \
37	softmmu gdbstub support)
38run-gdbstub-untimely-packet: hello
39	$(call run-test, $@, $(GDB_SCRIPT) \
40		--gdb $(GDB) \
41		--gdb-args "-ex 'set debug remote 1'" \
42		--output untimely-packet.gdb.out \
43		--stderr untimely-packet.gdb.err \
44		--qemu $(QEMU) \
45		--bin $< --qargs \
46		"-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \
47	softmmu gdbstub untimely packets)
48	$(call quiet-command, \
49		(! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \
50		"GREP", file untimely-packet.gdb.err)
51else
52run-gdbstub-%:
53	$(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%,,$(TARGET_NAME)) support")
54endif
55
56MULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt run-gdbstub-untimely-packet
57