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
68b81968cSMichael 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
17a47dd5c5SPaolo Bonziniifneq ($(GDB),)
18c00506aaSAlex BennéeGDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py
19c00506aaSAlex Bennée
20c00506aaSAlex Bennéerun-gdbstub-memory: memory
21c00506aaSAlex Bennée	$(call run-test, $@, $(GDB_SCRIPT) \
22a47dd5c5SPaolo Bonzini		--gdb $(GDB) \
23c00506aaSAlex Bennée		--qemu $(QEMU) \
24c00506aaSAlex Bennée		--output $<.gdb.out \
25c00506aaSAlex Bennée		--qargs \
26c00506aaSAlex Bennée		"-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
27c00506aaSAlex Bennée		--bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \
28c6cf8a20SPaolo Bonzini	softmmu gdbstub support)
29761e3c10SMatheus Branco Borellarun-gdbstub-interrupt: interrupt
30761e3c10SMatheus Branco Borella	$(call run-test, $@, $(GDB_SCRIPT) \
31a47dd5c5SPaolo Bonzini		--gdb $(GDB) \
32761e3c10SMatheus Branco Borella		--qemu $(QEMU) \
33761e3c10SMatheus Branco Borella		--output $<.gdb.out \
34761e3c10SMatheus Branco Borella		--qargs \
35761e3c10SMatheus Branco Borella		"-smp 2 -monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
36761e3c10SMatheus Branco Borella		--bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \
37761e3c10SMatheus Branco Borella	softmmu gdbstub support)
38dae66a3fSMatheus Tavares Bernardinorun-gdbstub-untimely-packet: hello
39dae66a3fSMatheus Tavares Bernardino	$(call run-test, $@, $(GDB_SCRIPT) \
40a47dd5c5SPaolo Bonzini		--gdb $(GDB) \
41dae66a3fSMatheus Tavares Bernardino		--gdb-args "-ex 'set debug remote 1'" \
42dae66a3fSMatheus Tavares Bernardino		--output untimely-packet.gdb.out \
43dae66a3fSMatheus Tavares Bernardino		--stderr untimely-packet.gdb.err \
44dae66a3fSMatheus Tavares Bernardino		--qemu $(QEMU) \
45dae66a3fSMatheus Tavares Bernardino		--bin $< --qargs \
46dae66a3fSMatheus Tavares Bernardino		"-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \
47bb16cb45SAlex Bennée	softmmu gdbstub untimely packets)
48dae66a3fSMatheus Tavares Bernardino	$(call quiet-command, \
49dae66a3fSMatheus Tavares Bernardino		(! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \
50bb16cb45SAlex Bennée		"GREP", file untimely-packet.gdb.err)
51*21750c3cSAlex Bennée
52*21750c3cSAlex Bennéerun-gdbstub-registers: memory
53*21750c3cSAlex Bennée	$(call run-test, $@, $(GDB_SCRIPT) \
54*21750c3cSAlex Bennée		--gdb $(GDB) \
55*21750c3cSAlex Bennée		--qemu $(QEMU) \
56*21750c3cSAlex Bennée		--output $<.registers.gdb.out \
57*21750c3cSAlex Bennée		--qargs \
58*21750c3cSAlex Bennée		"-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
59*21750c3cSAlex Bennée		--bin $< --test $(MULTIARCH_SRC)/gdbstub/registers.py, \
60*21750c3cSAlex Bennée	softmmu gdbstub support)
61bcbc36a9SAlex Bennéeelse
62bcbc36a9SAlex Bennéerun-gdbstub-%:
63a47dd5c5SPaolo Bonzini	$(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%,,$(TARGET_NAME)) support")
64c00506aaSAlex Bennéeendif
658886ff28SAlex Bennée
66*21750c3cSAlex BennéeMULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt \
67*21750c3cSAlex Bennée	run-gdbstub-untimely-packet run-gdbstub-registers
68