From 701536b21843de4650ba74017a7cc4ec93a0bdbe Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 21 Dec 2020 15:29:11 +0100 Subject: [PATCH] Allow other projects to use the CMake feature for docker-based tests Introduce a new QT_TESTSERVER_COMPOSE_FILE variable for setting a custom docker compose file path, which can be set by projects outside of qtbase (e.g. QtCoap). If the variable is not set, fallback to the compose file located in qtbase. Task-number: QTBUG-85034 Change-Id: I4c0c9b161cad9787b089ef7e9da2aa00352a9159 Reviewed-by: Cristian Adam --- cmake/QtTestHelpers.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 4bfa8f4619..b2fab788a4 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -136,7 +136,11 @@ function(qt_internal_setup_docker_test_fixture name) QT_TEST_SERVER QT_TEST_SERVER_NAME QT_TEST_SERVER_DOMAIN=\"${DNSDOMAIN}\" ) - set(TESTSERVER_COMPOSE_FILE "${QT_SOURCE_TREE}/tests/testserver/docker-compose-bridge-network.yml") + if(DEFINED QT_TESTSERVER_COMPOSE_FILE) + set(TESTSERVER_COMPOSE_FILE ${QT_TESTSERVER_COMPOSE_FILE}) + else() + set(TESTSERVER_COMPOSE_FILE "${QT_SOURCE_TREE}/tests/testserver/docker-compose-bridge-network.yml") + endif() # Bring up test servers and make sure the services are ready. add_test(NAME ${name}-setup COMMAND