aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/multiarch/system/Makefile.softmmu-target
blob: 4171b4e6aa0ce3e6bd28555b473121574241626e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- Mode: makefile -*-
#
# Multiarch system tests
#
# We just collect the tests together here and rely on the actual guest
# architecture to add to the test dependencies and deal with the
# complications of building.
#
# To support the multiarch guests the target arch needs to provide a
# boot.S that jumps to main and provides a __sys_outc functions.
# Remember to update MULTIARCH_SOFTMMU_TARGETS in the tcg test
# Makefile.target when this is done.
#

MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch
MULTIARCH_SYSTEM_SRC=$(MULTIARCH_SRC)/system
VPATH+=$(MULTIARCH_SYSTEM_SRC)

MULTIARCH_TEST_SRCS=$(wildcard $(MULTIARCH_SYSTEM_SRC)/*.c)
MULTIARCH_TESTS = $(patsubst $(MULTIARCH_SYSTEM_SRC)/%.c, %, $(MULTIARCH_TEST_SRCS))

ifneq ($(GDB),)
GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py

run-gdbstub-memory: memory
	$(call run-test, $@, $(GDB_SCRIPT) \
		--gdb $(GDB) \
		--qemu $(QEMU) \
		--output $<.gdb.out \
		--qargs \
		"-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
		--bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \
	softmmu gdbstub support)
run-gdbstub-interrupt: interrupt
	$(call run-test, $@, $(GDB_SCRIPT) \
		--gdb $(GDB) \
		--qemu $(QEMU) \
		--output $<.gdb.out \
		--qargs \
		"-smp 2 -monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
		--bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \
	softmmu gdbstub support)
run-gdbstub-untimely-packet: hello
	$(call run-test, $@, $(GDB_SCRIPT) \
		--gdb $(GDB) \
		--gdb-args "-ex 'set debug remote 1'" \
		--output untimely-packet.gdb.out \
		--stderr untimely-packet.gdb.err \
		--qemu $(QEMU) \
		--bin $< --qargs \
		"-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \
	softmmu gdbstub untimely packets)
	$(call quiet-command, \
		(! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \
		"GREP", file untimely-packet.gdb.err)

run-gdbstub-registers: memory
	$(call run-test, $@, $(GDB_SCRIPT) \
		--gdb $(GDB) \
		--qemu $(QEMU) \
		--output $<.registers.gdb.out \
		--qargs \
		"-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \
		--bin $< --test $(MULTIARCH_SRC)/gdbstub/registers.py, \
	softmmu gdbstub support)
else
run-gdbstub-%:
	$(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%,,$(TARGET_NAME)) support")
endif

MULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt \
	run-gdbstub-untimely-packet run-gdbstub-registers

ifeq ($(CONFIG_PLUGIN),y)
# Test plugin memory access instrumentation
run-plugin-memory-with-libmem.so: memory libmem.so
run-plugin-memory-with-libmem.so: PLUGIN_ARGS=$(COMMA)region-summary=true
run-plugin-memory-with-libmem.so: CHECK_PLUGIN_OUTPUT_COMMAND=$(MULTIARCH_SYSTEM_SRC)/validate-memory-counts.py $@.out

EXTRA_RUNS += run-plugin-memory-with-libmem.so
endif