tests: Fix Python 3 detection on older GNU make versions
authorEduardo Habkost <ehabkost@redhat.com>
Tue, 6 Nov 2018 14:13:02 +0000 (12:13 -0200)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 6 Nov 2018 14:58:13 +0000 (14:58 +0000)
The $(SHELLSTATUS) variable requires GNU make >= 4.2, but Travis
seems to provide an older version.  Change the existing rules to
use command output instead of exit code, to make it compatible
with older GNU make versions.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
tests/Makefile.include

index d2e577eabbcd508b4a74a884266a332ad8cb38fc..074eece5584101573f228ed6d204c555465b8a88 100644 (file)
@@ -913,8 +913,8 @@ TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
 # information please refer to "avocado --help".
 AVOCADO_SHOW=none
 
-$(shell $(PYTHON) -c 'import sys; assert sys.version_info >= (3,0)' >/dev/null 2>&1)
-ifeq ($(.SHELLSTATUS),0)
+PYTHON3 = $(shell $(PYTHON) -c 'import sys; print(1 if sys.version_info >= (3, 0) else 0)')
+ifeq ($(PYTHON3), 1)
 $(TESTS_VENV_DIR): $(TESTS_VENV_REQ)
        $(call quiet-command, \
             $(PYTHON) -m venv --system-site-packages $@, \