# -*- Mode: makefile -*-
#
# TCG tests
#
# These are complicated by the fact we want to build them for guest
# systems. This requires knowing what guests we are building and which
# ones we have cross-compilers for or docker images with
# cross-compilers.
#
# The tests themselves should be as minimal as possible as
# cross-compilers don't always have a large amount of libraries
# available.
#
# We only include the host build system for SRC_PATH and we don't
# bother with the common rules.mk. We expect the following:
#
#   CC - the C compiler command
#   EXTRA_CFLAGS - any extra CFLAGS
#   BUILD_STATIC - are we building static binaries
#
# By default all tests are statically compiled but some host systems
# may not package static libraries by default. If an external
# cross-compiler can only build dynamic libraries the user might need
# to make extra efforts to ensure ld.so can link at runtime when the
# tests are run.
#
# We also accept SPEED=slow to enable slower running tests
#
# We also expect to be in the tests build dir for the FOO-(linux-user|softmmu).
#

all:
-include ../config-host.mak
-include config-target.mak

# Get semihosting definitions for user-mode emulation
ifeq ($(filter %-softmmu, $(TARGET)),)
-include $(SRC_PATH)/configs/targets/$(TARGET).mak
endif

# for including , in command strings
COMMA := ,
NULL :=
SPACE := $(NULL) #
TARGET_PREFIX=tests/tcg/$(TARGET):$(SPACE)

quiet-@ = $(if $(V),,@$(if $1,printf "  %-7s %s\n" "$(strip $1)" "$(strip $2)" && ))
quiet-command = $(call quiet-@,$2,$3)$1

cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>&1
cc-option = if $(call cc-test, $1); then \
    echo "$(TARGET_PREFIX)$1 detected" && echo "$(strip $2)=$(strip $1)" >&3; else \
    echo "$(TARGET_PREFIX)$1 not detected"; fi

# $1 = test name, $2 = cmd, $3 = desc
ifeq ($(filter %-softmmu, $(TARGET)),)
run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2 > $1.out, \
	TEST,$(or $3, $*, $<) on $(TARGET_NAME))
else
run-test = $(call quiet-command, timeout -s KILL --foreground $(TIMEOUT) $2, \
        TEST,$(or $3, $*, $<) on $(TARGET_NAME))
endif

# $1 = test name, $2 = reference
# to work around the pipe squashing the status we only pipe the result if
# we know it failed and then force failure at the end.
diff-out = $(call quiet-command, diff -q $1.out $2 || \
                                 (diff -u $1.out $2 | head -n 10 && false), \
                                 DIFF,$1.out with $2)

# $1 = test name, $2 = reason
skip-test = @printf "  SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2

# $1 = test name, $2 = reference
# As above but only diff if reference file exists, otherwise the test
# passes if it managed to complete with a status of zero
conditional-diff-out = 							\
	$(if $(wildcard $2), 						\
		$(call diff-out,$1,$2), 				\
		$(call skip-test,"$1 check","no reference"))


# Tests we are building
TESTS=
# additional tests which may re-use existing binaries
EXTRA_TESTS=

# Start with a blank slate, the build targets get to add stuff first
CFLAGS=
LDFLAGS=

QEMU_OPTS=
CHECK_PLUGIN_OUTPUT_COMMAND=


# If TCG debugging, or TCI is enabled things are a lot slower
# so we have to set our timeout for that. The current worst case
# offender is the system memory test running under TCI.
TIMEOUT=120

ifeq ($(filter %-softmmu, $(TARGET)),)
# The order we include is important. We include multiarch first and
# then the target. If there are common tests shared between
# sub-targets (e.g. ARM & AArch64) then it is up to
# $(TARGET_NAME)/Makefile.target to include the common parent
# architecture in its VPATH. However some targets are so minimal we
# can't even build the multiarch tests.
ifneq ($(filter $(TARGET_NAME),aarch64_be),)
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
else
-include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target
endif

# Add the common build options
CFLAGS+=-Wall -Werror -O0 -g -fno-strict-aliasing
ifeq ($(BUILD_STATIC),y)
LDFLAGS+=-static
endif

%: %.c
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
%: %.S
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -Wa,--noexecstack $< -o $@ $(LDFLAGS)
else
# For system targets we include a different Makefile fragment as the
# build options for bare programs are usually pretty different. They
# are expected to provide their own build recipes.
EXTRA_CFLAGS += -ffreestanding -fno-stack-protector
-include $(SRC_PATH)/tests/tcg/minilib/Makefile.target
-include $(SRC_PATH)/tests/tcg/multiarch/system/Makefile.softmmu-target
-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.softmmu-target

endif

all: $(TESTS) $(EXTRA_TESTS)

#
# Test Runners
#
# By default we just run the test with the appropriate QEMU for the
# target. More advanced tests may want to override the runner in their
# specific make rules. Additional runners for the same binary should
# be added to EXTRA_RUNS.
#

RUN_TESTS=$(patsubst %,run-%, $(TESTS))

# If plugins exist also include those in the tests
ifeq ($(CONFIG_PLUGIN),y)
PLUGIN_SRC=$(SRC_PATH)/tests/tcg/plugins
PLUGIN_LIB=../plugins
VPATH+=$(PLUGIN_LIB)
PLUGINS=$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))

# We need to ensure expand the run-plugin-TEST-with-PLUGIN
# pre-requistes manually here as we can't use stems to handle it. We
# only expand MULTIARCH_TESTS which are common on most of our targets
# to avoid an exponential explosion as new tests are added. We also
# add some special helpers the run-plugin- rules can use below.
# In more, extra tests can be added using ADDITIONAL_PLUGINS_TESTS variable.

ifneq ($(MULTIARCH_TESTS),)
$(foreach p,$(PLUGINS), \
	$(foreach t,$(MULTIARCH_TESTS) $(ADDITIONAL_PLUGINS_TESTS),\
		$(eval run-plugin-$(t)-with-$(p): $t $p) \
		$(eval RUN_TESTS+=run-plugin-$(t)-with-$(p))))
endif # MULTIARCH_TESTS
endif # CONFIG_PLUGIN

strip-plugin = $(wordlist 1, 1, $(subst -with-, ,$1))
extract-plugin = $(wordlist 2, 2, $(subst -with-, ,$1))

RUN_TESTS+=$(EXTRA_RUNS)

# Some plugins need additional arguments above the default to fully
# exercise things. We can define them on a per-test basis here.
run-plugin-%-with-libmem.so: PLUGIN_ARGS=$(COMMA)inline=true

ifeq ($(filter %-softmmu, $(TARGET)),)
run-%: %
	$(call run-test, $<, env QEMU=$(QEMU) $(QEMU) $(QEMU_OPTS) $<)

run-plugin-%:
	$(call run-test, $@, env QEMU=$(QEMU) $(QEMU) $(QEMU_OPTS) \
		-plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \
		-d plugin -D $*.pout \
		 $(call strip-plugin,$<))
	$(if $(CHECK_PLUGIN_OUTPUT_COMMAND),				      \
		$(call quiet-command, $(CHECK_PLUGIN_OUTPUT_COMMAND) $*.pout, \
		       TEST, check plugin $(call extract-plugin,$@) output    \
		       with $(call strip-plugin,$<)))
else
run-%: %
	$(call run-test, $<, \
	  $(QEMU) -monitor none -display none \
		  -chardev file$(COMMA)path=$<.out$(COMMA)id=output \
		  $(QEMU_OPTS) $<)

run-plugin-%:
	$(call run-test, $@, \
	  $(QEMU) -monitor none -display none \
		  -chardev file$(COMMA)path=$@.out$(COMMA)id=output \
	   	  -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@)$(PLUGIN_ARGS) \
	    	  -d plugin -D $*.pout \
		  $(QEMU_OPTS) $(call strip-plugin,$<))
	$(if $(CHECK_PLUGIN_OUTPUT_COMMAND),				      \
		$(call quiet-command, $(CHECK_PLUGIN_OUTPUT_COMMAND) $*.pout, \
		       TEST, check plugin $(call extract-plugin,$@) output    \
		       with $(call strip-plugin,$<)))
endif

gdb-%: %
	gdb --args $(QEMU) $(QEMU_OPTS) $<

.PHONY: run
run: $(RUN_TESTS)

clean:
	rm -f $(TESTS) *.o $(CLEANFILES)

distclean:
	rm -f config-cc.mak config-target.mak ../config-$(TARGET).mak

.PHONY: help
help:
	@echo "TCG tests help $(TARGET_NAME)"
	@echo "Built with $(CC)"
	@echo "Available tests:"
	@$(foreach t,$(RUN_TESTS),echo "  $t";)
