diff options
Diffstat (limited to 'tests/auto/tools/rcc')
-rw-r--r-- | tests/auto/tools/rcc/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/tools/rcc/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/images/images.expected | 18 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/images/images.expected32 | 9 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-0.expected | 18 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-1.expected | 18 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected | 18 | ||||
-rw-r--r-- | tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32 | 9 | ||||
-rw-r--r-- | tests/auto/tools/rcc/tst_rcc.cpp | 14 |
9 files changed, 99 insertions, 16 deletions
diff --git a/tests/auto/tools/rcc/BLACKLIST b/tests/auto/tools/rcc/BLACKLIST deleted file mode 100644 index 367fc3b94c..0000000000 --- a/tests/auto/tools/rcc/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -# QTBUG-85364 -b2qt cmake diff --git a/tests/auto/tools/rcc/CMakeLists.txt b/tests/auto/tools/rcc/CMakeLists.txt index 703fdbe62b..96863c49bd 100644 --- a/tests/auto/tools/rcc/CMakeLists.txt +++ b/tests/auto/tools/rcc/CMakeLists.txt @@ -1,9 +1,16 @@ -# Generated from rcc.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_rcc Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_rcc LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_rcc SOURCES tst_rcc.cpp diff --git a/tests/auto/tools/rcc/data/images/images.expected b/tests/auto/tools/rcc/data/images/images.expected index 3ff8c82cfc..b30c6ce623 100644 --- a/tests/auto/tools/rcc/data/images/images.expected +++ b/tests/auto/tools/rcc/data/images/images.expected @@ -6,6 +6,11 @@ IGNORE:** Created by: The Resource Compiler for Qt version 6.3.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[] = { IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/square.png 0x0,0x0,0x0,0x5e, @@ -110,7 +115,9 @@ TIMESTAMP:images/subdir/triangle.png # define QT_RCC_MANGLE_NAMESPACE(name) name #endif -#ifdef QT_NAMESPACE +#if defined(QT_INLINE_NAMESPACE) +inline namespace QT_NAMESPACE { +#elif defined(QT_NAMESPACE) namespace QT_NAMESPACE { #endif @@ -139,9 +146,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() 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/images/images.expected32 b/tests/auto/tools/rcc/data/images/images.expected32 index c9e2e0852f..7e98fdd4fc 100644 --- a/tests/auto/tools/rcc/data/images/images.expected32 +++ b/tests/auto/tools/rcc/data/images/images.expected32 @@ -6,6 +6,11 @@ IGNORE:** Created by: The Resource Compiler for Qt version 6.3.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[] = { IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/images/images/square.png 0x0,0x0,0x0,0x5e, @@ -110,7 +115,9 @@ TIMESTAMP:images/subdir/triangle.png # define QT_RCC_MANGLE_NAMESPACE(name) name #endif -#ifdef QT_NAMESPACE +#if defined(QT_INLINE_NAMESPACE) +inline namespace QT_NAMESPACE { +#elif defined(QT_NAMESPACE) namespace QT_NAMESPACE { #endif diff --git a/tests/auto/tools/rcc/data/sizes/size-0.expected b/tests/auto/tools/rcc/data/sizes/size-0.expected index 2f70a607ab..79defe7868 100644 --- a/tests/auto/tools/rcc/data/sizes/size-0.expected +++ b/tests/auto/tools/rcc/data/sizes/size-0.expected @@ -6,6 +6,11 @@ IGNORE: ** Created by: The Resource Compiler for Qt version 5.11.2 ** 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[] = { IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-0.txt 0x0,0x0,0x0,0x0, @@ -52,7 +57,9 @@ TIMESTAMP:data/data-0.txt # define QT_RCC_MANGLE_NAMESPACE(name) name #endif -#ifdef QT_NAMESPACE +#if defined(QT_INLINE_NAMESPACE) +inline namespace QT_NAMESPACE { +#elif defined(QT_NAMESPACE) namespace QT_NAMESPACE { #endif @@ -81,9 +88,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() 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/sizes/size-1.expected b/tests/auto/tools/rcc/data/sizes/size-1.expected index d1717a9255..925de99c32 100644 --- a/tests/auto/tools/rcc/data/sizes/size-1.expected +++ b/tests/auto/tools/rcc/data/sizes/size-1.expected @@ -6,6 +6,11 @@ IGNORE:** Created by: The Resource Compiler for Qt version 5.11.2 ** 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[] = { IGNORE: // /data/dev/qt-5/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt 0x0,0x0,0x0,0x1, @@ -53,7 +58,9 @@ TIMESTAMP:data/data-1.txt # define QT_RCC_MANGLE_NAMESPACE(name) name #endif -#ifdef QT_NAMESPACE +#if defined(QT_INLINE_NAMESPACE) +inline namespace QT_NAMESPACE { +#elif defined(QT_NAMESPACE) namespace QT_NAMESPACE { #endif @@ -82,9 +89,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() 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/sizes/size-2-0-35-1.expected b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected index 4921b3bd9f..d858e15dba 100644 --- a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected +++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected @@ -6,6 +6,11 @@ IGNORE:** Created by: The Resource Compiler for Qt version 6.3.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[] = { IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-2.txt 0x0,0x0,0x0,0x2, @@ -90,7 +95,9 @@ TIMESTAMP:data/data-1.txt # define QT_RCC_MANGLE_NAMESPACE(name) name #endif -#ifdef QT_NAMESPACE +#if defined(QT_INLINE_NAMESPACE) +inline namespace QT_NAMESPACE { +#elif defined(QT_NAMESPACE) namespace QT_NAMESPACE { #endif @@ -119,9 +126,18 @@ int QT_RCC_MANGLE_NAMESPACE(qCleanupResources)() 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/sizes/size-2-0-35-1.expected32 b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32 index aea21ecc09..a67e0ffc6e 100644 --- a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32 +++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1.expected32 @@ -6,6 +6,11 @@ IGNORE:** Created by: The Resource Compiler for Qt version 6.3.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[] = { IGNORE: // D:/projects/qt/dev/src/qtbase/tests/auto/tools/rcc/data/sizes/data/data-1.txt 0x0,0x0,0x0,0x1, @@ -90,7 +95,9 @@ TIMESTAMP:data/data-1.txt # define QT_RCC_MANGLE_NAMESPACE(name) name #endif -#ifdef QT_NAMESPACE +#if defined(QT_INLINE_NAMESPACE) +inline namespace QT_NAMESPACE { +#elif defined(QT_NAMESPACE) namespace QT_NAMESPACE { #endif diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp index ad13cc2eeb..88a6e17e2f 100644 --- a/tests/auto/tools/rcc/tst_rcc.cpp +++ b/tests/auto/tools/rcc/tst_rcc.cpp @@ -1,6 +1,6 @@ // Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com> // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QLibraryInfo> @@ -114,7 +114,7 @@ static QString doCompare(const QStringList &actual, const QStringList &expected, ba.append("File " + fi.absoluteFilePath().toUtf8() + " does not exist!"); break; } - const quint64 timeStamp = quint64(fi.lastModified().toMSecsSinceEpoch()); + const quint64 timeStamp = quint64(fi.lastModified(QTimeZone::UTC).toMSecsSinceEpoch()); expectedLine.clear(); for (int shift = 56; shift >= 0; shift -= 8) { expectedLine.append(QLatin1String("0x")); @@ -211,8 +211,8 @@ static QStringMap readExpectedFiles(const QString &fileName) { QStringMap expectedFiles; - QStringList lines = readLinesFromFile(fileName, Qt::SkipEmptyParts); - foreach (const QString &line, lines) { + const QStringList lines = readLinesFromFile(fileName, Qt::SkipEmptyParts); + for (const QString &line : lines) { QString resourceFileName = line.section(QLatin1Char(' '), 0, 0, QString::SectionSkipEmpty); QString actualFileName = line.section(QLatin1Char(' '), 1, 1, QString::SectionSkipEmpty); expectedFiles[resourceFileName] = actualFileName; @@ -276,8 +276,8 @@ void tst_rcc::binary_data() QString localeFileName = absoluteBaseName + QLatin1String(".locale"); QFile localeFile(localeFileName); if (localeFile.exists()) { - QStringList locales = readLinesFromFile(localeFileName, Qt::SkipEmptyParts); - foreach (const QString &locale, locales) { + const QStringList locales = readLinesFromFile(localeFileName, Qt::SkipEmptyParts); + for (const QString &locale : locales) { QString expectedFileName = QString::fromLatin1("%1.%2.%3").arg(absoluteBaseName, locale, QLatin1String("expected")); QStringMap expectedFiles = readExpectedFiles(expectedFileName); QTest::newRow(qPrintable(qrcFileInfo.baseName() + QLatin1Char('_') + locale)) << rccFileName @@ -473,7 +473,7 @@ void tst_rcc::cleanupTestCase() QFileInfoList entries = dataDir.entryInfoList(QStringList() << QLatin1String("*.rcc")); QDir dataDepDir(m_dataPath + QLatin1String("/depfile")); entries += dataDepDir.entryInfoList({QLatin1String("*.d"), QLatin1String("*.qrc.cpp")}); - foreach (const QFileInfo &entry, entries) + for (const QFileInfo &entry : std::as_const(entries)) QFile::remove(entry.absoluteFilePath()); } |