summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/macdeployqt/tst_macdeployqt.cpp3
-rw-r--r--tests/auto/tools/moc/CMakeLists.txt2
-rw-r--r--tests/auto/tools/moc/allmocs_baseline_in.json81
-rw-r--r--tests/auto/tools/moc/enum_inc.h2
-rw-r--r--tests/auto/tools/moc/forwarddeclaredparam.h2
-rw-r--r--tests/auto/tools/moc/os9-newlines.h2
-rw-r--r--tests/auto/tools/moc/single_function_keyword.h6
-rw-r--r--tests/auto/tools/moc/subdir/extradefines.h2
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp11
-rw-r--r--tests/auto/tools/qdbuscpp2xml/CMakeLists.txt1
-rw-r--r--tests/auto/tools/qdbusxml2cpp/CMakeLists.txt2
-rw-r--r--tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/needed.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/digitseparated.h2
-rw-r--r--tests/auto/tools/qmake/testdata/include_pwd/anotherheader.h2
-rw-r--r--tests/auto/tools/qmake/testdata/include_pwd/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/include_pwd/somedirectory/someheader.h2
-rw-r--r--tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h2
-rw-r--r--tests/auto/tools/qmake/testdata/windows_resources/main.cpp2
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp5
-rw-r--r--tests/auto/tools/qt_cmake_create/testdata/cpp_project/main.cpp2
-rw-r--r--tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp2
-rw-r--r--tests/auto/tools/qt_cmake_create/testdata/qrc_project/main.cpp2
-rw-r--r--tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp2
-rw-r--r--tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp3
-rw-r--r--tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h2
-rw-r--r--tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp5
-rw-r--r--tests/auto/tools/rcc/data/.gitattributes2
-rw-r--r--tests/auto/tools/rcc/data/deduplication/deduplication.expected157
-rw-r--r--tests/auto/tools/rcc/data/deduplication/deduplication.qrc10
-rw-r--r--tests/auto/tools/rcc/data/deduplication/files/a.txt1
-rw-r--r--tests/auto/tools/rcc/data/deduplication/files/b.txt1
-rw-r--r--tests/auto/tools/rcc/data/deduplication/files/c_with_a_content.txt1
-rw-r--r--tests/auto/tools/rcc/data/legal/legal.qrc10
-rw-r--r--tests/auto/tools/rcc/data/legal/rcc_legal.cpp101
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp9
-rw-r--r--tests/auto/tools/uic/baseline/Widget.ui2
-rw-r--r--tests/auto/tools/uic/baseline/Widget.ui.h5
-rw-r--r--tests/auto/tools/uic/baseline/qtbug126265.ui51
-rw-r--r--tests/auto/tools/uic/baseline/qtbug126265.ui.h57
40 files changed, 470 insertions, 90 deletions
diff --git a/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp b/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp
index 3c17acda56..d408554319 100644
--- a/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp
+++ b/tests/auto/tools/macdeployqt/tst_macdeployqt.cpp
@@ -224,6 +224,9 @@ void tst_macdeployqt::initTestCase()
QSKIP("This test requires QProcess support");
#endif
+ if (QProcess::execute("xcode-select", { "-p" }) != 0)
+ QSKIP("Xcode or Xcode command line tools not installed");
+
// Set up test-global unique temporary directory
g_temporaryDirectory = new QTemporaryDir();
g_temporaryDirectory->setAutoRemove(!lcTests().isDebugEnabled());
diff --git a/tests/auto/tools/moc/CMakeLists.txt b/tests/auto/tools/moc/CMakeLists.txt
index 1377c48306..a8df73bdf4 100644
--- a/tests/auto/tools/moc/CMakeLists.txt
+++ b/tests/auto/tools/moc/CMakeLists.txt
@@ -46,7 +46,6 @@ set(JSON_HEADERS
related-metaobjects-name-conflict.h
signal-with-default-arg.h
single-quote-digit-separator-n3781.h
- single_function_keyword.h
slots-with-void-template.h
task192552.h
task234909.h
@@ -71,6 +70,7 @@ list(TRANSFORM comparison_relevant_moc_list APPEND ".json" OUTPUT_VARIABLE moc_
qt_internal_add_test(tst_moc
SOURCES
cxx-attributes.h
+ single_function_keyword.h
tst_moc.cpp
${comparison_relevant_moc_list}
INCLUDE_DIRECTORIES
diff --git a/tests/auto/tools/moc/allmocs_baseline_in.json b/tests/auto/tools/moc/allmocs_baseline_in.json
index 5cbcb99e68..f82500eda4 100644
--- a/tests/auto/tools/moc/allmocs_baseline_in.json
+++ b/tests/auto/tools/moc/allmocs_baseline_in.json
@@ -2606,87 +2606,6 @@
{
"classes": [
{
- "className": "SingleFunctionKeywordBeforeReturnType",
- "object": true,
- "qualifiedClassName": "SingleFunctionKeywordBeforeReturnType",
- "signals": [
- {
- "access": "public",
- "name": "mySignal",
- "returnType": "void"
- }
- ],
- "slots": [
- {
- "access": "public",
- "name": "mySlot",
- "returnType": "void"
- }
- ],
- "superClasses": [
- {
- "access": "public",
- "name": "QObject"
- }
- ]
- },
- {
- "className": "SingleFunctionKeywordBeforeInline",
- "object": true,
- "qualifiedClassName": "SingleFunctionKeywordBeforeInline",
- "signals": [
- {
- "access": "public",
- "name": "mySignal",
- "returnType": "void"
- }
- ],
- "slots": [
- {
- "access": "public",
- "name": "mySlot",
- "returnType": "void"
- }
- ],
- "superClasses": [
- {
- "access": "public",
- "name": "QObject"
- }
- ]
- },
- {
- "className": "SingleFunctionKeywordAfterInline",
- "object": true,
- "qualifiedClassName": "SingleFunctionKeywordAfterInline",
- "signals": [
- {
- "access": "public",
- "name": "mySignal",
- "returnType": "void"
- }
- ],
- "slots": [
- {
- "access": "public",
- "name": "mySlot",
- "returnType": "void"
- }
- ],
- "superClasses": [
- {
- "access": "public",
- "name": "QObject"
- }
- ]
- }
- ],
- "inputFile": "single_function_keyword.h",
- "outputRevision": 68
- },
- {
- "classes": [
- {
"className": "SlotsWithVoidTemplateTest",
"object": true,
"qualifiedClassName": "SlotsWithVoidTemplateTest",
diff --git a/tests/auto/tools/moc/enum_inc.h b/tests/auto/tools/moc/enum_inc.h
index 7d7b6ae9f3..2b355b7a19 100644
--- a/tests/auto/tools/moc/enum_inc.h
+++ b/tests/auto/tools/moc/enum_inc.h
@@ -1,2 +1,4 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
parcel = 42,
part = 12,
diff --git a/tests/auto/tools/moc/forwarddeclaredparam.h b/tests/auto/tools/moc/forwarddeclaredparam.h
index 176f0c3356..94caae8a5b 100644
--- a/tests/auto/tools/moc/forwarddeclaredparam.h
+++ b/tests/auto/tools/moc/forwarddeclaredparam.h
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef FORWARDDECLAREDPARAM_H
#define FORWARDDECLAREDPARAM_H
struct ForwardDeclaredParam {};
diff --git a/tests/auto/tools/moc/os9-newlines.h b/tests/auto/tools/moc/os9-newlines.h
index 82bddd117d..2da70f6a89 100644
--- a/tests/auto/tools/moc/os9-newlines.h
+++ b/tests/auto/tools/moc/os9-newlines.h
@@ -1 +1 @@
-// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include <QObject> class Os9Newlines : public QObject { Q_OBJECT public Q_SLOTS: inline void testSlot() {} }; \ No newline at end of file
+// REUSE-IgnoreStart // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 // REUSE-IgnoreEnd #include <QObject> class Os9Newlines : public QObject { Q_OBJECT public Q_SLOTS: inline void testSlot() {} }; \ No newline at end of file
diff --git a/tests/auto/tools/moc/single_function_keyword.h b/tests/auto/tools/moc/single_function_keyword.h
index 0c907db9ef..28fd9ab90a 100644
--- a/tests/auto/tools/moc/single_function_keyword.h
+++ b/tests/auto/tools/moc/single_function_keyword.h
@@ -22,10 +22,7 @@ class SingleFunctionKeywordBeforeInline : public QObject
public:
inline SingleFunctionKeywordBeforeInline() {}
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_CLANG("-Wundefined-inline")
Q_SIGNAL inline void mySignal();
-QT_WARNING_POP
Q_SLOT inline void mySlot() { emit mySignal(); }
};
@@ -36,10 +33,7 @@ class SingleFunctionKeywordAfterInline : public QObject
public:
inline SingleFunctionKeywordAfterInline() {}
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_CLANG("-Wundefined-inline")
inline Q_SIGNAL void mySignal();
-QT_WARNING_POP
inline Q_SLOT void mySlot() { emit mySignal(); }
};
diff --git a/tests/auto/tools/moc/subdir/extradefines.h b/tests/auto/tools/moc/subdir/extradefines.h
index e7888ce80d..efad23be6f 100644
--- a/tests/auto/tools/moc/subdir/extradefines.h
+++ b/tests/auto/tools/moc/subdir/extradefines.h
@@ -1 +1,3 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#define FOO 1
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index d24dfa11f7..4fcb44f00c 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -878,7 +878,14 @@ signals:
void sigWithUnsignedArg(unsigned foo);
void sigWithSignedArg(signed foo);
void sigWithConstSignedArg(const signed foo);
+#ifndef Q_MOC_RUN // QTBUG-126395
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_GCC("-Wvolatile")
+#endif
void sigWithVolatileConstSignedArg(volatile const signed foo);
+#ifndef Q_MOC_RUN // QTBUG-126395
+ QT_WARNING_POP
+#endif
void sigWithCustomType(const MyStruct);
void constSignal1() const;
void constSignal2(int arg) const;
@@ -4710,4 +4717,8 @@ QTEST_MAIN(tst_Moc)
#undef slots
#undef emit
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_GCC("-Wvolatile") // should moc itself add this in generated code?
#include "tst_moc.moc"
+QT_WARNING_POP
+#include "moc_single_function_keyword.cpp" // prevents "undefined inline functions" warnings
diff --git a/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt b/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt
index 9dea3f3c4d..8ea0c609c0 100644
--- a/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt
+++ b/tests/auto/tools/qdbuscpp2xml/CMakeLists.txt
@@ -33,3 +33,4 @@ qt_internal_add_resource(tst_qdbuscpp2xml "qdbuscpp2xml"
${qdbuscpp2xml_resource_files}
)
+add_dependencies(tst_qdbuscpp2xml ${QT_CMAKE_EXPORT_NAMESPACE}::qdbuscpp2xml)
diff --git a/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt b/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt
index 29278377b6..44bf8166ee 100644
--- a/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt
+++ b/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt
@@ -15,3 +15,5 @@ qt_internal_add_test(tst_qdbusxml2cpp
SOURCES
tst_qdbusxml2cpp.cpp
)
+
+add_dependencies(tst_qdbusxml2cpp ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp)
diff --git a/tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp b/tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp
index 39de28135a..866a063753 100644
--- a/tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp
+++ b/tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
int main(int, char **)
{
return 0;
diff --git a/tests/auto/tools/qmake/testdata/findDeps/needed.cpp b/tests/auto/tools/qmake/testdata/findDeps/needed.cpp
index 698d0aaa12..726382cf10 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/needed.cpp
+++ b/tests/auto/tools/qmake/testdata/findDeps/needed.cpp
@@ -1 +1,3 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
extern int needed(void) { return 1; }
diff --git a/tests/auto/tools/qmake/testdata/findMocs/digitseparated.h b/tests/auto/tools/qmake/testdata/findMocs/digitseparated.h
index ddedac26e3..10cf31a8a5 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/digitseparated.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/digitseparated.h
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QObject>
class AfterDigitSeparator : public QObject
diff --git a/tests/auto/tools/qmake/testdata/include_pwd/anotherheader.h b/tests/auto/tools/qmake/testdata/include_pwd/anotherheader.h
index a3a63e26bf..228a8861b7 100644
--- a/tests/auto/tools/qmake/testdata/include_pwd/anotherheader.h
+++ b/tests/auto/tools/qmake/testdata/include_pwd/anotherheader.h
@@ -1,2 +1,4 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
/* This file should be included indirectly through main.cpp */
diff --git a/tests/auto/tools/qmake/testdata/include_pwd/main.cpp b/tests/auto/tools/qmake/testdata/include_pwd/main.cpp
index c98935f87d..b55f0525ea 100644
--- a/tests/auto/tools/qmake/testdata/include_pwd/main.cpp
+++ b/tests/auto/tools/qmake/testdata/include_pwd/main.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "someheader.h"
int main()
diff --git a/tests/auto/tools/qmake/testdata/include_pwd/somedirectory/someheader.h b/tests/auto/tools/qmake/testdata/include_pwd/somedirectory/someheader.h
index f977346945..9a26fb7c1e 100644
--- a/tests/auto/tools/qmake/testdata/include_pwd/somedirectory/someheader.h
+++ b/tests/auto/tools/qmake/testdata/include_pwd/somedirectory/someheader.h
@@ -1 +1,3 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "anotherheader.h"
diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h b/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h
index 595c0cac3c..b65da1d85c 100644
--- a/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h
+++ b/tests/auto/tools/qmake/testdata/quotedfilenames/include folder/header.h
@@ -1 +1,3 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
/* a random header file */
diff --git a/tests/auto/tools/qmake/testdata/windows_resources/main.cpp b/tests/auto/tools/qmake/testdata/windows_resources/main.cpp
index 237c8ce181..6c1d24751e 100644
--- a/tests/auto/tools/qmake/testdata/windows_resources/main.cpp
+++ b/tests/auto/tools/qmake/testdata/windows_resources/main.cpp
@@ -1 +1,3 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
int main() {}
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index a32b4ab228..278cf4ad23 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -93,6 +93,11 @@ static void copyDir(const QString &sourceDirPath, const QString &targetDirPath)
void tst_qmake::initTestCase()
{
+#if defined(Q_OS_APPLE)
+ if (QProcess::execute("xcode-select", { "-p" }) != 0)
+ QSKIP("Xcode or Xcode command line tools not installed");
+#endif
+
QVERIFY2(tempWorkDir.isValid(), qPrintable(tempWorkDir.errorString()));
QString binpath = QLibraryInfo::path(QLibraryInfo::BinariesPath);
QString cmd = QString("%1/qmake").arg(binpath);
diff --git a/tests/auto/tools/qt_cmake_create/testdata/cpp_project/main.cpp b/tests/auto/tools/qt_cmake_create/testdata/cpp_project/main.cpp
index ae659d5ed4..3526286e5e 100644
--- a/tests/auto/tools/qt_cmake_create/testdata/cpp_project/main.cpp
+++ b/tests/auto/tools/qt_cmake_create/testdata/cpp_project/main.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <iostream>
int main(int, char *[])
diff --git a/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp b/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
index 13c7014d8c..844e67e2c4 100644
--- a/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
+++ b/tests/auto/tools/qt_cmake_create/testdata/qml_project/main.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QGuiApplication>
#include <QQmlApplicationEngine>
diff --git a/tests/auto/tools/qt_cmake_create/testdata/qrc_project/main.cpp b/tests/auto/tools/qt_cmake_create/testdata/qrc_project/main.cpp
index cd8ed8f57b..72f63e3077 100644
--- a/tests/auto/tools/qt_cmake_create/testdata/qrc_project/main.cpp
+++ b/tests/auto/tools/qt_cmake_create/testdata/qrc_project/main.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QFile>
#include <QDebug>
diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp b/tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp
index b0a4ec2647..2e74e1c140 100644
--- a/tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp
+++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/main.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "widget.h"
#include <QApplication>
diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp
index 815d5f8c4b..65c5eae0c9 100644
--- a/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp
+++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.cpp
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "widget.h"
#include "ui_widget.h"
@@ -12,4 +14,3 @@ Widget::~Widget()
{
delete ui;
}
-
diff --git a/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h
index 1fe2322b13..9110f2a20b 100644
--- a/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h
+++ b/tests/auto/tools/qt_cmake_create/testdata/ui_project/widget.h
@@ -1,3 +1,5 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef WIDGET_H
#define WIDGET_H
diff --git a/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp b/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp
index 6bbc58ef32..52c3bef14a 100644
--- a/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp
+++ b/tests/auto/tools/qt_cmake_create/tst_qt_cmake_create.cpp
@@ -42,12 +42,17 @@ void tst_qt_cmake_create::initTestCase()
#ifdef Q_OS_WINDOWS
m_shell = QString("cmd.exe");
m_cmd = QString("%1/qt-cmake-create.bat").arg(binpath);
+ const QString cmake = QStandardPaths::findExecutable("cmake.exe");
#else
m_shell = QString("/bin/sh");
m_cmd = QString("%1/qt-cmake-create").arg(binpath);
QVERIFY(QFile::exists(m_shell));
+ const QString cmake = QStandardPaths::findExecutable("cmake");
#endif
+ if (cmake.isEmpty())
+ QSKIP("CMake not found");
+
QVERIFY(QFile::exists(m_cmd));
}
diff --git a/tests/auto/tools/rcc/data/.gitattributes b/tests/auto/tools/rcc/data/.gitattributes
new file mode 100644
index 0000000000..89d6e8fe1c
--- /dev/null
+++ b/tests/auto/tools/rcc/data/.gitattributes
@@ -0,0 +1,2 @@
+# Keep parentdir.txt with LF line endings
+parentdir.txt -text
diff --git a/tests/auto/tools/rcc/data/deduplication/deduplication.expected b/tests/auto/tools/rcc/data/deduplication/deduplication.expected
new file mode 100644
index 0000000000..bd873437b4
--- /dev/null
+++ b/tests/auto/tools/rcc/data/deduplication/deduplication.expected
@@ -0,0 +1,157 @@
+/****************************************************************************
+** Resource object code
+**
+IGNORE:** Created by: The Resource Compiler for Qt version 6.9.0
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
+static const unsigned char qt_resource_data[] = {
+ // b.txt
+ 0x0,0x0,0x0,0xb,
+ 0x62,
+ 0x20,0x74,0x65,0x73,0x74,0x20,0x66,0x69,0x6c,0x65,
+ // c_with_a_content.txt
+ 0x0,0x0,0x0,0xb,
+ 0x61,
+ 0x20,0x74,0x65,0x73,0x74,0x20,0x66,0x69,0x6c,0x65,
+ // b.txt
+ 0x0,0x0,0x0,0xb,
+ 0x62,
+ 0x20,0x74,0x65,0x73,0x74,0x20,0x66,0x69,0x6c,0x65,
+
+};
+
+static const unsigned char qt_resource_name[] = {
+ // files
+ 0x0,0x5,
+ 0x0,0x6d,0x2,0xc3,
+ 0x0,0x66,
+ 0x0,0x69,0x0,0x6c,0x0,0x65,0x0,0x73,
+ // b.txt
+ 0x0,0x5,
+ 0x0,0x65,0x5b,0xf4,
+ 0x0,0x62,
+ 0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+ // c_with_a_content.txt
+ 0x0,0x14,
+ 0x1,0x61,0x1d,0x34,
+ 0x0,0x63,
+ 0x0,0x5f,0x0,0x77,0x0,0x69,0x0,0x74,0x0,0x68,0x0,0x5f,0x0,0x61,0x0,0x5f,0x0,0x63,0x0,0x6f,0x0,0x6e,0x0,0x74,0x0,0x65,0x0,0x6e,0x0,0x74,0x0,0x2e,
+ 0x0,0x74,0x0,0x78,0x0,0x74,
+ // a.txt
+ 0x0,0x5,
+ 0x0,0x64,0x5b,0xf4,
+ 0x0,0x61,
+ 0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+ // alias_of_b_compress9.txt
+ 0x0,0x18,
+ 0xb,0x26,0xf,0xb4,
+ 0x0,0x61,
+ 0x0,0x6c,0x0,0x69,0x0,0x61,0x0,0x73,0x0,0x5f,0x0,0x6f,0x0,0x66,0x0,0x5f,0x0,0x62,0x0,0x5f,0x0,0x63,0x0,0x6f,0x0,0x6d,0x0,0x70,0x0,0x72,0x0,0x65,
+ 0x0,0x73,0x0,0x73,0x0,0x39,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+ // alias_of_b.txt
+ 0x0,0xe,
+ 0x1,0xa4,0x6d,0x34,
+ 0x0,0x61,
+ 0x0,0x6c,0x0,0x69,0x0,0x61,0x0,0x73,0x0,0x5f,0x0,0x6f,0x0,0x66,0x0,0x5f,0x0,0x62,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+ // alias_of_b_compress9_dupe.txt
+ 0x0,0x1d,
+ 0x9,0x4,0x7a,0x14,
+ 0x0,0x61,
+ 0x0,0x6c,0x0,0x69,0x0,0x61,0x0,0x73,0x0,0x5f,0x0,0x6f,0x0,0x66,0x0,0x5f,0x0,0x62,0x0,0x5f,0x0,0x63,0x0,0x6f,0x0,0x6d,0x0,0x70,0x0,0x72,0x0,0x65,
+ 0x0,0x73,0x0,0x73,0x0,0x39,0x0,0x5f,0x0,0x64,0x0,0x75,0x0,0x70,0x0,0x65,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+
+};
+
+static const unsigned char qt_resource_struct[] = {
+ // :
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+ // :/files
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x2,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+ // :/files/a.txt
+ 0x0,0x0,0x0,0x4e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xf,
+TIMESTAMP:files/a.txt
+ // :/files/b.txt
+ 0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+TIMESTAMP:files/b.txt
+ // :/files/c_with_a_content.txt
+ 0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xf,
+TIMESTAMP:files/c_with_a_content.txt
+ // :/files/alias_of_b.txt
+ 0x0,0x0,0x0,0x94,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+TIMESTAMP:files/b.txt
+ // :/files/alias_of_b_compress9_dupe.txt
+ 0x0,0x0,0x0,0xb6,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1e,
+TIMESTAMP:files/b.txt
+ // :/files/alias_of_b_compress9.txt
+ 0x0,0x0,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1e,
+TIMESTAMP:files/b.txt
+
+};
+
+#ifdef QT_NAMESPACE
+# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
+# define QT_RCC_MANGLE_NAMESPACE0(x) x
+# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
+# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
+# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
+ QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
+#else
+# define QT_RCC_PREPEND_NAMESPACE(name) name
+# define QT_RCC_MANGLE_NAMESPACE(name) name
+#endif
+
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
+namespace QT_NAMESPACE {
+#endif
+
+bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+#ifdef QT_NAMESPACE
+}
+#endif
+
+int QT_RCC_MANGLE_NAMESPACE(qInitResources)();
+int QT_RCC_MANGLE_NAMESPACE(qInitResources)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)();
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
+namespace {
+ struct initializer {
+ initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); }
+ ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); }
+ } dummy;
+}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
diff --git a/tests/auto/tools/rcc/data/deduplication/deduplication.qrc b/tests/auto/tools/rcc/data/deduplication/deduplication.qrc
new file mode 100644
index 0000000000..fd8a776503
--- /dev/null
+++ b/tests/auto/tools/rcc/data/deduplication/deduplication.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>files/a.txt</file>
+ <file>files/b.txt</file>
+ <file alias="files/alias_of_b.txt">files/b.txt</file>
+ <file>files/c_with_a_content.txt</file>
+ <file alias="files/alias_of_b_compress9.txt" compress="9">files/b.txt</file>
+ <file alias="files/alias_of_b_compress9_dupe.txt" compress="9">files/b.txt</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/tools/rcc/data/deduplication/files/a.txt b/tests/auto/tools/rcc/data/deduplication/files/a.txt
new file mode 100644
index 0000000000..abd91bd465
--- /dev/null
+++ b/tests/auto/tools/rcc/data/deduplication/files/a.txt
@@ -0,0 +1 @@
+a test file \ No newline at end of file
diff --git a/tests/auto/tools/rcc/data/deduplication/files/b.txt b/tests/auto/tools/rcc/data/deduplication/files/b.txt
new file mode 100644
index 0000000000..01e4d76fc5
--- /dev/null
+++ b/tests/auto/tools/rcc/data/deduplication/files/b.txt
@@ -0,0 +1 @@
+b test file \ No newline at end of file
diff --git a/tests/auto/tools/rcc/data/deduplication/files/c_with_a_content.txt b/tests/auto/tools/rcc/data/deduplication/files/c_with_a_content.txt
new file mode 100644
index 0000000000..abd91bd465
--- /dev/null
+++ b/tests/auto/tools/rcc/data/deduplication/files/c_with_a_content.txt
@@ -0,0 +1 @@
+a test file \ No newline at end of file
diff --git a/tests/auto/tools/rcc/data/legal/legal.qrc b/tests/auto/tools/rcc/data/legal/legal.qrc
new file mode 100644
index 0000000000..5eb7f58416
--- /dev/null
+++ b/tests/auto/tools/rcc/data/legal/legal.qrc
@@ -0,0 +1,10 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+ <legal>
+ Copyright (C) 2024 Intel Corporation.
+ SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+ </legal>
+ <qresource>
+ <file>../parentdir.txt</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/tools/rcc/data/legal/rcc_legal.cpp b/tests/auto/tools/rcc/data/legal/rcc_legal.cpp
new file mode 100644
index 0000000000..deec3380aa
--- /dev/null
+++ b/tests/auto/tools/rcc/data/legal/rcc_legal.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+** Resource object code
+** Copyright (C) 2024 Intel Corporation.
+** SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+**
+** Created by: The Resource Compiler for Qt version 6.9.0
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#ifdef _MSC_VER
+// disable informational message "function ... selected for automatic inline expansion"
+#pragma warning (disable: 4711)
+#endif
+
+static const unsigned char qt_resource_data[] = {
+ // parentdir.txt
+ 0x0,0x0,0x0,0x1a,
+ 0x61,
+ 0x62,0x63,0x64,0x65,0x66,0x67,0x69,0x68,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,
+ 0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0xa,
+
+};
+
+static const unsigned char qt_resource_name[] = {
+ // parentdir.txt
+ 0x0,0xd,
+ 0x6,0x14,0xd1,0x74,
+ 0x0,0x70,
+ 0x0,0x61,0x0,0x72,0x0,0x65,0x0,0x6e,0x0,0x74,0x0,0x64,0x0,0x69,0x0,0x72,0x0,0x2e,0x0,0x74,0x0,0x78,0x0,0x74,
+
+};
+
+static const unsigned char qt_resource_struct[] = {
+ // :
+ 0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,
+0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,
+ // :/parentdir.txt
+ 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0,
+TIMESTAMP:../parentdir.txt
+
+};
+
+#ifdef QT_NAMESPACE
+# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
+# define QT_RCC_MANGLE_NAMESPACE0(x) x
+# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
+# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
+# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
+ QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
+#else
+# define QT_RCC_PREPEND_NAMESPACE(name) name
+# define QT_RCC_MANGLE_NAMESPACE(name) name
+#endif
+
+#if defined(QT_INLINE_NAMESPACE)
+inline namespace QT_NAMESPACE {
+#elif defined(QT_NAMESPACE)
+namespace QT_NAMESPACE {
+#endif
+
+bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
+
+#ifdef QT_NAMESPACE
+}
+#endif
+
+int QT_RCC_MANGLE_NAMESPACE(qInitResources)();
+int QT_RCC_MANGLE_NAMESPACE(qInitResources)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qRegisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)();
+int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)()
+{
+ int version = 3;
+ QT_RCC_PREPEND_NAMESPACE(qUnregisterResourceData)
+ (version, qt_resource_struct, qt_resource_name, qt_resource_data);
+ return 1;
+}
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
+namespace {
+ struct initializer {
+ initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources)(); }
+ ~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources)(); }
+ } dummy;
+}
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp
index 88a6e17e2f..ac024b11d0 100644
--- a/tests/auto/tools/rcc/tst_rcc.cpp
+++ b/tests/auto/tools/rcc/tst_rcc.cpp
@@ -1,5 +1,6 @@
// Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>
// Copyright (C) 2016 The Qt Company Ltd.
+// Copyright (C) 2024 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -148,6 +149,14 @@ void tst_rcc::rcc_data()
QTest::newRow("size-1") << sizesPath << "size-1.qrc" << "size-1.expected";
QTest::newRow("size-2-0-35-1") << sizesPath << "size-2-0-35-1.qrc" <<
(sizeof(size_t) == 8 ? "size-2-0-35-1.expected" : "size-2-0-35-1.expected32");
+
+ QTest::newRow("legal") << m_dataPath + QLatin1StringView("/legal")
+ << "legal.qrc" << "rcc_legal.cpp";
+
+ if (sizeof(size_t) == 8) {
+ const QString deduplicationPath = m_dataPath + QLatin1String("/deduplication");
+ QTest::newRow("deduplication") << deduplicationPath << "deduplication.qrc" << "deduplication.expected";
+ }
}
static QStringList readLinesFromFile(const QString &fileName,
diff --git a/tests/auto/tools/uic/baseline/Widget.ui b/tests/auto/tools/uic/baseline/Widget.ui
index ab94733dcc..285d95eb88 100644
--- a/tests/auto/tools/uic/baseline/Widget.ui
+++ b/tests/auto/tools/uic/baseline/Widget.ui
@@ -1,4 +1,6 @@
<ui version="4.0" >
+ <legal>Copyright (C) 2016 The Qt Company Ltd.
+SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only</legal>
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >
diff --git a/tests/auto/tools/uic/baseline/Widget.ui.h b/tests/auto/tools/uic/baseline/Widget.ui.h
index 4d4846e6c5..a7fa74c447 100644
--- a/tests/auto/tools/uic/baseline/Widget.ui.h
+++ b/tests/auto/tools/uic/baseline/Widget.ui.h
@@ -1,3 +1,8 @@
+/*
+Copyright (C) 2016 The Qt Company Ltd.
+SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+*/
+
/********************************************************************************
** Form generated from reading UI file 'Widget.ui'
**
diff --git a/tests/auto/tools/uic/baseline/qtbug126265.ui b/tests/auto/tools/uic/baseline/qtbug126265.ui
new file mode 100644
index 0000000000..ba89566082
--- /dev/null
+++ b/tests/auto/tools/uic/baseline/qtbug126265.ui
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QPushButton" name="pushButton">
+ <property name="geometry">
+ <rect>
+ <x>70</x>
+ <y>40</y>
+ <width>91</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <property name="text(&quot;Hello world!&quot;); injected code;//">
+ <enum>Qt::FocusPolicy::WheelFocus</enum>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="geometry">
+ <rect>
+ <x>70</x>
+ <y>110</y>
+ <width>91</width>
+ <height>29</height>
+ </rect>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::FocusPolicy::WheelFocus); injected code;//</enum>
+ </property>
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/auto/tools/uic/baseline/qtbug126265.ui.h b/tests/auto/tools/uic/baseline/qtbug126265.ui.h
new file mode 100644
index 0000000000..3ff99db9bc
--- /dev/null
+++ b/tests/auto/tools/uic/baseline/qtbug126265.ui.h
@@ -0,0 +1,57 @@
+/********************************************************************************
+** Form generated from reading UI file 'qtbug126265.ui'
+**
+** Created by: Qt User Interface Compiler version 6.0.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef QTBUG126265_H
+#define QTBUG126265_H
+
+#include <QtCore/QVariant>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Form
+{
+public:
+ QPushButton *pushButton;
+ QPushButton *pushButton_2;
+
+ void setupUi(QWidget *Form)
+ {
+ if (Form->objectName().isEmpty())
+ Form->setObjectName("Form");
+ Form->resize(400, 300);
+ pushButton = new QPushButton(Form);
+ pushButton->setObjectName("pushButton");
+ pushButton->setGeometry(QRect(70, 40, 91, 29));
+ pushButton_2 = new QPushButton(Form);
+ pushButton_2->setObjectName("pushButton_2");
+ pushButton_2->setGeometry(QRect(70, 110, 91, 29));
+
+ retranslateUi(Form);
+
+ QMetaObject::connectSlotsByName(Form);
+ } // setupUi
+
+ void retranslateUi(QWidget *Form)
+ {
+ Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr));
+ pushButton->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
+ pushButton_2->setText(QCoreApplication::translate("Form", "PushButton", nullptr));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Form: public Ui_Form {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // QTBUG126265_H