diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-08-05 22:37:02 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-08-18 15:15:40 +0000 |
commit | 3386c44972e01384be6ac1e7f7b47d9f98681dd5 (patch) | |
tree | 6b5c12c93dda385bec82fafbbdc572f3e38aaca6 /tests/auto | |
parent | dd8268d5fbab092fbd936edb618d9d5b7546a431 (diff) |
Mark the module as free of Q_FOREACH, except where it isn't
The density of Q_FOREACH uses is non-negligible here, too high for
this author, still unfamiliar with this module, to tackle in a short
amount of time. But they're concentrated in just a few TUs, so pick a
different strategy:
Mark the whole module with QT_NO_FOREACH, to prevent new uses from
creeping in, and whitelist the affected TUs by #undef'ing
QT_NO_FOREACH locally, at the top of each file. For TUs that are part
of a larger executable, this requires these files to be compiled
separately, so add them to NO_PCH_SOURCES (which implies
NO_UNITY_BUILD_SOURCES, too). Created QTBUG-115805 to keep track of
this.
Task-number: QTBUG-115805
Change-Id: I7a80b1820972687ccced24d9edd7a8f5b826556f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto')
3 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp index 4a0d4bb8c..5c983a210 100644 --- a/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp +++ b/tests/auto/core/qwebengineurlrequestinterceptor/tst_qwebengineurlrequestinterceptor.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses + #include <util.h> #include <QtTest/QtTest> #include <QtWebEngineCore/qwebengineurlrequestinfo.h> diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp index f82c58264..17309095a 100644 --- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp +++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp @@ -1,6 +1,8 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses + #include "testwindow.h" #include "quickutil.h" diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp index a0f93faac..06654b337 100644 --- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp +++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp @@ -18,6 +18,9 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses + #include <QtWebEngineCore/private/qtwebenginecore-config_p.h> #include <qtest.h> #include <util.h> |