summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/QtBuild.cmake2
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index a356aeb8ef..738f38fbd1 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -2892,10 +2892,10 @@ function(qt_add_test name)
if (arg_TIMEOUT)
set_tests_properties(${name} PROPERTIES TIMEOUT ${arg_TIMEOUT})
endif()
-
# 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}")
+ set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "QT_TEST_RUNNING_IN_CTEST=1")
# Add the install prefix to list of plugin paths when doing a prefix build
if(NOT QT_INSTALL_DIR)
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index 9b434a7b5b..7f98a0f5a0 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -318,6 +318,9 @@ void tst_qmake::subdirs()
void tst_qmake::subdir_via_pro_file_extra_target()
{
+ if (QProcessEnvironment::systemEnvironment().contains(QStringLiteral("QT_TEST_RUNNING_IN_CTEST")))
+ QSKIP("This test does not run properly when invoked from CTest.");
+
QString workDir = base_path + "/testdata/subdir_via_pro_file_extra_target";
QDir D;