18041650aSAlex Bennée# -*- Mode: makefile -*-
28041650aSAlex Bennée#
38041650aSAlex Bennée# Multiarch system tests
48041650aSAlex Bennée#
58041650aSAlex Bennée# We just collect the tests together here and rely on the actual guest
6*8b81968cSMichael Tokarev# architecture to add to the test dependencies and deal with the
78041650aSAlex Bennée# complications of building.
88041650aSAlex Bennée#
98041650aSAlex Bennée
10c00506aaSAlex BennéeMULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
11c00506aaSAlex BennéeMULTIARCH_SYSTEM_SRC=$(MULTIARCH_SRC)/system
128041650aSAlex BennéeVPATH+=$(MULTIARCH_SYSTEM_SRC)
138041650aSAlex Bennée
148041650aSAlex BennéeMULTIARCH_TEST_SRCS=$(wildcard $(MULTIARCH_SYSTEM_SRC)/*.c)
158041650aSAlex BennéeMULTIARCH_TESTS = $(patsubst $(MULTIARCH_SYSTEM_SRC)/%.c, %, $(MULTIARCH_TEST_SRCS))
16c00506aaSAlex Bennée
17c00506aaSAlex Bennéeifneq ($(HAVE_GDB_BIN),)
18bcbc36a9SAlex Bennéeifeq ($(HOST_GDB_SUPPORTS_ARCH),y)
19c00506aaSAlex BennéeGDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
20c00506aaSAlex Bennée
21c00506aaSAlex Bennéerun-gdbstub-memory: memory
22c00506aaSAlex Bennée	$(call run-test, $@, $(GDB_SCRIPT) \
23c00506aaSAlex Bennée		--gdb $(HAVE_GDB_BIN) \
24c00506aaSAlex Bennée		--qemu $(QEMU) \
25c00506aaSAlex Bennée		--output $<.gdb.out \
26c00506aaSAlex Bennée		--qargs \
27c00506aaSAlex Bennée		"-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
28c00506aaSAlex Bennée		--bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \
29c6cf8a20SPaolo Bonzini	softmmu gdbstub support)
30dae66a3fSMatheus Tavares Bernardino
31dae66a3fSMatheus Tavares Bernardinorun-gdbstub-untimely-packet: hello
32dae66a3fSMatheus Tavares Bernardino	$(call run-test, $@, $(GDB_SCRIPT) \
33dae66a3fSMatheus Tavares Bernardino		--gdb $(HAVE_GDB_BIN) \
34dae66a3fSMatheus Tavares Bernardino		--gdb-args "-ex 'set debug remote 1'" \
35dae66a3fSMatheus Tavares Bernardino		--output untimely-packet.gdb.out \
36dae66a3fSMatheus Tavares Bernardino		--stderr untimely-packet.gdb.err \
37dae66a3fSMatheus Tavares Bernardino		--qemu $(QEMU) \
38dae66a3fSMatheus Tavares Bernardino		--bin $< --qargs \
39dae66a3fSMatheus Tavares Bernardino		"-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \
40dae66a3fSMatheus Tavares Bernardino	"softmmu gdbstub untimely packets")
41dae66a3fSMatheus Tavares Bernardino	$(call quiet-command, \
42dae66a3fSMatheus Tavares Bernardino		(! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \
43dae66a3fSMatheus Tavares Bernardino		"GREP", "file  untimely-packet.gdb.err")
44bcbc36a9SAlex Bennéeelse
45bcbc36a9SAlex Bennéerun-gdbstub-%:
46bcbc36a9SAlex Bennée	$(call skip-test, "gdbstub test $*", "no guest arch support")
47bcbc36a9SAlex Bennéeendif
488886ff28SAlex Bennéeelse
498886ff28SAlex Bennéerun-gdbstub-%:
508886ff28SAlex Bennée	$(call skip-test, "gdbstub test $*", "need working gdb")
51c00506aaSAlex Bennéeendif
528886ff28SAlex Bennée
53dae66a3fSMatheus Tavares BernardinoMULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-untimely-packet
54