From 2c875efa999527b5d1419ea06d786b0a462c7133 Mon Sep 17 00:00:00 2001 From: Ryan Chu Date: Tue, 8 Jan 2019 14:34:30 +0100 Subject: [PATCH] Support debug_and_release option (which is the default under Windows) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When debug_and_release option is in use, qmake will generate one mata-Makefile and two additional leaf Makefile (Makefile.Debug and Makefile.Release). In such case, testserver.pri will be included in all three passes. The problem is that the mata-Mafile is used to invoke leaf Mafile recursively. The docker test server should only be integrated in the leaf Makefile. To resolve this problem, this change uses "!build_pass" condition to determine whether this is a pass of meta-Makefile, and then skip it. Change-Id: Ibc48d657680e089ebaa1bc356b87eb4cfd9f4580 Reviewed-by: Jędrzej Nowacki Reviewed-by: Edward Welbourne --- tests/auto/testserver.pri | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/auto/testserver.pri b/tests/auto/testserver.pri index 7dd32db0af..1a8b5a8187 100644 --- a/tests/auto/testserver.pri +++ b/tests/auto/testserver.pri @@ -51,6 +51,11 @@ # 2. testserver_clean - Clean up server containers/images and tidy away related # files. +# The docker test server should only be integrated in the leaf Makefile. +# If debug_and_release option is in use, skip the meta-Makefile except for +# Makefile.Debug and Makefile.Release. +debug_and_release:!build_pass: return() + TESTSERVER_VERSION = $$system(docker-compose --version) equals(QMAKE_HOST.os, Windows)|isEmpty(TESTSERVER_VERSION) { @@ -124,7 +129,7 @@ equals(QMAKE_HOST.os, Windows)|isEmpty(TESTSERVER_VERSION) { --detach --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} && # Check test cases with docker-based test servers. - testserver_test.commands += $(MAKE) check_network; + testserver_test.commands += $(MAKE) -f $(MAKEFILE) check_network; # Stop and remove test servers after testing. testserver_test.commands += docker-compose $$MACHINE_CONFIG -f $$TESTSERVER_COMPOSE_FILE down \