Makefile: Rename targets for make recursion
We make a few sub-directories recursively, in particular
$(TARGET_DIRS).
For goal "all", we do it the nice way: "all" has a prerequisite
subdir-T for each T in $(TARGET_DIRS), and T's recipe runs make
recursively. Behaves nicely with -j and -k.
For other goals such as "clean" and "install", the recipe runs make
recursively in a for loop. Ignores -j and -k.
The next commit will fix that for "clean" and "install". This commit
prepares the ground by renaming the targets we use for "all" to
include the goal for the sub-make. This will permit reusing them for
goals other than "all".
Targets subdir-T for T in $(TARGET_DIRS) run "make all" in T. Rename
to T/all, and declare phony.
Targets romsubdir-R for R in $(ROMS) run "make" in pc-bios/R. Default
goal is "all" for all R. Rename to pc-bios/R/all, and declare phony.
The remainder are renamed just for consistency.
Target subdir-dtc runs "make libbft/libfdt.a" in dtc. Rename to
dtc/all, and declare phony.
Target subdir-capstone runs make $(BUILD_DIR)/capstone/$(LIBCAPSTONE)
in $(SRC_PATH)/capstone. Rename to capstone/all, and declare phony.
Target subdir-slirp runs "make" in $(SRC_PATH)/slirp. Default goal is
all, which builds $(BUILD_DIR)/libslirp.a. Rename to slirp/all, and
declare phony.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190528082308.22032-4-armbru@redhat.com>
[Add compatibility gunk to keep make working across the rename]
2019-05-28 16:23:07 +08:00
|
|
|
# -*- Mode: makefile -*-
|
2017-08-10 16:50:25 +08:00
|
|
|
|
|
|
|
.PHONY: check-help
|
|
|
|
check-help:
|
|
|
|
@echo "Regression testing targets:"
|
|
|
|
@echo
|
2020-05-05 18:24:51 +08:00
|
|
|
@echo " $(MAKE) check Run block, qapi-schema, unit, softfloat, qtest and decodetree tests"
|
2018-11-09 23:07:10 +08:00
|
|
|
@echo
|
2017-11-21 17:55:10 +08:00
|
|
|
@echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target"
|
|
|
|
@echo " $(MAKE) check-qtest Run qtest tests"
|
|
|
|
@echo " $(MAKE) check-unit Run qobject tests"
|
|
|
|
@echo " $(MAKE) check-speed Run qobject speed tests"
|
|
|
|
@echo " $(MAKE) check-qapi-schema Run QAPI schema tests"
|
|
|
|
@echo " $(MAKE) check-block Run block tests"
|
2020-05-23 01:25:00 +08:00
|
|
|
ifeq ($(CONFIG_TCG),y)
|
2018-04-07 05:08:36 +08:00
|
|
|
@echo " $(MAKE) check-tcg Run TCG tests"
|
2019-01-08 01:25:44 +08:00
|
|
|
@echo " $(MAKE) check-softfloat Run FPU emulation tests"
|
2020-05-23 01:25:00 +08:00
|
|
|
endif
|
2018-10-18 23:31:33 +08:00
|
|
|
@echo " $(MAKE) check-acceptance Run all acceptance (functional) tests"
|
2018-11-09 23:07:10 +08:00
|
|
|
@echo
|
2019-12-12 04:44:27 +08:00
|
|
|
@echo " $(MAKE) check-report.tap Generates an aggregated TAP test report"
|
2018-10-18 23:31:32 +08:00
|
|
|
@echo " $(MAKE) check-venv Creates a Python venv for tests"
|
2018-11-09 23:07:10 +08:00
|
|
|
@echo " $(MAKE) check-clean Clean the tests and related data"
|
2017-08-10 16:50:25 +08:00
|
|
|
@echo
|
2020-07-01 21:56:51 +08:00
|
|
|
@echo "The following are useful for CI builds"
|
|
|
|
@echo " $(MAKE) check-build Build most test binaris"
|
2020-03-17 22:16:54 +08:00
|
|
|
@echo " $(MAKE) get-vm-images Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)"
|
|
|
|
@echo
|
2017-08-10 16:50:25 +08:00
|
|
|
@echo
|
|
|
|
@echo "The variable SPEED can be set to control the gtester speed setting."
|
2017-11-21 17:55:10 +08:00
|
|
|
@echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
|
2017-08-10 16:50:25 +08:00
|
|
|
@echo "changed with variable GTESTER_OPTIONS."
|
|
|
|
|
|
|
|
ifneq ($(wildcard config-host.mak),)
|
2012-03-08 19:29:00 +08:00
|
|
|
export SRC_PATH
|
|
|
|
|
2014-01-24 00:22:59 +08:00
|
|
|
# Get the list of all supported sysemu targets
|
|
|
|
SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
|
|
|
|
$(wildcard $(SRC_PATH)/default-configs/*-softmmu.mak)))
|
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
SPEED = quick
|
2012-01-11 03:10:43 +08:00
|
|
|
|
2018-04-07 05:08:36 +08:00
|
|
|
# Per guest TCG tests
|
|
|
|
|
2018-11-30 06:21:50 +08:00
|
|
|
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS))
|
|
|
|
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGET_DIRS))
|
|
|
|
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS))
|
2018-04-07 05:08:36 +08:00
|
|
|
|
2018-06-08 19:12:46 +08:00
|
|
|
# Probe for the Docker Builds needed for each build
|
2018-07-04 14:30:11 +08:00
|
|
|
$(foreach PROBE_TARGET,$(TARGET_DIRS), \
|
2019-08-07 22:35:22 +08:00
|
|
|
$(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs))
|
2018-06-08 19:12:46 +08:00
|
|
|
|
2020-10-03 15:00:46 +08:00
|
|
|
$(BUILD_TCG_TARGET_RULES): build-tcg-tests-%: $(if $(CONFIG_PLUGIN),test-plugins)
|
2019-08-07 22:35:22 +08:00
|
|
|
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
|
|
|
|
-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
|
|
|
|
SRC_PATH=$(SRC_PATH) \
|
2019-08-07 22:35:23 +08:00
|
|
|
V="$(V)" TARGET="$*" guest-tests, \
|
2018-06-16 02:20:55 +08:00
|
|
|
"BUILD", "TCG tests for $*")
|
2018-04-07 05:08:36 +08:00
|
|
|
|
2020-10-03 15:00:46 +08:00
|
|
|
$(RUN_TCG_TARGET_RULES): run-tcg-tests-%: build-tcg-tests-% all
|
2019-08-07 22:35:22 +08:00
|
|
|
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
|
|
|
|
-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
|
|
|
|
SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \
|
2019-08-07 22:35:23 +08:00
|
|
|
V="$(V)" TARGET="$*" run-guest-tests, \
|
2018-06-16 02:20:55 +08:00
|
|
|
"RUN", "TCG tests for $*")
|
2018-04-07 05:08:36 +08:00
|
|
|
|
2020-10-03 15:00:46 +08:00
|
|
|
$(CLEAN_TCG_TARGET_RULES): clean-tcg-tests-%:
|
2019-08-07 22:35:22 +08:00
|
|
|
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
|
|
|
|
-f $(SRC_PATH)/tests/tcg/Makefile.qemu \
|
2019-08-07 22:35:23 +08:00
|
|
|
SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \
|
2019-09-10 20:09:31 +08:00
|
|
|
"CLEAN", "TCG tests for $*")
|
2018-04-07 05:08:36 +08:00
|
|
|
|
|
|
|
.PHONY: build-tcg
|
|
|
|
build-tcg: $(BUILD_TCG_TARGET_RULES)
|
|
|
|
|
|
|
|
.PHONY: check-tcg
|
2019-02-28 18:15:29 +08:00
|
|
|
check-tcg: $(RUN_TCG_TARGET_RULES)
|
2018-04-07 05:08:36 +08:00
|
|
|
|
|
|
|
.PHONY: clean-tcg
|
|
|
|
clean-tcg: $(CLEAN_TCG_TARGET_RULES)
|
2012-03-28 21:42:01 +08:00
|
|
|
|
2018-10-18 23:31:32 +08:00
|
|
|
# Python venv for running tests
|
|
|
|
|
2018-10-18 23:31:33 +08:00
|
|
|
.PHONY: check-venv check-acceptance
|
2018-10-18 23:31:32 +08:00
|
|
|
|
|
|
|
TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
|
|
|
|
TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
|
2018-10-18 23:31:33 +08:00
|
|
|
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
|
|
|
|
# Controls the output generated by Avocado when running tests.
|
|
|
|
# Any number of command separated loggers are accepted. For more
|
|
|
|
# information please refer to "avocado --help".
|
2019-03-13 01:18:05 +08:00
|
|
|
AVOCADO_SHOW=app
|
tests/acceptance: use "arch:" tag to filter target specific tests
Currently, some tests contains target architecture information, in the
form of a "x86_64" tag. But that tag is not respected in the default
execution, that is, "make check-acceptance" doesn't do anything with
it.
That said, even the target architecture handling currently present in
the "avocado_qemu.Test" class is pretty limited. For instance, by
default, it chooses a target based on the host architecture.
Because the original implementation of the tags feature in Avocado did
not include any time of namespace or "key:val" mechanism, no tag has
relation to another tag. The new implementation of the tags feature
from version 67.0 onwards, allows "key:val" tags, and because of that,
a test can be classified with a tag in a given key. For instance, the
new proposed version of the "boot_linux_console.py" test, which
downloads and attempts to run a x86_64 kernel, is now tagged as:
:avocado: tags=arch:x86_64
This means that it can be filtered (out) when no x86_64 target is
available. At the same time, tests that don't have a "arch:" tag,
will not be filtered out.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20190312171824.5134-6-crosa@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-03-13 01:18:09 +08:00
|
|
|
AVOCADO_TAGS=$(patsubst %-softmmu,-t arch:%, $(filter %-softmmu,$(TARGET_DIRS)))
|
2018-10-18 23:31:32 +08:00
|
|
|
|
|
|
|
$(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
|
|
|
|
$(call quiet-command, \
|
|
|
|
$(PYTHON) -m venv --system-site-packages $@, \
|
|
|
|
VENV, $@)
|
|
|
|
$(call quiet-command, \
|
|
|
|
$(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV_REQ), \
|
|
|
|
PIP, $(TESTS_VENV_REQ))
|
|
|
|
$(call quiet-command, touch $@)
|
|
|
|
|
2018-10-18 23:31:33 +08:00
|
|
|
$(TESTS_RESULTS_DIR):
|
|
|
|
$(call quiet-command, mkdir -p $@, \
|
|
|
|
MKDIR, $@)
|
|
|
|
|
2018-10-18 23:31:32 +08:00
|
|
|
check-venv: $(TESTS_VENV_DIR)
|
|
|
|
|
2020-03-17 22:16:54 +08:00
|
|
|
FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(TARGETS))
|
|
|
|
FEDORA_31_ARCHES := x86_64 aarch64 ppc64le s390x
|
|
|
|
FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
|
|
|
|
|
|
|
|
# download one specific Fedora 31 image
|
|
|
|
get-vm-image-fedora-31-%: check-venv
|
|
|
|
$(call quiet-command, \
|
|
|
|
$(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
|
|
|
|
--distro=fedora --distro-version=31 --arch=$*, \
|
|
|
|
"AVOCADO", "Downloading acceptance tests VM image for $*")
|
|
|
|
|
|
|
|
# download all vm images, according to defined targets
|
|
|
|
get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
|
|
|
|
|
|
|
|
check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
|
2018-10-18 23:31:33 +08:00
|
|
|
$(call quiet-command, \
|
|
|
|
$(TESTS_VENV_DIR)/bin/python -m avocado \
|
|
|
|
--show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
|
tests/acceptance: use "arch:" tag to filter target specific tests
Currently, some tests contains target architecture information, in the
form of a "x86_64" tag. But that tag is not respected in the default
execution, that is, "make check-acceptance" doesn't do anything with
it.
That said, even the target architecture handling currently present in
the "avocado_qemu.Test" class is pretty limited. For instance, by
default, it chooses a target based on the host architecture.
Because the original implementation of the tags feature in Avocado did
not include any time of namespace or "key:val" mechanism, no tag has
relation to another tag. The new implementation of the tags feature
from version 67.0 onwards, allows "key:val" tags, and because of that,
a test can be classified with a tag in a given key. For instance, the
new proposed version of the "boot_linux_console.py" test, which
downloads and attempts to run a x86_64 kernel, is now tagged as:
:avocado: tags=arch:x86_64
This means that it can be filtered (out) when no x86_64 target is
available. At the same time, tests that don't have a "arch:" tag,
will not be filtered out.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20190312171824.5134-6-crosa@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-03-13 01:18:09 +08:00
|
|
|
--filter-by-tags-include-empty --filter-by-tags-include-empty-key \
|
|
|
|
$(AVOCADO_TAGS) \
|
2020-09-09 19:27:39 +08:00
|
|
|
$(if $(GITLAB_CI),,--failfast) tests/acceptance, \
|
2018-10-18 23:31:33 +08:00
|
|
|
"AVOCADO", "tests/acceptance")
|
|
|
|
|
2012-03-28 21:42:01 +08:00
|
|
|
# Consolidated targets
|
|
|
|
|
2020-08-03 15:05:54 +08:00
|
|
|
.PHONY: check-block check check-clean get-vm-images
|
2020-09-01 21:31:56 +08:00
|
|
|
check:
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy)
|
|
|
|
QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
|
|
|
|
check: check-block
|
|
|
|
check-block: $(SRC_PATH)/tests/check-block.sh qemu-img$(EXESUF) \
|
|
|
|
qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \
|
2020-08-13 21:28:11 +08:00
|
|
|
$(filter qemu-system-%, $(ninja-targets))
|
2020-09-01 21:31:56 +08:00
|
|
|
@$<
|
|
|
|
endif
|
|
|
|
|
2020-08-03 15:05:54 +08:00
|
|
|
check-build: $(QEMU_IOTESTS_HELPERS-y)
|
2020-07-01 21:56:51 +08:00
|
|
|
|
2013-09-26 08:42:56 +08:00
|
|
|
check-clean:
|
2018-10-18 23:31:33 +08:00
|
|
|
rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
|
2013-09-26 08:42:56 +08:00
|
|
|
|
|
|
|
clean: check-clean
|
2012-07-19 01:22:27 +08:00
|
|
|
|
2020-09-02 19:25:19 +08:00
|
|
|
# For backwards compatibility
|
|
|
|
|
|
|
|
check-speed: bench-speed
|
|
|
|
|
2017-08-10 16:50:25 +08:00
|
|
|
endif
|