From 1c7c4c5ac95931bd9751aef03a64c2ebbc1b808b Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 5 Jun 2024 16:49:13 +0200 Subject: [PATCH] QtTest 3rdparty: isolate Catch2 part as a 3rdparty component Move from tests/auto/testlib/selftests/ to src/testlib/3rdparty/cache2/, so that its path includes a 3rdparty component and it's isolated from the rest of the selftest files. Instead, it's now grouped with QtTest's other 3rdparty components, to make it easier, when doing a 3rdparty update, to see what might need an update. In the process, document where in the upstream to find the file to be copied, if an update is needed. The file is generated, so document its generator, too, in case its output gets renamed. There is no more recent release than the 2.13.10 we currently have, so no update will follow. Task-number: QTBUG-126080 Change-Id: I371bac233b00318f59d6043fb245ab44b914bf8a Reviewed-by: Jason McDonald (cherry picked from commit 31adb73e289d1bd93276af2b1df9bc356ba14766) --- .../testlib/3rdparty/catch2/LICENSE.txt | 0 .../catch_p_p.h => src/testlib/3rdparty/catch2/catch_p.h | 0 .../testlib/3rdparty/catch2}/qt_attribution.json | 6 ++++-- src/testlib/CMakeLists.txt | 2 ++ tests/auto/testlib/selftests/catch_p.h | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) rename tests/auto/testlib/selftests/CATCH_LICENSE.txt => src/testlib/3rdparty/catch2/LICENSE.txt (100%) rename tests/auto/testlib/selftests/catch_p_p.h => src/testlib/3rdparty/catch2/catch_p.h (100%) rename {tests/auto/testlib/selftests => src/testlib/3rdparty/catch2}/qt_attribution.json (70%) diff --git a/tests/auto/testlib/selftests/CATCH_LICENSE.txt b/src/testlib/3rdparty/catch2/LICENSE.txt similarity index 100% rename from tests/auto/testlib/selftests/CATCH_LICENSE.txt rename to src/testlib/3rdparty/catch2/LICENSE.txt diff --git a/tests/auto/testlib/selftests/catch_p_p.h b/src/testlib/3rdparty/catch2/catch_p.h similarity index 100% rename from tests/auto/testlib/selftests/catch_p_p.h rename to src/testlib/3rdparty/catch2/catch_p.h diff --git a/tests/auto/testlib/selftests/qt_attribution.json b/src/testlib/3rdparty/catch2/qt_attribution.json similarity index 70% rename from tests/auto/testlib/selftests/qt_attribution.json rename to src/testlib/3rdparty/catch2/qt_attribution.json index 3a126f59eda..7c3b1618d79 100644 --- a/tests/auto/testlib/selftests/qt_attribution.json +++ b/src/testlib/3rdparty/catch2/qt_attribution.json @@ -4,14 +4,16 @@ "Name": "Catch2", "QDocModule": "qttestlib", "QtUsage": "Used for testing of the Qt Test module.", - "Files": "catch_p_p.h", + "Comment": { "UpstreamFile": "single_include/catch2/catch.hpp", + "Generator": "scripts/generateSingleHeader.py" }, + "Files": "catch_p.h", "Description": "Catch2 is a multi-paradigm test framework for C++.", "Homepage": "https://github.com/catchorg/Catch2", "Version": "2.13.10", "License": "Boost Software License 1.0", "LicenseId": "BSL-1.0", - "LicenseFile": "CATCH_LICENSE.txt", + "LicenseFile": "LICENSE.txt", "Copyright": "Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved." } ] diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt index 856606b529a..391c9de9937 100644 --- a/src/testlib/CMakeLists.txt +++ b/src/testlib/CMakeLists.txt @@ -13,6 +13,7 @@ qt_internal_add_module(Test EXCEPTIONS SOURCES 3rdparty/cycle/cycle_p.h # Needed by tests, so visible to syncqt. + 3rdparty/catch2/catch_p.h # Also needed by tests. removed_api.cpp # keep first qabstracttestlogger.cpp qabstracttestlogger_p.h qasciikey.cpp @@ -79,6 +80,7 @@ qt_internal_add_module(Test PRIVATE_MODULE_INTERFACE Qt::CorePrivate ATTRIBUTION_FILE_DIR_PATHS + 3rdparty/catch2 3rdparty/cycle 3rdparty/linux 3rdparty/valgrind diff --git a/tests/auto/testlib/selftests/catch_p.h b/tests/auto/testlib/selftests/catch_p.h index 2c217922a8c..3c5ffd32134 100644 --- a/tests/auto/testlib/selftests/catch_p.h +++ b/tests/auto/testlib/selftests/catch_p.h @@ -17,7 +17,7 @@ #include -#include "catch_p_p.h" +#include QT_BEGIN_NAMESPACE