| 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 | # To support the multiarch guests the target arch needs to provide a |
| 10 | # boot.S that jumps to main and provides a __sys_outc functions. |
| 11 | # Remember to update MULTIARCH_SOFTMMU_TARGETS in the tcg test |
| 12 | # Makefile.target when this is done. |
| 13 | # |
| 14 | |
| 15 | MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch |
| 16 | MULTIARCH_SYSTEM_SRC=$(MULTIARCH_SRC)/system |
| 17 | VPATH+=$(MULTIARCH_SYSTEM_SRC) |
| 18 | |
| 19 | MULTIARCH_TEST_SRCS=$(wildcard $(MULTIARCH_SYSTEM_SRC)/*.c) |
| 20 | MULTIARCH_TESTS = $(patsubst $(MULTIARCH_SYSTEM_SRC)/%.c, %, $(MULTIARCH_TEST_SRCS)) |
| 21 | |
| 22 | ifneq ($(GDB),) |
| 23 | GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py |
| 24 | |
| 25 | run-gdbstub-memory: memory |
| 26 | $(call run-test, $@, $(GDB_SCRIPT) \ |
| 27 | --gdb $(GDB) \ |
| 28 | --qemu $(QEMU) \ |
| 29 | --output $<.gdb.out \ |
| 30 | --qargs \ |
| 31 | "-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ |
| 32 | --bin $< --test $(MULTIARCH_SRC)/gdbstub/memory.py, \ |
| 33 | softmmu gdbstub support) |
| 34 | run-gdbstub-interrupt: interrupt |
| 35 | $(call run-test, $@, $(GDB_SCRIPT) \ |
| 36 | --gdb $(GDB) \ |
| 37 | --qemu $(QEMU) \ |
| 38 | --output $<.gdb.out \ |
| 39 | --qargs \ |
| 40 | "-smp 2 -monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ |
| 41 | --bin $< --test $(MULTIARCH_SRC)/gdbstub/interrupt.py, \ |
| 42 | softmmu gdbstub support) |
| 43 | run-gdbstub-untimely-packet: hello |
| 44 | $(call run-test, $@, $(GDB_SCRIPT) \ |
| 45 | --gdb $(GDB) \ |
| 46 | --gdb-args "-ex 'set debug remote 1'" \ |
| 47 | --output untimely-packet.gdb.out \ |
| 48 | --stderr untimely-packet.gdb.err \ |
| 49 | --qemu $(QEMU) \ |
| 50 | --bin $< --qargs \ |
| 51 | "-monitor none -display none -chardev file$(COMMA)path=untimely-packet.out$(COMMA)id=output $(QEMU_OPTS)", \ |
| 52 | softmmu gdbstub untimely packets) |
| 53 | $(call quiet-command, \ |
| 54 | (! grep -Fq 'Packet instead of Ack, ignoring it' untimely-packet.gdb.err), \ |
| 55 | "GREP", file untimely-packet.gdb.err) |
| 56 | |
| 57 | run-gdbstub-registers: memory |
| 58 | $(call run-test, $@, $(GDB_SCRIPT) \ |
| 59 | --gdb $(GDB) \ |
| 60 | --qemu $(QEMU) \ |
| 61 | --output $<.registers.gdb.out \ |
| 62 | --qargs \ |
| 63 | "-monitor none -display none -chardev file$(COMMA)path=$<.out$(COMMA)id=output $(QEMU_OPTS)" \ |
| 64 | --bin $< --test $(MULTIARCH_SRC)/gdbstub/registers.py, \ |
| 65 | softmmu gdbstub support) |
| 66 | else |
| 67 | run-gdbstub-%: |
| 68 | $(call skip-test, "gdbstub test $*", "need working gdb with $(patsubst -%,,$(TARGET_NAME)) support") |
| 69 | endif |
| 70 | |
| 71 | MULTIARCH_RUNS += run-gdbstub-memory run-gdbstub-interrupt \ |
| 72 | run-gdbstub-untimely-packet run-gdbstub-registers |
| 73 | |
| 74 | ifeq ($(CONFIG_PLUGIN),y) |
| 75 | # Test plugin memory access instrumentation |
| 76 | run-plugin-memory-with-libmem.so: memory libmem.so |
| 77 | run-plugin-memory-with-libmem.so: PLUGIN_ARGS=$(COMMA)region-summary=true |
| 78 | run-plugin-memory-with-libmem.so: CHECK_PLUGIN_OUTPUT_COMMAND=$(MULTIARCH_SYSTEM_SRC)/validate-memory-counts.py $@.out |
| 79 | |
| 80 | EXTRA_RUNS_WITH_PLUGIN += run-plugin-memory-with-libmem.so |
| 81 | endif |