]> git.proxmox.com Git - mirror_qemu.git/blame - tests/Makefile.include
Fix virtio-net-pci* "vectors" compat
[mirror_qemu.git] / tests / Makefile.include
CommitLineData
3b8593ee 1# -*- Mode: makefile -*-
e45eaef9
FZ
2
3.PHONY: check-help
4check-help:
5 @echo "Regression testing targets:"
9865f39d 6 @echo " $(MAKE) check Run block, qapi-schema, unit, softfloat, qtest and decodetree tests"
8e19c009 7 @echo " $(MAKE) bench Run speed tests"
54f96b45 8 @echo
8e19c009 9 @echo "Individual test suites:"
b98a3bae
PMD
10 @echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target"
11 @echo " $(MAKE) check-qtest Run qtest tests"
12 @echo " $(MAKE) check-unit Run qobject tests"
b98a3bae
PMD
13 @echo " $(MAKE) check-qapi-schema Run QAPI schema tests"
14 @echo " $(MAKE) check-block Run block tests"
47e3424a 15ifneq ($(filter $(all-check-targets), check-softfloat),)
8ba0a820 16 @echo " $(MAKE) check-tcg Run TCG tests"
76170102 17 @echo " $(MAKE) check-softfloat Run FPU emulation tests"
ca6db469 18endif
181e1ab2 19 @echo " $(MAKE) check-acceptance Run acceptance (functional) tests for currently configured targets"
54f96b45 20 @echo
c3088cd3 21 @echo " $(MAKE) check-report.tap Generates an aggregated TAP test report"
21313721 22 @echo " $(MAKE) check-venv Creates a Python venv for tests"
54f96b45 23 @echo " $(MAKE) check-clean Clean the tests and related data"
e45eaef9 24 @echo
a6eeac3b
AB
25 @echo "The following are useful for CI builds"
26 @echo " $(MAKE) check-build Build most test binaris"
4ec49f0f
CR
27 @echo " $(MAKE) get-vm-images Downloads all images used by acceptance tests, according to configured targets (~350 MB each, 1.5 GB max)"
28 @echo
e45eaef9
FZ
29 @echo
30 @echo "The variable SPEED can be set to control the gtester speed setting."
b98a3bae 31 @echo "Default options are -k and (for $(MAKE) V=1) --verbose; they can be"
e45eaef9
FZ
32 @echo "changed with variable GTESTER_OPTIONS."
33
34ifneq ($(wildcard config-host.mak),)
8959449b
KW
35export SRC_PATH
36
3687d532
PM
37# Get the list of all supported sysemu targets
38SYSEMU_TARGET_LIST := $(subst -softmmu.mak,,$(notdir \
812b31d3 39 $(wildcard $(SRC_PATH)/configs/*-softmmu.mak)))
3687d532 40
b93b63f5 41SPEED = quick
dbfe06c6 42
c401c058
AB
43# Build up our target list from the filtered list of ninja targets
44TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
8ba0a820 45
c401c058
AB
46# Per guest TCG tests
47BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGETS))
48CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TARGETS))
49RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGETS))
8ba0a820 50
1a7fab92 51# Probe for the Docker Builds needed for each build
2b1f35b9 52$(foreach PROBE_TARGET,$(TARGET_DIRS), \
fc76c56d 53 $(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs))
1a7fab92 54
8c17b840 55$(BUILD_TCG_TARGET_RULES): build-tcg-tests-%: $(if $(CONFIG_PLUGIN),test-plugins)
fc76c56d
PB
56 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
57 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
58 SRC_PATH=$(SRC_PATH) \
2038f8c8 59 V="$(V)" TARGET="$*" guest-tests, \
cff54773 60 "BUILD", "TCG tests for $*")
8ba0a820 61
8c17b840 62$(RUN_TCG_TARGET_RULES): run-tcg-tests-%: build-tcg-tests-% all
fc76c56d
PB
63 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
64 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
65 SRC_PATH=$(SRC_PATH) SPEED="$(SPEED)" \
2038f8c8 66 V="$(V)" TARGET="$*" run-guest-tests, \
cff54773 67 "RUN", "TCG tests for $*")
8ba0a820 68
8c17b840 69$(CLEAN_TCG_TARGET_RULES): clean-tcg-tests-%:
fc76c56d
PB
70 $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \
71 -f $(SRC_PATH)/tests/tcg/Makefile.qemu \
2038f8c8 72 SRC_PATH=$(SRC_PATH) TARGET="$*" clean-guest-tests, \
dda60da3 73 "CLEAN", "TCG tests for $*")
8ba0a820
AB
74
75.PHONY: build-tcg
76build-tcg: $(BUILD_TCG_TARGET_RULES)
77
78.PHONY: check-tcg
df2bb38e 79check-tcg: $(RUN_TCG_TARGET_RULES)
8ba0a820
AB
80
81.PHONY: clean-tcg
82clean-tcg: $(CLEAN_TCG_TARGET_RULES)
b93b63f5 83
21313721
CR
84# Python venv for running tests
85
a56931ee 86.PHONY: check-venv check-acceptance
21313721
CR
87
88TESTS_VENV_DIR=$(BUILD_DIR)/tests/venv
89TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
a56931ee 90TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
94c71462
WR
91ifndef AVOCADO_TESTS
92 AVOCADO_TESTS=tests/acceptance
93endif
a56931ee
CR
94# Controls the output generated by Avocado when running tests.
95# Any number of command separated loggers are accepted. For more
96# information please refer to "avocado --help".
59692a12 97AVOCADO_SHOW=app
23022794
WR
98ifndef AVOCADO_TAGS
99 AVOCADO_CMDLINE_TAGS=$(patsubst %-softmmu,-t arch:%, \
100 $(filter %-softmmu,$(TARGETS)))
101else
102 AVOCADO_CMDLINE_TAGS=$(addprefix -t , $(AVOCADO_TAGS))
103endif
21313721 104
21313721
CR
105$(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
106 $(call quiet-command, \
414e9ae3 107 $(PYTHON) -m venv $@, \
21313721
CR
108 VENV, $@)
109 $(call quiet-command, \
110 $(TESTS_VENV_DIR)/bin/python -m pip -q install -r $(TESTS_VENV_REQ), \
111 PIP, $(TESTS_VENV_REQ))
112 $(call quiet-command, touch $@)
21313721 113
a56931ee
CR
114$(TESTS_RESULTS_DIR):
115 $(call quiet-command, mkdir -p $@, \
116 MKDIR, $@)
117
21313721
CR
118check-venv: $(TESTS_VENV_DIR)
119
93fca0f2
CR
120FEDORA_31_ARCHES_TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGETS)))
121FEDORA_31_ARCHES_CANDIDATES=$(patsubst ppc64,ppc64le,$(FEDORA_31_ARCHES_TARGETS))
4ec49f0f
CR
122FEDORA_31_ARCHES := x86_64 aarch64 ppc64le s390x
123FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
124
125# download one specific Fedora 31 image
126get-vm-image-fedora-31-%: check-venv
127 $(call quiet-command, \
128 $(TESTS_VENV_DIR)/bin/python -m avocado vmimage get \
129 --distro=fedora --distro-version=31 --arch=$*, \
130 "AVOCADO", "Downloading acceptance tests VM image for $*")
131
132# download all vm images, according to defined targets
133get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
134
135check-acceptance: check-venv $(TESTS_RESULTS_DIR) get-vm-images
a56931ee
CR
136 $(call quiet-command, \
137 $(TESTS_VENV_DIR)/bin/python -m avocado \
138 --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
23022794
WR
139 $(if $(AVOCADO_TAGS),, --filter-by-tags-include-empty \
140 --filter-by-tags-include-empty-key) \
141 $(AVOCADO_CMDLINE_TAGS) \
94c71462 142 $(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
a56931ee
CR
143 "AVOCADO", "tests/acceptance")
144
b93b63f5
PB
145# Consolidated targets
146
279588d4 147.PHONY: check-block check check-clean get-vm-images
e781190c
PB
148check:
149
150ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy)
e781190c 151check: check-block
4cea90be 152export PYTHON
097a5f19
PB
153
154ifneq ($(filter check check-block check-build, $(MAKECMDGOALS)),)
155ninja-cmd-goals += \
156 qemu-img$(EXESUF) \
157 qemu-io$(EXESUF) \
158 qemu-nbd$(EXESUF) \
159 storage-daemon/qemu-storage-daemon$(EXESUF) \
160 $(filter qemu-system-%, $(ninja-targets))
161endif
162
163check-block: $(SRC_PATH)/tests/check-block.sh run-ninja
e781190c
PB
164 @$<
165endif
166
097a5f19 167check-build: run-ninja
a6eeac3b 168
2cdfb123 169check-clean:
a56931ee 170 rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
2cdfb123
WX
171
172clean: check-clean
14117c7b 173
e45eaef9 174endif