summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2023-05-12 15:12:11 +0200
committerLuca Di Sera <luca.disera@qt.io>2023-05-15 13:02:08 +0200
commitac01635f461bd9f211d89f6eea833d9d928fd113 (patch)
tree4efbfd1fc2f551435605b1c72d93e372f2dbb90b
parent7057d01fbb9f8f37c707b33e3b92c10a78919ddc (diff)
downloadqttools-ac01635f461bd9f211d89f6eea833d9d928fd113.tar.gz
QDoc: Move catch_generators under src
QDoc employs a support library, "catch_generators", to provide custom support for the data-generation that certain tests use or might want to use when using the Catch2 testing framework, which QDoc uses for some of its tests. "catch_generators" was currently kept under "tests/auto/qdoc" and its headers were included and used directly by related tests by relative paths. Due to a certain restructuring that is happening in QDoc, with one of the goals, among others, being to increase the locality of QDoc-related code under "src/qdoc", the "catch_generators" support library is now moved under "src/qdoc". To allow code that depended on it to keep their usages without requiring the addition of some relative paths from the "tests" directory to the "src" directory, a library target, "Qt::QDocCatchGeneratorsPrivate" was created for it. The target can be linked-to to gain access to the previously-directly-used headers, with include path "catch_generators/.*". To allow for this specific include path to work, the internal directory structure for "catch_generators" was slightly modified with the addition of some intermediate directories in between its root and the library headers. The root "CMakeLists.txt" file for the QDoc project was modified to add the moved "catch_generators" as a subdirectory, to include it in the build process. "catch_generators" contains its own test code under the subdirectory "tests". Previously the test target in "tests" included the relevant headers from the library by use of relative paths to its sources. Now that the library is exported as a target, the "CMakeLists.txt" file under "tests" was modified to rely on linking to the library itself to obtain access to the required headers. Similarly, targets under "tests/auto/qdoc" that used the dependency now link to it instead. Hence, their "CMakeLists.txt" files were modified to avoid using the dependency as an include directory and instead use "Qt::QDocCatcGeneratorsPrivate" as a library. The inclusions of the "catch_generators" headers in relevant sources was modified to respect the new "catch_generators/.*" path. Additionally, "catch_generators" exposed a top level header, "qdoc_catch_generators.h", including certain headers in the library that were expected to be commonly used by tests, so that the consumers did not have to include multiple headers when using various common generators. The header was removed in favor of including the library headers themselves now that they have a well-defined root provided by the exposed target. Sources that included the header were modified to include only their relevant headers from "catch_generators", respecting the additional granularity. Due to the Qt Project CI performing discovery of tests by configuring only the "tests" directory of the module; the moved "catch_generators", which contained its own testing code, will now escape the automated testing in CI for its own tests, as the relevant target does not reside under the "tests" directory of the repository. To avoid this issue, the "CMakeLists.txt" file under "tests/auto/qdoc", was modified to `include` the "CMakeLists.txt" file that describes "catch_generators"' test target, so as to "mirror" the test under the "tests" directory. To support working when included, the "CMakeLists.txt" file that describes "catch_generators"' test target was modified to refer to any relevant relative path by prefixing the value of `CMAKE_CURRENT_LIST_DIR`, so that the relative paths would not be incorrectly resolved when using `include`. Due to this "mirroring", the relevant test target would be configured twice when the whole repository was configured, resulting in an error. To ensure that this is not the case, the `include` directive was hidden behind `QT_BUILD_STANADALONE_TESTS`, which is not set during a general configuration of the repository but is set when CI performs test-discovery on the "tests" directory. Similarly, the "tests" directory of a repository is configured only when `QT_BUILD_TESTS` is `ON`, which further ensures that the required dependencies, such as `Qt::Test`, will be found before the directory is configured. By having moved the test declaration outside of the `tests` directory, the test will always be configured, failing to find its dependencies when this happens. To avoid the issue, the `add_subdirectory(tests)` directive in `src/qdoc/catch_generators/CMakeLists.txt` was conditioned over `QT_BUILD_TESTS`. Certain files that were missing an license header were enhanced with it, as the lack of an header will now be an issue outside the "tests" directory. Change-Id: I0bca477b7da75c121c24b8528fc9defa26a6123e Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/qdoc/CMakeLists.txt1
-rw-r--r--src/qdoc/catch_generators/CMakeLists.txt14
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/generators/combinators/cycle_generator.h (renamed from tests/auto/qdoc/catch_generators/src/generators/combinators/cycle_generator.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/generators/combinators/oneof_generator.h (renamed from tests/auto/qdoc/catch_generators/src/generators/combinators/oneof_generator.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/generators/k_partition_of_r_generator.h (renamed from tests/auto/qdoc/catch_generators/src/generators/k_partition_of_r_generator.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/generators/path_generator.h (renamed from tests/auto/qdoc/catch_generators/src/generators/path_generator.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/generators/qchar_generator.h (renamed from tests/auto/qdoc/catch_generators/src/generators/qchar_generator.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/generators/qstring_generator.h (renamed from tests/auto/qdoc/catch_generators/src/generators/qstring_generator.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/namespaces.h (renamed from tests/auto/qdoc/catch_generators/src/namespaces.h)3
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/utilities/semantics/copy_value.h (renamed from tests/auto/qdoc/catch_generators/src/utilities/semantics/copy_value.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/utilities/semantics/generator_handler.h (renamed from tests/auto/qdoc/catch_generators/src/utilities/semantics/generator_handler.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/utilities/semantics/move_into_vector.h (renamed from tests/auto/qdoc/catch_generators/src/utilities/semantics/move_into_vector.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/utilities/statistics/distribution.h (renamed from tests/auto/qdoc/catch_generators/src/utilities/statistics/distribution.h)0
-rw-r--r--src/qdoc/catch_generators/src/catch_generators/utilities/statistics/percentages.h (renamed from tests/auto/qdoc/catch_generators/src/utilities/statistics/percentages.h)0
-rw-r--r--src/qdoc/catch_generators/tests/CMakeLists.txt20
-rw-r--r--src/qdoc/catch_generators/tests/generators/catch_k_partition_of_r_generator.cpp (renamed from tests/auto/qdoc/catch_generators/tests/generators/catch_k_partition_of_r_generator.cpp)4
-rw-r--r--src/qdoc/catch_generators/tests/generators/catch_path_generator.cpp (renamed from tests/auto/qdoc/catch_generators/tests/generators/catch_path_generator.cpp)16
-rw-r--r--src/qdoc/catch_generators/tests/generators/catch_qchar_generator.cpp (renamed from tests/auto/qdoc/catch_generators/tests/generators/catch_qchar_generator.cpp)4
-rw-r--r--src/qdoc/catch_generators/tests/generators/catch_qstring_generator.cpp (renamed from tests/auto/qdoc/catch_generators/tests/generators/catch_qstring_generator.cpp)6
-rw-r--r--src/qdoc/catch_generators/tests/generators/combinators/catch_cycle_generator.cpp (renamed from tests/auto/qdoc/catch_generators/tests/generators/combinators/catch_cycle_generator.cpp)4
-rw-r--r--src/qdoc/catch_generators/tests/generators/combinators/catch_oneof_generator.cpp (renamed from tests/auto/qdoc/catch_generators/tests/generators/combinators/catch_oneof_generator.cpp)14
-rw-r--r--src/qdoc/catch_generators/tests/main.cpp (renamed from tests/auto/qdoc/catch_generators/tests/main.cpp)6
-rw-r--r--src/qdoc/catch_generators/tests/utilities/semantics/catch_generator_handler.cpp (renamed from tests/auto/qdoc/catch_generators/tests/utilities/semantics/catch_generator_handler.cpp)4
-rw-r--r--tests/auto/qdoc/CMakeLists.txt6
-rw-r--r--tests/auto/qdoc/catch_generators/CMakeLists.txt1
-rw-r--r--tests/auto/qdoc/catch_generators/qdoc_catch_generators.h5
-rw-r--r--tests/auto/qdoc/catch_generators/tests/CMakeLists.txt21
-rw-r--r--tests/auto/qdoc/qdoc/CMakeLists.txt2
-rw-r--r--tests/auto/qdoc/qdoc/boundaries/filesystem/catch_directorypath.cpp2
-rw-r--r--tests/auto/qdoc/qdoc/boundaries/filesystem/catch_filepath.cpp2
-rw-r--r--tests/auto/qdoc/qdoc/filesystem/catch_fileresolver.cpp2
31 files changed, 78 insertions, 59 deletions
diff --git a/src/qdoc/CMakeLists.txt b/src/qdoc/CMakeLists.txt
index 11f947e01..bf3355298 100644
--- a/src/qdoc/CMakeLists.txt
+++ b/src/qdoc/CMakeLists.txt
@@ -3,6 +3,7 @@
add_subdirectory(catch)
add_subdirectory(catch_conversions)
+add_subdirectory(catch_generators)
if(QT_FEATURE_qdoc AND QT_FEATURE_clangcpp)
add_subdirectory(qdoc)
diff --git a/src/qdoc/catch_generators/CMakeLists.txt b/src/qdoc/catch_generators/CMakeLists.txt
new file mode 100644
index 000000000..aca48734e
--- /dev/null
+++ b/src/qdoc/catch_generators/CMakeLists.txt
@@ -0,0 +1,14 @@
+qt_internal_add_module(QDocCatchGeneratorsPrivate
+ HEADER_MODULE
+ EXTERNAL_HEADERS_DIR src
+)
+
+qt_internal_extend_target(QDocCatchGeneratorsPrivate
+ PUBLIC_INCLUDE_DIRECTORIES
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/QtQDocCatchGeneratorsPrivate>
+)
+
+if(QT_BUILD_TESTS)
+ add_subdirectory(tests)
+endif()
diff --git a/tests/auto/qdoc/catch_generators/src/generators/combinators/cycle_generator.h b/src/qdoc/catch_generators/src/catch_generators/generators/combinators/cycle_generator.h
index b60600747..b60600747 100644
--- a/tests/auto/qdoc/catch_generators/src/generators/combinators/cycle_generator.h
+++ b/src/qdoc/catch_generators/src/catch_generators/generators/combinators/cycle_generator.h
diff --git a/tests/auto/qdoc/catch_generators/src/generators/combinators/oneof_generator.h b/src/qdoc/catch_generators/src/catch_generators/generators/combinators/oneof_generator.h
index 5de9dcb6c..5de9dcb6c 100644
--- a/tests/auto/qdoc/catch_generators/src/generators/combinators/oneof_generator.h
+++ b/src/qdoc/catch_generators/src/catch_generators/generators/combinators/oneof_generator.h
diff --git a/tests/auto/qdoc/catch_generators/src/generators/k_partition_of_r_generator.h b/src/qdoc/catch_generators/src/catch_generators/generators/k_partition_of_r_generator.h
index 832ee2838..832ee2838 100644
--- a/tests/auto/qdoc/catch_generators/src/generators/k_partition_of_r_generator.h
+++ b/src/qdoc/catch_generators/src/catch_generators/generators/k_partition_of_r_generator.h
diff --git a/tests/auto/qdoc/catch_generators/src/generators/path_generator.h b/src/qdoc/catch_generators/src/catch_generators/generators/path_generator.h
index 875502e49..875502e49 100644
--- a/tests/auto/qdoc/catch_generators/src/generators/path_generator.h
+++ b/src/qdoc/catch_generators/src/catch_generators/generators/path_generator.h
diff --git a/tests/auto/qdoc/catch_generators/src/generators/qchar_generator.h b/src/qdoc/catch_generators/src/catch_generators/generators/qchar_generator.h
index 33efc5ea4..33efc5ea4 100644
--- a/tests/auto/qdoc/catch_generators/src/generators/qchar_generator.h
+++ b/src/qdoc/catch_generators/src/catch_generators/generators/qchar_generator.h
diff --git a/tests/auto/qdoc/catch_generators/src/generators/qstring_generator.h b/src/qdoc/catch_generators/src/catch_generators/generators/qstring_generator.h
index fe854d22f..fe854d22f 100644
--- a/tests/auto/qdoc/catch_generators/src/generators/qstring_generator.h
+++ b/src/qdoc/catch_generators/src/catch_generators/generators/qstring_generator.h
diff --git a/tests/auto/qdoc/catch_generators/src/namespaces.h b/src/qdoc/catch_generators/src/catch_generators/namespaces.h
index 7b954feb0..3c956d44f 100644
--- a/tests/auto/qdoc/catch_generators/src/namespaces.h
+++ b/src/qdoc/catch_generators/src/catch_generators/namespaces.h
@@ -1,3 +1,6 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
#pragma once
#define QDOC_CATCH_GENERATORS_ROOT_NAMESPACE qdoc::catch_generators
diff --git a/tests/auto/qdoc/catch_generators/src/utilities/semantics/copy_value.h b/src/qdoc/catch_generators/src/catch_generators/utilities/semantics/copy_value.h
index 57798be1a..57798be1a 100644
--- a/tests/auto/qdoc/catch_generators/src/utilities/semantics/copy_value.h
+++ b/src/qdoc/catch_generators/src/catch_generators/utilities/semantics/copy_value.h
diff --git a/tests/auto/qdoc/catch_generators/src/utilities/semantics/generator_handler.h b/src/qdoc/catch_generators/src/catch_generators/utilities/semantics/generator_handler.h
index 328627512..328627512 100644
--- a/tests/auto/qdoc/catch_generators/src/utilities/semantics/generator_handler.h
+++ b/src/qdoc/catch_generators/src/catch_generators/utilities/semantics/generator_handler.h
diff --git a/tests/auto/qdoc/catch_generators/src/utilities/semantics/move_into_vector.h b/src/qdoc/catch_generators/src/catch_generators/utilities/semantics/move_into_vector.h
index 5e780085b..5e780085b 100644
--- a/tests/auto/qdoc/catch_generators/src/utilities/semantics/move_into_vector.h
+++ b/src/qdoc/catch_generators/src/catch_generators/utilities/semantics/move_into_vector.h
diff --git a/tests/auto/qdoc/catch_generators/src/utilities/statistics/distribution.h b/src/qdoc/catch_generators/src/catch_generators/utilities/statistics/distribution.h
index 4374993bf..4374993bf 100644
--- a/tests/auto/qdoc/catch_generators/src/utilities/statistics/distribution.h
+++ b/src/qdoc/catch_generators/src/catch_generators/utilities/statistics/distribution.h
diff --git a/tests/auto/qdoc/catch_generators/src/utilities/statistics/percentages.h b/src/qdoc/catch_generators/src/catch_generators/utilities/statistics/percentages.h
index 2d80a459f..2d80a459f 100644
--- a/tests/auto/qdoc/catch_generators/src/utilities/statistics/percentages.h
+++ b/src/qdoc/catch_generators/src/catch_generators/utilities/statistics/percentages.h
diff --git a/src/qdoc/catch_generators/tests/CMakeLists.txt b/src/qdoc/catch_generators/tests/CMakeLists.txt
new file mode 100644
index 000000000..5a4b8667d
--- /dev/null
+++ b/src/qdoc/catch_generators/tests/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(tst_QDoc_Catch_Generators
+ SOURCES
+ ${CMAKE_CURRENT_LIST_DIR}/main.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/generators/catch_qchar_generator.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/generators/catch_qstring_generator.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/generators/catch_k_partition_of_r_generator.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/generators/catch_path_generator.cpp
+
+ ${CMAKE_CURRENT_LIST_DIR}/generators/combinators/catch_oneof_generator.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/generators/combinators/catch_cycle_generator.cpp
+
+ ${CMAKE_CURRENT_LIST_DIR}/utilities/semantics/catch_generator_handler.cpp
+ LIBRARIES
+ Qt::QDocCatchPrivate
+ Qt::QDocCatchConversionsPrivate
+ Qt::QDocCatchGeneratorsPrivate
+)
diff --git a/tests/auto/qdoc/catch_generators/tests/generators/catch_k_partition_of_r_generator.cpp b/src/qdoc/catch_generators/tests/generators/catch_k_partition_of_r_generator.cpp
index 9055c5411..27b79c511 100644
--- a/tests/auto/qdoc/catch_generators/tests/generators/catch_k_partition_of_r_generator.cpp
+++ b/src/qdoc/catch_generators/tests/generators/catch_k_partition_of_r_generator.cpp
@@ -1,8 +1,8 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "namespaces.h"
-#include "generators/k_partition_of_r_generator.h"
+#include <catch_generators/namespaces.h>
+#include <catch_generators/generators/k_partition_of_r_generator.h>
#include <catch/catch.hpp>
diff --git a/tests/auto/qdoc/catch_generators/tests/generators/catch_path_generator.cpp b/src/qdoc/catch_generators/tests/generators/catch_path_generator.cpp
index 968008a56..deb33421b 100644
--- a/tests/auto/qdoc/catch_generators/tests/generators/catch_path_generator.cpp
+++ b/src/qdoc/catch_generators/tests/generators/catch_path_generator.cpp
@@ -1,14 +1,14 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "namespaces.h"
-#include "generators/qchar_generator.h"
-#include "generators/qstring_generator.h"
-#include "generators/path_generator.h"
-#include "generators/combinators/cycle_generator.h"
-#include "utilities/statistics/percentages.h"
-#include "utilities/statistics/distribution.h"
-#include "utilities/semantics/copy_value.h"
+#include <catch_generators/namespaces.h>
+#include <catch_generators/generators/qchar_generator.h>
+#include <catch_generators/generators/qstring_generator.h>
+#include <catch_generators/generators/path_generator.h>
+#include <catch_generators/generators/combinators/cycle_generator.h>
+#include <catch_generators/utilities/statistics/percentages.h>
+#include <catch_generators/utilities/statistics/distribution.h>
+#include <catch_generators/utilities/semantics/copy_value.h>
#include <catch_conversions/qt_catch_conversions.h>
diff --git a/tests/auto/qdoc/catch_generators/tests/generators/catch_qchar_generator.cpp b/src/qdoc/catch_generators/tests/generators/catch_qchar_generator.cpp
index 47ef23364..718da7307 100644
--- a/tests/auto/qdoc/catch_generators/tests/generators/catch_qchar_generator.cpp
+++ b/src/qdoc/catch_generators/tests/generators/catch_qchar_generator.cpp
@@ -1,8 +1,8 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "namespaces.h"
-#include "generators/qchar_generator.h"
+#include <catch_generators/namespaces.h>
+#include <catch_generators/generators/qchar_generator.h>
#include <catch_conversions/qt_catch_conversions.h>
diff --git a/tests/auto/qdoc/catch_generators/tests/generators/catch_qstring_generator.cpp b/src/qdoc/catch_generators/tests/generators/catch_qstring_generator.cpp
index 75d7efcf1..0e92f6900 100644
--- a/tests/auto/qdoc/catch_generators/tests/generators/catch_qstring_generator.cpp
+++ b/src/qdoc/catch_generators/tests/generators/catch_qstring_generator.cpp
@@ -1,9 +1,9 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "namespaces.h"
-#include "generators/qchar_generator.h"
-#include "generators/qstring_generator.h"
+#include <catch_generators/namespaces.h>
+#include <catch_generators/generators/qchar_generator.h>
+#include <catch_generators/generators/qstring_generator.h>
#include <catch_conversions/qt_catch_conversions.h>
diff --git a/tests/auto/qdoc/catch_generators/tests/generators/combinators/catch_cycle_generator.cpp b/src/qdoc/catch_generators/tests/generators/combinators/catch_cycle_generator.cpp
index 43bae006b..5bf98d73a 100644
--- a/tests/auto/qdoc/catch_generators/tests/generators/combinators/catch_cycle_generator.cpp
+++ b/src/qdoc/catch_generators/tests/generators/combinators/catch_cycle_generator.cpp
@@ -1,8 +1,8 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "namespaces.h"
-#include "generators/combinators/cycle_generator.h"
+#include <catch_generators/namespaces.h>
+#include <catch_generators/generators/combinators/cycle_generator.h>
#include <catch/catch.hpp>
diff --git a/tests/auto/qdoc/catch_generators/tests/generators/combinators/catch_oneof_generator.cpp b/src/qdoc/catch_generators/tests/generators/combinators/catch_oneof_generator.cpp
index 68e990813..4d5666213 100644
--- a/tests/auto/qdoc/catch_generators/tests/generators/combinators/catch_oneof_generator.cpp
+++ b/src/qdoc/catch_generators/tests/generators/combinators/catch_oneof_generator.cpp
@@ -3,13 +3,13 @@
#include <catch_conversions/std_catch_conversions.h>
-#include "namespaces.h"
-#include "generators/k_partition_of_r_generator.h"
-#include "generators/combinators/oneof_generator.h"
-#include "generators/combinators/cycle_generator.h"
-#include "utilities/statistics/percentages.h"
-#include "utilities/statistics/distribution.h"
-#include "utilities/semantics/copy_value.h"
+#include <catch_generators/namespaces.h>
+#include <catch_generators/generators/k_partition_of_r_generator.h>
+#include <catch_generators/generators/combinators/oneof_generator.h>
+#include <catch_generators/generators/combinators/cycle_generator.h>
+#include <catch_generators/utilities/statistics/percentages.h>
+#include <catch_generators/utilities/statistics/distribution.h>
+#include <catch_generators/utilities/semantics/copy_value.h>
#include <catch/catch.hpp>
diff --git a/tests/auto/qdoc/catch_generators/tests/main.cpp b/src/qdoc/catch_generators/tests/main.cpp
index cec18afba..48ce73f12 100644
--- a/tests/auto/qdoc/catch_generators/tests/main.cpp
+++ b/src/qdoc/catch_generators/tests/main.cpp
@@ -1,9 +1,13 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
#define CATCH_CONFIG_RUNNER
#include <catch/catch.hpp>
// A custom main was provided to avoid linking errors when using minGW
// that were appearing in CI.
// See https://github.com/catchorg/Catch2/issues/1287
-int main(int argc, char* argv[]) {
+int main(int argc, char *argv[])
+{
return Catch::Session().run(argc, argv);
}
diff --git a/tests/auto/qdoc/catch_generators/tests/utilities/semantics/catch_generator_handler.cpp b/src/qdoc/catch_generators/tests/utilities/semantics/catch_generator_handler.cpp
index 913646be5..b99a6515d 100644
--- a/tests/auto/qdoc/catch_generators/tests/utilities/semantics/catch_generator_handler.cpp
+++ b/src/qdoc/catch_generators/tests/utilities/semantics/catch_generator_handler.cpp
@@ -3,8 +3,8 @@
#include <catch/catch.hpp>
-#include "namespaces.h"
-#include "utilities/semantics/generator_handler.h"
+#include <catch_generators/namespaces.h>
+#include <catch_generators/utilities/semantics/generator_handler.h>
using namespace QDOC_CATCH_GENERATORS_UTILITIES_ABSOLUTE_NAMESPACE;
diff --git a/tests/auto/qdoc/CMakeLists.txt b/tests/auto/qdoc/CMakeLists.txt
index a2c3ae274..08e79d8bf 100644
--- a/tests/auto/qdoc/CMakeLists.txt
+++ b/tests/auto/qdoc/CMakeLists.txt
@@ -6,10 +6,14 @@ if(CMAKE_VERSION VERSION_LESS "3.19" AND MSVC AND QT_FEATURE_debug_and_release)
return()
endif()
+set(QDOC_PROJECT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../../../src/qdoc/)
set(QDOC_SOURCE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../../../src/qdoc/qdoc/)
set(QDOC_INCLUDE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../../../src/qdoc/qdoc/)
-add_subdirectory(catch_generators)
+if(QT_BUILD_STANDALONE_TESTS)
+ include(${QDOC_PROJECT_DIRECTORY}/catch_generators/tests/CMakeLists.txt)
+endif()
+
add_subdirectory(qdoc)
add_subdirectory(config)
add_subdirectory(generatedoutput)
diff --git a/tests/auto/qdoc/catch_generators/CMakeLists.txt b/tests/auto/qdoc/catch_generators/CMakeLists.txt
deleted file mode 100644
index 88c051636..000000000
--- a/tests/auto/qdoc/catch_generators/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_subdirectory(tests)
diff --git a/tests/auto/qdoc/catch_generators/qdoc_catch_generators.h b/tests/auto/qdoc/catch_generators/qdoc_catch_generators.h
deleted file mode 100644
index e99a57ec5..000000000
--- a/tests/auto/qdoc/catch_generators/qdoc_catch_generators.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma once
-
-#include "src/generators/qchar_generator.h"
-#include "src/generators/qstring_generator.h"
-#include "src/generators/path_generator.h"
diff --git a/tests/auto/qdoc/catch_generators/tests/CMakeLists.txt b/tests/auto/qdoc/catch_generators/tests/CMakeLists.txt
deleted file mode 100644
index 76c366331..000000000
--- a/tests/auto/qdoc/catch_generators/tests/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (C) 2022 The Qt Company Ltd.
-# SPDX-License-Identifier: BSD-3-Clause
-
-qt_internal_add_test(tst_QDoc_Catch_Generators
- SOURCES
- main.cpp
- generators/catch_qchar_generator.cpp
- generators/catch_qstring_generator.cpp
- generators/catch_k_partition_of_r_generator.cpp
- generators/catch_path_generator.cpp
-
- generators/combinators/catch_oneof_generator.cpp
- generators/combinators/catch_cycle_generator.cpp
-
- utilities/semantics/catch_generator_handler.cpp
- INCLUDE_DIRECTORIES
- ../src
- LIBRARIES
- Qt::QDocCatchPrivate
- Qt::QDocCatchConversionsPrivate
-)
diff --git a/tests/auto/qdoc/qdoc/CMakeLists.txt b/tests/auto/qdoc/qdoc/CMakeLists.txt
index 925290ecd..7e145ab30 100644
--- a/tests/auto/qdoc/qdoc/CMakeLists.txt
+++ b/tests/auto/qdoc/qdoc/CMakeLists.txt
@@ -15,8 +15,8 @@ qt_internal_add_test(tst_QDoc
${QDOC_SOURCE_DIRECTORY}/filesystem/fileresolver.cpp
INCLUDE_DIRECTORIES
${QDOC_INCLUDE_DIRECTORY}
- ../catch_generators/
LIBRARIES
Qt::QDocCatchPrivate
Qt::QDocCatchConversionsPrivate
+ Qt::QDocCatchGeneratorsPrivate
)
diff --git a/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_directorypath.cpp b/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_directorypath.cpp
index 5321e2619..31a45bfa4 100644
--- a/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_directorypath.cpp
+++ b/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_directorypath.cpp
@@ -7,7 +7,7 @@
#include <boundaries/filesystem/directorypath.h>
-#include <qdoc_catch_generators.h>
+#include <catch_generators/generators/path_generator.h>
#include <QFileInfo>
#include <QTemporaryDir>
diff --git a/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_filepath.cpp b/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_filepath.cpp
index 46481e4d6..957a13127 100644
--- a/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_filepath.cpp
+++ b/tests/auto/qdoc/qdoc/boundaries/filesystem/catch_filepath.cpp
@@ -7,7 +7,7 @@
#include <boundaries/filesystem/filepath.h>
-#include <qdoc_catch_generators.h>
+#include <catch_generators/generators/path_generator.h>
#include <QFileInfo>
#include <QTemporaryDir>
diff --git a/tests/auto/qdoc/qdoc/filesystem/catch_fileresolver.cpp b/tests/auto/qdoc/qdoc/filesystem/catch_fileresolver.cpp
index fca33debb..75774c9cc 100644
--- a/tests/auto/qdoc/qdoc/filesystem/catch_fileresolver.cpp
+++ b/tests/auto/qdoc/qdoc/filesystem/catch_fileresolver.cpp
@@ -7,7 +7,7 @@
#include <filesystem/fileresolver.h>
-#include <qdoc_catch_generators.h>
+#include <catch_generators/generators/path_generator.h>
#include <vector>
#include <algorithm>