With new meson dependencies in place, swap the "check-venv" command to
one that invokes the meson dependency system to ensure the appropriate
testing dependencies are installed to the pyvenv.

This command is not required when running "make check" as the meson
dependency system is aware that it needs to install the testing deps to
run that suite, however, for certain manual test invocations
(device-crash-test, iotests when run manually) this make target serves
as a convenient way to explicitly request those dependencies be added to
the pyvenv.

Note that this patch actually changes the meaning of check-venv slightly
to how it has been operating in the past: this target now only installs
the necessary patches to run "make check" and will no longer pull in
dependencies for functional tests. This winds up being safe to do
because the meson dependencies will handle functional tests
satisfactorily; running "make check-functional" will pull in any
additional dependencies needed to run that portion of the test suite on
its own.

Signed-off-by: John Snow <[email protected]>
---
 tests/Makefile.include | 25 ++++++-------------------
 1 file changed, 6 insertions(+), 19 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 40b114bd158..237d410ad83 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -83,33 +83,16 @@ clean-tcg: $(CLEAN_TCG_TARGET_RULES)
 .PHONY: distclean-tcg
 distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
 
-# Python venv for running tests
-
-.PHONY: check-venv
-
 # Build up our target list from the filtered list of ninja targets
 TARGETS=$(patsubst libqemu-%.a, %, $(filter libqemu-%.a, $(ninja-targets)))
 
-TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
-
-quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
-    $(PYTHON) -m pip -q --disable-pip-version-check $1, \
-    "VENVPIP","$1")
-
-$(TESTS_VENV_TOKEN): $(SRC_PATH)/pythondeps.toml
-       $(call quiet-venv-pip,install -e "$(SRC_PATH)/python/")
-       $(MKVENV_ENSUREGROUP) $< checktests functests
-       $(call quiet-command, touch $@)
-
-check-venv: $(TESTS_VENV_TOKEN)
-
 FUNCTIONAL_TARGETS=$(patsubst %-softmmu,check-functional-%, $(filter 
%-softmmu,$(TARGETS)))
 .PHONY: $(FUNCTIONAL_TARGETS)
-$(FUNCTIONAL_TARGETS): check-venv
+$(FUNCTIONAL_TARGETS):
        @$(MAKE) SPEED=thorough $(subst -functional,-func,$@)
 
 .PHONY: check-functional
-check-functional: check-venv
+check-functional:
        @$(NINJA) precache-functional
        @$(PYTHON) $(SRC_PATH)/scripts/clean_functional_cache.py
        @QEMU_TEST_NO_DOWNLOAD=1 $(MAKE) SPEED=thorough check-func 
check-func-quick
@@ -117,6 +100,10 @@ check-functional: check-venv
 .PHONY: check-func check-func-quick
 check-func check-func-quick:
 
+.PHONY: check-venv
+check-venv:
+       @$(NINJA) pyvenv/checktests.group
+
 # Consolidated targets
 
 .PHONY: check check-clean
-- 
2.51.1


Reply via email to