summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache')
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/.prev_CMakeLists.txt107
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt89
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro16
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp35
4 files changed, 38 insertions, 209 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/.prev_CMakeLists.txt b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/.prev_CMakeLists.txt
deleted file mode 100644
index 592ef6e513..0000000000
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-# Generated from qmimedatabase-cache.pro.
-
-if(NOT QT_FEATURE_private_tests)
- return()
-endif()
-
-#####################################################################
-## tst_qmimedatabase-cache Test:
-#####################################################################
-
-qt_add_test(tst_qmimedatabase-cache
- SOURCES
- ../tst_qmimedatabase.h
- tst_qmimedatabase-cache.cpp
- PUBLIC_LIBRARIES
- Qt::Concurrent
-)
-
-# Resources:
-set_source_files_properties("/Volumes/T3/Dev/qt/qt5_cmake/qtbase/src/corelib/mimetypes/mime/packages/freedesktop.org.xml"
- PROPERTIES QT_RESOURCE_ALIAS "freedesktop.org.xml"
-)
-set(mimetypes_resource_files
- "mime/packages/freedesktop.org.xml"
-)
-
-qt_add_resource(tst_qmimedatabase-cache "mimetypes"
- PREFIX
- "/qt-project.org/qmime/packages"
- BASE
- "/Volumes/T3/Dev/qt/qt5_cmake/qtbase/src/corelib/mimetypes"
- FILES
- ${mimetypes_resource_files}
-)
-set_source_files_properties("../invalid-magic1.xml"
- PROPERTIES QT_RESOURCE_ALIAS "invalid-magic1.xml"
-)
-set_source_files_properties("../invalid-magic2.xml"
- PROPERTIES QT_RESOURCE_ALIAS "invalid-magic2.xml"
-)
-set_source_files_properties("../invalid-magic3.xml"
- PROPERTIES QT_RESOURCE_ALIAS "invalid-magic3.xml"
-)
-set_source_files_properties("../magic-and-hierarchy.foo"
- PROPERTIES QT_RESOURCE_ALIAS "magic-and-hierarchy.foo"
-)
-set_source_files_properties("../magic-and-hierarchy.xml"
- PROPERTIES QT_RESOURCE_ALIAS "magic-and-hierarchy.xml"
-)
-set_source_files_properties("../magic-and-hierarchy2.foo"
- PROPERTIES QT_RESOURCE_ALIAS "magic-and-hierarchy2.foo"
-)
-set_source_files_properties("../qml-again.xml"
- PROPERTIES QT_RESOURCE_ALIAS "qml-again.xml"
-)
-set_source_files_properties("../test.qml"
- PROPERTIES QT_RESOURCE_ALIAS "test.qml"
-)
-set_source_files_properties("../text-x-objcsrc.xml"
- PROPERTIES QT_RESOURCE_ALIAS "text-x-objcsrc.xml"
-)
-set_source_files_properties("../yast2-metapackage-handler-mimetypes.xml"
- PROPERTIES QT_RESOURCE_ALIAS "yast2-metapackage-handler-mimetypes.xml"
-)
-set(testdata_resource_files
- "invalid-magic1.xml"
- "invalid-magic2.xml"
- "invalid-magic3.xml"
- "magic-and-hierarchy.foo"
- "magic-and-hierarchy.xml"
- "magic-and-hierarchy2.foo"
- "qml-again.xml"
- "test.qml"
- "text-x-objcsrc.xml"
- "yast2-metapackage-handler-mimetypes.xml"
-)
-
-qt_add_resource(tst_qmimedatabase-cache "testdata"
- PREFIX
- "/qt-project.org/qmime"
- BASE
- ".."
- FILES
- ${testdata_resource_files}
-)
-
-
-#### Keys ignored in scope 1:.:.:qmimedatabase-cache.pro:<TRUE>:
-# _REQUIREMENTS = "qtConfig(private_tests)"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(tst_qmimedatabase-cache CONDITION GCC
- COMPILE_OPTIONS
- -W
- -Wall
- -Wextra
- -Wno-long-long
- -Wnon-virtual-dtor
- -Wshadow
-)
-
-qt_extend_target(tst_qmimedatabase-cache CONDITION UNIX AND NOT APPLE AND NOT QNX
- DEFINES
- USE_XDG_DATA_DIRS
-)
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt
index e47d721f54..a267640a50 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt
@@ -1,4 +1,11 @@
-# Generated from qmimedatabase-cache.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qmimedatabase LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
if(NOT QT_FEATURE_private_tests)
return()
@@ -8,65 +15,38 @@ endif()
## tst_qmimedatabase-cache Test:
#####################################################################
-qt_add_test(tst_qmimedatabase-cache
+qt_internal_add_test(tst_qmimedatabase-cache
SOURCES
../tst_qmimedatabase.h
tst_qmimedatabase-cache.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
+ Qt::CorePrivate
Qt::Concurrent
)
# Resources:
-# special case begin
# the freedesktop resources are handled manually below via mimetypes_resources.cmake
#set(mimetypes_resource_files
#"mime/packages/freedesktop.org.xml"
#)
-# special case end
-set_source_files_properties("../invalid-magic1.xml"
- PROPERTIES QT_RESOURCE_ALIAS "invalid-magic1.xml"
-)
-set_source_files_properties("../invalid-magic2.xml"
- PROPERTIES QT_RESOURCE_ALIAS "invalid-magic2.xml"
-)
-set_source_files_properties("../invalid-magic3.xml"
- PROPERTIES QT_RESOURCE_ALIAS "invalid-magic3.xml"
-)
-set_source_files_properties("../magic-and-hierarchy.foo"
- PROPERTIES QT_RESOURCE_ALIAS "magic-and-hierarchy.foo"
-)
-set_source_files_properties("../magic-and-hierarchy.xml"
- PROPERTIES QT_RESOURCE_ALIAS "magic-and-hierarchy.xml"
-)
-set_source_files_properties("../magic-and-hierarchy2.foo"
- PROPERTIES QT_RESOURCE_ALIAS "magic-and-hierarchy2.foo"
-)
-set_source_files_properties("../qml-again.xml"
- PROPERTIES QT_RESOURCE_ALIAS "qml-again.xml"
-)
-set_source_files_properties("../test.qml"
- PROPERTIES QT_RESOURCE_ALIAS "test.qml"
-)
-set_source_files_properties("../text-x-objcsrc.xml"
- PROPERTIES QT_RESOURCE_ALIAS "text-x-objcsrc.xml"
-)
-set_source_files_properties("../yast2-metapackage-handler-mimetypes.xml"
- PROPERTIES QT_RESOURCE_ALIAS "yast2-metapackage-handler-mimetypes.xml"
-)
set(testdata_resource_files
- "invalid-magic1.xml"
- "invalid-magic2.xml"
- "invalid-magic3.xml"
- "magic-and-hierarchy.foo"
- "magic-and-hierarchy.xml"
- "magic-and-hierarchy2.foo"
- "qml-again.xml"
- "test.qml"
- "text-x-objcsrc.xml"
- "yast2-metapackage-handler-mimetypes.xml"
+ "../add-extension.xml"
+ "../circular-inheritance.xml"
+ "../invalid-magic1.xml"
+ "../invalid-magic2.xml"
+ "../invalid-magic3.xml"
+ "../magic-and-hierarchy.foo"
+ "../magic-and-hierarchy.xml"
+ "../magic-and-hierarchy2.foo"
+ "../qml-again.xml"
+ "../test.qml"
+ "../text-x-objcsrc.xml"
+ "../text-plain-subclass.xml"
+ "../webm-glob-deleteall.xml"
+ "../yast2-metapackage-handler-mimetypes.xml"
)
-qt_add_resource(tst_qmimedatabase-cache "testdata"
+qt_internal_add_resource(tst_qmimedatabase-cache "testdata"
PREFIX
"/qt-project.org/qmime"
BASE
@@ -75,19 +55,22 @@ qt_add_resource(tst_qmimedatabase-cache "testdata"
${testdata_resource_files}
)
-# special case begin
+qt_internal_add_resource(tst_qmimedatabase-cache "testfiles"
+ PREFIX
+ "/files"
+ FILES
+ "../test.txt"
+ "../test.qml"
+)
+
set(corelib_source_dir ../../../../../../src/corelib)
include(${corelib_source_dir}/mimetypes/mimetypes_resources.cmake)
corelib_add_mimetypes_resources(tst_qmimedatabase-cache)
-# special case end
-
-#### Keys ignored in scope 1:.:.:qmimedatabase-cache.pro:<TRUE>:
-# _REQUIREMENTS = "qtConfig(private_tests)"
## Scopes:
#####################################################################
-qt_extend_target(tst_qmimedatabase-cache CONDITION GCC
+qt_internal_extend_target(tst_qmimedatabase-cache CONDITION GCC
COMPILE_OPTIONS
-W
-Wall
@@ -97,7 +80,7 @@ qt_extend_target(tst_qmimedatabase-cache CONDITION GCC
-Wshadow
)
-qt_extend_target(tst_qmimedatabase-cache CONDITION UNIX AND NOT APPLE AND NOT QNX
+qt_internal_extend_target(tst_qmimedatabase-cache CONDITION UNIX AND NOT APPLE AND NOT QNX
DEFINES
USE_XDG_DATA_DIRS
)
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro
deleted file mode 100644
index 53bb012f7c..0000000000
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/qmimedatabase-cache.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-CONFIG += testcase
-
-requires(qtConfig(private_tests))
-
-TARGET = tst_qmimedatabase-cache
-
-QT = core testlib concurrent
-
-SOURCES = tst_qmimedatabase-cache.cpp
-HEADERS = ../tst_qmimedatabase.h
-RESOURCES += $$QT_SOURCE_TREE/src/corelib/mimetypes/mimetypes.qrc
-RESOURCES += ../testdata.qrc
-
-*-g++*:QMAKE_CXXFLAGS += -W -Wall -Wextra -Wshadow -Wno-long-long -Wnon-virtual-dtor
-
-unix:!mac:!qnx: DEFINES += USE_XDG_DATA_DIRS
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp
index 529c8942b3..e923cc1d50 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/tst_qmimedatabase-cache.cpp
@@ -1,36 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "../tst_qmimedatabase.h"
-#include <QDir>
-#include <QFile>
-#include <QtTest/QtTest>
-#include <qstandardpaths.h>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "../tst_qmimedatabase.cpp"