diff options
Diffstat (limited to 'tests')
8 files changed, 116 insertions, 0 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 7f685b0338..51d0d2879e 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -146,6 +146,7 @@ endif() expect_pass(test_interface_link_libraries) expect_pass(test_moc_macro_target) +expect_pass(test_add_big_resource) if (NOT CMAKE_VERSION VERSION_LESS 3.8) # With earlier CMake versions, this test would simply run moc multiple times and lead to: diff --git a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt new file mode 100644 index 0000000000..f928b11278 --- /dev/null +++ b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt @@ -0,0 +1,13 @@ + +cmake_minimum_required(VERSION 2.8) + +project(test_add_big_resource) + +find_package(Qt5Core REQUIRED) + +qt5_wrap_cpp(moc_files myobject.h) + +qt5_add_big_resources(rcc_files "test_add_big_resource.qrc" "test_add_big_resource2.qrc") + +add_executable(myobject myobject.cpp ${moc_files} ${rcc_files}) +target_link_libraries(myobject ${Qt5Core_LIBRARIES}) diff --git a/tests/auto/cmake/test_add_big_resource/myobject.cpp b/tests/auto/cmake/test_add_big_resource/myobject.cpp new file mode 100644 index 0000000000..5d320b8592 --- /dev/null +++ b/tests/auto/cmake/test_add_big_resource/myobject.cpp @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com> +** 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 "myobject.h" + +MyObject::MyObject(QObject *parent) + : QObject(parent) +{ + emit someSignal(); +} + +int main(int argc, char **argv) +{ + MyObject myObject; + // Compile error if the resource file was not created. + Q_INIT_RESOURCE(test_add_big_resource); + Q_INIT_RESOURCE(test_add_big_resource2); + return 0; +} diff --git a/tests/auto/cmake/test_add_big_resource/myobject.h b/tests/auto/cmake/test_add_big_resource/myobject.h new file mode 100644 index 0000000000..b6fbce32cd --- /dev/null +++ b/tests/auto/cmake/test_add_big_resource/myobject.h @@ -0,0 +1,44 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com> +** 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$ +** +****************************************************************************/ + +#ifndef MYOBJECT_H +#define MYOBJECT_H + +#include <QObject> + +class MyObject : public QObject +{ + Q_OBJECT +public: + MyObject(QObject *parent = 0); + +signals: + void someSignal(); +}; + +#endif diff --git a/tests/auto/cmake/test_add_big_resource/resource_file.txt b/tests/auto/cmake/test_add_big_resource/resource_file.txt new file mode 100644 index 0000000000..2c604a4f18 --- /dev/null +++ b/tests/auto/cmake/test_add_big_resource/resource_file.txt @@ -0,0 +1 @@ +Ken sent me. diff --git a/tests/auto/cmake/test_add_big_resource/resource_file2.txt b/tests/auto/cmake/test_add_big_resource/resource_file2.txt new file mode 100644 index 0000000000..2c604a4f18 --- /dev/null +++ b/tests/auto/cmake/test_add_big_resource/resource_file2.txt @@ -0,0 +1 @@ +Ken sent me. diff --git a/tests/auto/cmake/test_add_big_resource/test_add_big_resource.qrc b/tests/auto/cmake/test_add_big_resource/test_add_big_resource.qrc new file mode 100644 index 0000000000..00a17f541f --- /dev/null +++ b/tests/auto/cmake/test_add_big_resource/test_add_big_resource.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/"> + <file>resource_file.txt</file> +</qresource> +</RCC> + diff --git a/tests/auto/cmake/test_add_big_resource/test_add_big_resource2.qrc b/tests/auto/cmake/test_add_big_resource/test_add_big_resource2.qrc new file mode 100644 index 0000000000..e21cc5e138 --- /dev/null +++ b/tests/auto/cmake/test_add_big_resource/test_add_big_resource2.qrc @@ -0,0 +1,6 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource prefix="/"> + <file>resource_file2.txt</file> +</qresource> +</RCC> + |