From 3854b5892b1d820e0e7232c781a2bb3603539473 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Mon, 13 Jan 2020 13:56:04 +0100 Subject: Add QT_TEST_RUNNING_IN_CTEST environment variable for test When running tests with CMake's CTest, set the environment QT_TEST_RUNNING_IN_CTEST to 1. This can be useful to deal with tests that do not properly work when running from CTest. For instance, the qmake test in this patch has one test that only works when not run from CTest. Change-Id: I01eea9131de69c18118a9ed9f96e9296d5ea20f1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- tests/auto/tools/qmake/tst_qmake.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/auto/tools/qmake/tst_qmake.cpp') 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; -- cgit v1.2.3