2019-05-28 10:23:07 +02:00
|
|
|
# -*- Mode: makefile -*-
|
2017-08-10 16:50:25 +08:00
|
|
|
|
|
|
|
|
.PHONY: check-help
|
|
|
|
|
check-help:
|
|
|
|
|
@echo "Regression testing targets:"
|
2024-08-30 15:38:04 +02:00
|
|
|
@echo " $(MAKE) check Run block, qapi-schema, unit, softfloat, qtest and decodetree tests"
|
|
|
|
|
@echo " $(MAKE) bench Run speed tests"
|
2018-11-09 10:07:10 -05:00
|
|
|
@echo
|
2021-03-10 17:46:12 +01:00
|
|
|
@echo "Individual test suites:"
|
2024-08-30 15:38:04 +02:00
|
|
|
@echo " $(MAKE) check-qtest-TARGET Run qtest tests for given target"
|
|
|
|
|
@echo " $(MAKE) check-qtest Run qtest tests"
|
2024-08-30 15:38:05 +02:00
|
|
|
@echo " $(MAKE) check-functional Run python-based functional tests"
|
|
|
|
|
@echo " $(MAKE) check-functional-TARGET Run functional tests for a given target"
|
2024-08-30 15:38:04 +02:00
|
|
|
@echo " $(MAKE) check-unit Run qobject tests"
|
|
|
|
|
@echo " $(MAKE) check-qapi-schema Run QAPI schema tests"
|
2025-09-16 09:16:35 +01:00
|
|
|
@echo " $(MAKE) check-tracetool Run tracetool generator tests"
|
2024-08-30 15:38:04 +02:00
|
|
|
@echo " $(MAKE) check-block Run block tests"
|
2021-02-02 13:39:57 +00:00
|
|
|
ifneq ($(filter $(all-check-targets), check-softfloat),)
|
2024-08-30 15:38:04 +02:00
|
|
|
@echo " $(MAKE) check-tcg Run TCG tests"
|
|
|
|
|
@echo " $(MAKE) check-softfloat Run FPU emulation tests"
|
2020-05-22 19:25:00 +02:00
|
|
|
endif
|
2018-11-09 10:07:10 -05:00
|
|
|
@echo
|
2024-08-30 15:38:04 +02:00
|
|
|
@echo " $(MAKE) check-report.junit.xml Generates an aggregated XML test report"
|
|
|
|
|
@echo " $(MAKE) check-venv Creates a Python venv for tests"
|
|
|
|
|
@echo " $(MAKE) check-clean Clean the tests and related data"
|
2017-08-10 16:50:25 +08:00
|
|
|
@echo
|
2020-07-01 14:56:51 +01:00
|
|
|
@echo "The following are useful for CI builds"
|
2024-08-30 15:38:04 +02:00
|
|
|
@echo " $(MAKE) check-build Build most test binaries"
|
2020-03-17 10:16:54 -04:00
|
|
|
@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 06:55:10 -03: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 12:29:00 +01:00
|
|
|
export SRC_PATH
|
|
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
SPEED = quick
|
2012-01-10 13:10:43 -06:00
|
|
|
|
2025-12-04 19:48:54 +00:00
|
|
|
|
|
|
|
|
# TCG_TESTS_WITH_COMPILERS represents the test targets we have cross compiler
|
|
|
|
|
# support for, CONFIGURED_TEST_TARGETS it what meson has finally
|
|
|
|
|
# configured having rejected stuff we can't build.
|
|
|
|
|
CONFIGURED_TCG_TARGETS=$(patsubst %-config-target.h, %, $(wildcard *-config-target.h))
|
|
|
|
|
|
|
|
|
|
# This is the intersection of what tests we can build and is configured
|
|
|
|
|
TCG_TESTS_TARGETS=$(filter $(CONFIGURED_TCG_TARGETS), $(TCG_TESTS_WITH_COMPILERS))
|
|
|
|
|
|
2021-02-02 13:39:58 +00:00
|
|
|
# Per guest TCG tests
|
2022-04-19 10:10:11 +01:00
|
|
|
BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TCG_TESTS_TARGETS))
|
|
|
|
|
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(TCG_TESTS_TARGETS))
|
2022-09-29 12:42:01 +01:00
|
|
|
DISTCLEAN_TCG_TARGET_RULES=$(patsubst %,distclean-tcg-tests-%, $(TCG_TESTS_TARGETS))
|
2022-04-19 10:10:11 +01:00
|
|
|
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TCG_TESTS_TARGETS))
|
2018-04-06 22:08:36 +01:00
|
|
|
|
2022-04-19 10:10:11 +01:00
|
|
|
$(foreach TARGET,$(TCG_TESTS_TARGETS), \
|
2022-04-19 10:10:10 +01:00
|
|
|
$(eval $(BUILD_DIR)/tests/tcg/config-$(TARGET).mak: config-host.mak))
|
2018-06-08 12:12:46 +01:00
|
|
|
|
2022-04-19 10:10:12 +01:00
|
|
|
.PHONY: $(TCG_TESTS_TARGETS:%=build-tcg-tests-%)
|
|
|
|
|
$(TCG_TESTS_TARGETS:%=build-tcg-tests-%): build-tcg-tests-%: $(BUILD_DIR)/tests/tcg/config-%.mak
|
|
|
|
|
$(call quiet-command, \
|
2022-09-29 12:42:00 +01:00
|
|
|
$(MAKE) -C tests/tcg/$* $(SUBDIR_MAKEFLAGS), \
|
2022-04-19 10:10:12 +01:00
|
|
|
"BUILD","$* guest-tests")
|
2018-04-06 22:08:36 +01:00
|
|
|
|
2022-04-19 10:10:12 +01:00
|
|
|
.PHONY: $(TCG_TESTS_TARGETS:%=run-tcg-tests-%)
|
2022-05-27 16:35:45 +01:00
|
|
|
$(TCG_TESTS_TARGETS:%=run-tcg-tests-%): run-tcg-tests-%: build-tcg-tests-%
|
2022-04-19 10:10:12 +01:00
|
|
|
$(call quiet-command, \
|
2022-09-29 12:42:00 +01:00
|
|
|
$(MAKE) -C tests/tcg/$* $(SUBDIR_MAKEFLAGS) SPEED=$(SPEED) run, \
|
2022-04-19 10:10:12 +01:00
|
|
|
"RUN", "$* guest-tests")
|
2018-04-06 22:08:36 +01:00
|
|
|
|
2022-04-19 10:10:12 +01:00
|
|
|
.PHONY: $(TCG_TESTS_TARGETS:%=clean-tcg-tests-%)
|
|
|
|
|
$(TCG_TESTS_TARGETS:%=clean-tcg-tests-%): clean-tcg-tests-%:
|
|
|
|
|
$(call quiet-command, \
|
2022-09-29 12:42:00 +01:00
|
|
|
$(MAKE) -C tests/tcg/$* $(SUBDIR_MAKEFLAGS) clean, \
|
2022-04-19 10:10:12 +01:00
|
|
|
"CLEAN", "$* guest-tests")
|
2018-04-06 22:08:36 +01:00
|
|
|
|
2022-09-29 12:42:01 +01:00
|
|
|
.PHONY: $(TCG_TESTS_TARGETS:%=distclean-tcg-tests-%)
|
|
|
|
|
$(TCG_TESTS_TARGETS:%=distclean-tcg-tests-%): distclean-tcg-tests-%:
|
|
|
|
|
$(call quiet-command, \
|
|
|
|
|
$(MAKE) -C tests/tcg/$* $(SUBDIR_MAKEFLAGS) distclean, \
|
|
|
|
|
"CLEAN", "$* guest-tests")
|
|
|
|
|
|
2018-04-06 22:08:36 +01:00
|
|
|
.PHONY: build-tcg
|
|
|
|
|
build-tcg: $(BUILD_TCG_TARGET_RULES)
|
|
|
|
|
|
|
|
|
|
.PHONY: check-tcg
|
2023-09-28 09:53:55 +02:00
|
|
|
.ninja-goals.check-tcg = all test-plugins
|
2019-02-28 10:15:29 +00:00
|
|
|
check-tcg: $(RUN_TCG_TARGET_RULES)
|
2018-04-06 22:08:36 +01:00
|
|
|
|
|
|
|
|
.PHONY: clean-tcg
|
|
|
|
|
clean-tcg: $(CLEAN_TCG_TARGET_RULES)
|
2012-03-09 13:37:40 +01:00
|
|
|
|
2022-09-29 12:42:01 +01:00
|
|
|
.PHONY: distclean-tcg
|
|
|
|
|
distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
|
|
|
|
|
|
2018-10-18 11:31:32 -04:00
|
|
|
# Python venv for running tests
|
|
|
|
|
|
2025-04-14 13:30:29 +02:00
|
|
|
.PHONY: check-venv
|
2018-10-18 11:31:32 -04:00
|
|
|
|
2022-04-19 10:10:11 +01:00
|
|
|
# Build up our target list from the filtered list of ninja targets
|
2024-05-24 10:56:55 +02:00
|
|
|
TARGETS=$(patsubst libqemu-%.a, %, $(filter libqemu-%.a, $(ninja-targets)))
|
2022-04-19 10:10:11 +01:00
|
|
|
|
2023-08-08 11:28:08 +02:00
|
|
|
TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
|
2018-10-18 11:31:32 -04:00
|
|
|
|
2022-05-25 20:09:17 -04:00
|
|
|
quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
|
2023-08-08 11:28:08 +02:00
|
|
|
$(PYTHON) -m pip -q --disable-pip-version-check $1, \
|
2022-05-25 20:09:17 -04:00
|
|
|
"VENVPIP","$1")
|
|
|
|
|
|
2023-08-08 11:28:08 +02:00
|
|
|
$(TESTS_VENV_TOKEN): $(SRC_PATH)/pythondeps.toml
|
2022-05-25 20:09:18 -04:00
|
|
|
$(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
|
2025-04-14 13:30:29 +02:00
|
|
|
$(MKVENV_ENSUREGROUP) $< testdeps
|
2018-10-18 11:31:32 -04:00
|
|
|
$(call quiet-command, touch $@)
|
|
|
|
|
|
2023-08-08 11:28:08 +02:00
|
|
|
check-venv: $(TESTS_VENV_TOKEN)
|
2018-10-18 11:31:32 -04:00
|
|
|
|
2024-08-30 15:38:05 +02:00
|
|
|
FUNCTIONAL_TARGETS=$(patsubst %-softmmu,check-functional-%, $(filter %-softmmu,$(TARGETS)))
|
|
|
|
|
.PHONY: $(FUNCTIONAL_TARGETS)
|
2025-10-03 14:18:12 +00:00
|
|
|
$(FUNCTIONAL_TARGETS): check-venv
|
2024-08-30 15:38:05 +02:00
|
|
|
@$(MAKE) SPEED=thorough $(subst -functional,-func,$@)
|
|
|
|
|
|
|
|
|
|
.PHONY: check-functional
|
2025-10-03 14:18:12 +00:00
|
|
|
check-functional: check-venv
|
2024-08-30 15:38:09 +02:00
|
|
|
@$(NINJA) precache-functional
|
2025-10-14 10:34:24 +02:00
|
|
|
@$(PYTHON) $(SRC_PATH)/scripts/clean_functional_cache.py
|
2024-08-30 15:38:09 +02:00
|
|
|
@QEMU_TEST_NO_DOWNLOAD=1 $(MAKE) SPEED=thorough check-func check-func-quick
|
2024-08-30 15:38:05 +02:00
|
|
|
|
2025-09-18 14:51:54 +02:00
|
|
|
.PHONY: check-func check-func-quick
|
|
|
|
|
check-func check-func-quick:
|
|
|
|
|
|
2012-03-28 15:42:01 +02:00
|
|
|
# Consolidated targets
|
|
|
|
|
|
2025-04-14 13:30:29 +02:00
|
|
|
.PHONY: check check-clean
|
2020-09-01 09:31:56 -04:00
|
|
|
check:
|
|
|
|
|
|
2021-10-06 04:18:27 -04:00
|
|
|
check-build: run-ninja
|
2020-07-01 14:56:51 +01:00
|
|
|
|
2013-09-26 08:42:56 +08:00
|
|
|
check-clean:
|
2025-04-14 13:30:29 +02:00
|
|
|
rm -rf $(BUILD_DIR)/tests/functional
|
2013-09-26 08:42:56 +08:00
|
|
|
|
2022-03-01 09:59:00 +01:00
|
|
|
clean: check-clean clean-tcg
|
2022-09-29 12:42:01 +01:00
|
|
|
distclean: distclean-tcg
|
2012-07-18 14:22:27 -03:00
|
|
|
|
2017-08-10 16:50:25 +08:00
|
|
|
endif
|