summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2019-09-16 12:41:43 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-09-17 17:11:59 +0000
commit89e347ba4232f1d7b1d7c9def6c7249850b01602 (patch)
treeba9a7a20ac73f641e3ac246afc15ed0f2e6f2556 /cmake/QtBuild.cmake
parent17e11745f1ec9611f44bf821cb08a926d1242a65 (diff)
Fix for getting windows running tests
By adding the path to the DLLs early on in the path. This fixes the issue seen in CI (0xc0000135, DLL not found) and resolves local issues where you might have forgotten to add this to path yourself potentially grabbing libraries from elsewhere. The ${path} seems to be a holdover that is no longer used, so it was removed while the code was changed anyway. Also disable WIN32_EXECUTABLE for all tests so that we can actually get some output from them :) Change-Id: Iec42c809c37be4f31c7f0a7af3a30c3528022dbe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index d16d61c939..949d0d979c 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -2295,6 +2295,9 @@ function(add_qt_test name)
# assumptions about the location of helper processes, and those paths would be different
# if a test is built as a bundle.
set_property(TARGET "${name}" PROPERTY MACOSX_BUNDLE FALSE)
+ # The same goes for WIN32_EXECUTABLE, but because it will detach from the console window
+ # and not print anything.
+ set_property(TARGET "${name}" PROPERTY WIN32_EXECUTABLE FALSE)
# QMLTest specifics
@@ -2331,7 +2334,10 @@ function(add_qt_test name)
add_test(NAME "${name}" COMMAND ${test_executable} ${extra_test_args} -o ${name}.xml,xml -o -,txt WORKING_DIRECTORY "${test_working_dir}")
set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${arg_RUN_SERIAL}" LABELS "${label}")
- set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${path}${QT_PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}$ENV{PATH}")
+
+ # Get path to qtbase/bin, then prepend this path containing the shared libraries to PATH
+ set(INSTALL_PREFIX_BIN "${CMAKE_INSTALL_PREFIX}/bin")
+ set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}${INSTALL_PREFIX_BIN}${QT_PATH_SEPARATOR}$ENV{PATH}")
# Add the install prefix to list of plugin paths when doing a prefix build
if(NOT QT_INSTALL_DIR)