1# -*- Mode: makefile -*- 2# 3# Multiarch Tests - included from tests/tcg/Makefile.target 4# 5# These tests are plain C and built without any architecture specific code. 6# 7 8MULTIARCH_SRC=$(SRC_PATH)/tests/tcg/multiarch 9 10# Set search path for all sources 11VPATH += $(MULTIARCH_SRC) 12MULTIARCH_SRCS =$(notdir $(wildcard $(MULTIARCH_SRC)/*.c)) 13MULTIARCH_TESTS =$(filter-out float_helpers, $(MULTIARCH_SRCS:.c=)) 14 15# 16# The following are any additional rules needed to build things 17# 18 19 20float_%: LDFLAGS+=-lm 21float_%: float_%.c float_helpers.c 22 $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< $(MULTIARCH_SRC)/float_helpers.c -o $@ $(LDFLAGS) 23 24run-float_%: float_% 25 $(call run-test,$<, $(QEMU) $(QEMU_OPTS) $<,"$< on $(TARGET_NAME)") 26 $(call conditional-diff-out,$<,$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/$<.ref) 27 28 29testthread: LDFLAGS+=-lpthread 30 31threadcount: LDFLAGS+=-lpthread 32 33signals: LDFLAGS+=-lrt -lpthread 34 35# This triggers failures on s390x hosts about 4% of the time 36# This triggers failures for hppa-linux about 1% of the time 37run-signals: signals 38 $(call skip-test, $<, "BROKEN awaiting sigframe clean-ups and vdso support") 39 40 41# We define the runner for test-mmap after the individual 42# architectures have defined their supported pages sizes. If no 43# additional page sizes are defined we only run the default test. 44 45# default case (host page size) 46run-test-mmap: test-mmap 47 $(call run-test, test-mmap, $(QEMU) $<, \ 48 "$< (default) on $(TARGET_NAME)") 49 50# additional page sizes (defined by each architecture adding to EXTRA_RUNS) 51run-test-mmap-%: test-mmap 52 $(call run-test, test-mmap-$*, $(QEMU) -p $* $<,\ 53 "$< ($* byte pages) on $(TARGET_NAME)") 54 55ifneq ($(HAVE_GDB_BIN),) 56GDB_SCRIPT=$(SRC_PATH)/tests/guest-debug/run-test.py 57 58run-gdbstub-sha1: sha1 59 $(call run-test, $@, $(GDB_SCRIPT) \ 60 --gdb $(HAVE_GDB_BIN) \ 61 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ 62 --bin $< --test $(MULTIARCH_SRC)/gdbstub/sha1.py, \ 63 "basic gdbstub support") 64 65EXTRA_RUNS += run-gdbstub-sha1 66 67run-gdbstub-qxfer-auxv-read: sha1 68 $(call run-test, $@, $(GDB_SCRIPT) \ 69 --gdb $(HAVE_GDB_BIN) \ 70 --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ 71 --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-qxfer-auxv-read.py, \ 72 "basic gdbstub qXfer:auxv:read support") 73 74else 75run-gdbstub-%: 76 $(call skip-test, "gdbstub test $*", "need working gdb") 77endif 78EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read 79 80# ARM Compatible Semi Hosting Tests 81# 82# Despite having ARM in the name we actually have several 83# architectures that implement it. We gate the tests on the feature 84# appearing in config. 85# 86ifeq ($(CONFIG_ARM_COMPATIBLE_SEMIHOSTING),y) 87VPATH += $(MULTIARCH_SRC)/arm-compat-semi 88 89# Add -I path back to TARGET_NAME for semicall.h 90semihosting: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) 91 92run-semihosting: semihosting 93 $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") 94 95run-plugin-semihosting-with-%: 96 $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ 97 -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \ 98 $(call strip-plugin,$<) 2> $<.err, \ 99 "$< on $(TARGET_NAME) with $*") 100 101semiconsole: CFLAGS+=-I$(SRC_PATH)/tests/tcg/$(TARGET_NAME) 102 103run-semiconsole: semiconsole 104 $(call skip-test, $<, "MANUAL ONLY") 105 106run-plugin-semiconsole-with-%: 107 $(call skip-test, $<, "MANUAL ONLY") 108 109TESTS += semihosting semiconsole 110endif 111 112# Update TESTS 113TESTS += $(MULTIARCH_TESTS) 114