summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitrios Apostolou <[email protected]>2025-10-16 17:53:22 +0200
committerDimitrios Apostolou <[email protected]>2025-12-12 00:11:09 +0100
commit0692e926a7152dbc95a4679ad8a01b9004f27849 (patch)
tree91a99ba938fc4018607943807e31bea484980d63
parent79a34b923351ac36252618c43b9f614cfa2e86f2 (diff)
Test qt-testrunner as the first test that CTest runs
Only for inside the Coin CI, as it is Coin that uses qt-testrunner by exporting TESTRUNNER=qt-testrunner. Also rename the test executable from tst_testrunner to tst_qt_testrunner to avoid confusion with other testrunners, or generic $TESTRUNNER testing. Pick-to: 6.11 6.10 6.8 Change-Id: I607f8c2affec2ca5dd38b4a333abb3a324d2078c Reviewed-by: Alexandru Croitor <[email protected]>
-rw-r--r--tests/auto/CMakeLists.txt3
-rw-r--r--tests/auto/util/testrunner/CMakeLists.txt14
-rw-r--r--tests/auto/util/testrunner/qt_mock_test-log.xml (renamed from util/testrunner/tests/qt_mock_test-log.xml)0
-rwxr-xr-xtests/auto/util/testrunner/qt_mock_test.py (renamed from util/testrunner/tests/qt_mock_test.py)2
-rwxr-xr-xtests/auto/util/testrunner/tst_qt_testrunner.py (renamed from util/testrunner/tests/tst_testrunner.py)5
-rw-r--r--util/testrunner/README8
-rwxr-xr-xutil/testrunner/qt-testrunner.py5
7 files changed, 24 insertions, 13 deletions
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
index ac8aece707b..7dd9340f51b 100644
--- a/tests/auto/CMakeLists.txt
+++ b/tests/auto/CMakeLists.txt
@@ -4,6 +4,9 @@
# Order by dependency [*], then alphabetic. [*] If bugs in part A of
# our source would break tests of part B, then test A before B.
+
+add_subdirectory(util/testrunner)
+
set(run_dbus_tests OFF)
if (QT_FEATURE_dbus)
set(run_dbus_tests ON)
diff --git a/tests/auto/util/testrunner/CMakeLists.txt b/tests/auto/util/testrunner/CMakeLists.txt
new file mode 100644
index 00000000000..5ca8406f854
--- /dev/null
+++ b/tests/auto/util/testrunner/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Copyright (C) 2025 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+
+# Run the qt-testrunner test only inside the CI.
+if(DEFINED ENV{COIN_UNIQUE_JOB_ID} AND NOT IOS)
+ qt_internal_create_test_script(
+ NAME tst_qt_testrunner
+ COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tst_qt_testrunner.py" ARGS -v
+ WORKING_DIRECTORY "${test_working_dir}"
+ OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/tst_qt_testrunner_Wrapper$<CONFIG>.cmake"
+ ENVIRONMENT "TESTRUNNER" ""
+ )
+endif()
diff --git a/util/testrunner/tests/qt_mock_test-log.xml b/tests/auto/util/testrunner/qt_mock_test-log.xml
index a164bec9f9c..a164bec9f9c 100644
--- a/util/testrunner/tests/qt_mock_test-log.xml
+++ b/tests/auto/util/testrunner/qt_mock_test-log.xml
diff --git a/util/testrunner/tests/qt_mock_test.py b/tests/auto/util/testrunner/qt_mock_test.py
index eb6e33727f8..ff4640ac3b8 100755
--- a/util/testrunner/tests/qt_mock_test.py
+++ b/tests/auto/util/testrunner/qt_mock_test.py
@@ -42,7 +42,7 @@
import sys
import os
import traceback
-from tst_testrunner import write_xml_log
+from tst_qt_testrunner import write_xml_log
MY_NAME = os.path.basename(sys.argv[0])
diff --git a/util/testrunner/tests/tst_testrunner.py b/tests/auto/util/testrunner/tst_qt_testrunner.py
index 89e98191c13..60a45ed8f2c 100755
--- a/util/testrunner/tests/tst_testrunner.py
+++ b/tests/auto/util/testrunner/tst_qt_testrunner.py
@@ -14,7 +14,8 @@ from tempfile import TemporaryDirectory, mkstemp
MY_NAME = os.path.basename(__file__)
my_dir = os.path.dirname(__file__)
-testrunner = os.path.join(my_dir, "..", "qt-testrunner.py")
+testrunner = os.path.join(my_dir, "..", "..", "..", "..",
+ "util", "testrunner", "qt-testrunner.py")
mock_test = os.path.join(my_dir, "qt_mock_test.py")
xml_log_template = os.path.join(my_dir, "qt_mock_test-log.xml")
@@ -26,7 +27,7 @@ import unittest
def setUpModule():
global TEMPDIR
- TEMPDIR = TemporaryDirectory(prefix="tst_testrunner-")
+ TEMPDIR = TemporaryDirectory(prefix="tst_qt_testrunner-")
global EMPTY_FILE
EMPTY_FILE = os.path.join(TEMPDIR.name, "EMPTY")
diff --git a/util/testrunner/README b/util/testrunner/README
index 5758e325140..cb6722ac807 100644
--- a/util/testrunner/README
+++ b/util/testrunner/README
@@ -15,10 +15,4 @@ It offers the following functionality
The script itself has a testsuite that is simply run by invoking
-qtbase/util/testrunner/tests/tst_testrunner.py
-
-Please *run this manually* before submitting a change to qt-testrunner and
-make sure it's passing. The reason it does not run automatically during the
-usual qtbase test run, is because
-+ the test run should not depend on Python
-+ we don't want to wrap the testrunner tests with testrunner.
+qtbase/tests/auto/util/testrunner/tst_qt_testrunner.py
diff --git a/util/testrunner/qt-testrunner.py b/util/testrunner/qt-testrunner.py
index 52d11dfeee6..37652f736fa 100755
--- a/util/testrunner/qt-testrunner.py
+++ b/util/testrunner/qt-testrunner.py
@@ -4,10 +4,9 @@
# !!!IMPORTANT!!! If you change anything to this script, run the testsuite
-# manually and make sure it still passes, as it doesn't run automatically.
-# Just execute the command line as such:
+# and make sure it still passes:
#
-# ./util/testrunner/tests/tst_testrunner.py -v [--debug]
+# qtbase/tests/auto/util/testrunner/tst_qt_testrunner.py -v [--debug]
#
# ======== qt-testrunner ========
#