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
This commit is contained in:
Mårten Nordheim 2019-09-16 12:41:43 +02:00 committed by Alexandru Croitor
parent 17e11745f1
commit 89e347ba42
2 changed files with 12 additions and 2 deletions

View File

@ -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)

View File

@ -1,7 +1,11 @@
# Generated from tools.pro.
add_subdirectory(qmakelib)
add_subdirectory(qmake)
# special case begin
if(NOT WIN32) # @todo: this is broken, see QTBUG-78449
add_subdirectory(qmake)
endif()
# special case end
#add_subdirectory(moc)
#add_subdirectory(rcc)
if(TARGET Qt::Widgets)