summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/cmake/CMakeLists.txt1
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt24
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/existing.qrc6
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp46
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file.txt1
-rw-r--r--tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file_two.txt1
6 files changed, 79 insertions, 0 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 87d8a802f3..25bc8a5e45 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -74,6 +74,7 @@ if (NOT WIN32 OR (WIN32 AND NOT CMAKE_VERSION VERSION_LESS 2.8.11))
# Broken on windows on earlier CMake versions.
# http://public.kitware.com/Bug/view.php?id=13392
expect_pass(test_add_resources_delayed_file)
+ expect_pass(test_add_binary_resources_delayed_file BINARY test_add_binary_resources_delayed_file)
endif()
expect_pass(test_private_includes)
expect_pass(test_testlib_definitions)
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
new file mode 100644
index 0000000000..e2478330ea
--- /dev/null
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/CMakeLists.txt
@@ -0,0 +1,24 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(test_add_binary_resources_delayed_file)
+
+find_package(Qt5Core REQUIRED)
+
+include_directories(${Qt5Core_INCLUDE_DIRS})
+
+add_definitions(${Qt5Core_DEFINITIONS})
+
+qt5_add_binary_resources(rcc_file "${CMAKE_CURRENT_BINARY_DIR}/test_add_binary_resources_delayed_file.qrc" "${CMAKE_CURRENT_SOURCE_DIR}/existing.qrc")
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_add_binary_resources_delayed_file.qrc" "<!DOCTYPE RCC><RCC version=\"1.0\">
+<qresource prefix=\"/\">
+ <file alias=\"resource_file.txt\">${CMAKE_CURRENT_SOURCE_DIR}/resource_file.txt</file>
+</qresource>
+</RCC>
+")
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+
+add_executable(test_add_binary_resources_delayed_file main.cpp)
+target_link_libraries(test_add_binary_resources_delayed_file ${Qt5Core_LIBRARIES})
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/existing.qrc b/tests/auto/cmake/test_add_binary_resources_delayed_file/existing.qrc
new file mode 100644
index 0000000000..a4f448a0e2
--- /dev/null
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/existing.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>resource_file_two.txt</file>
+</qresource>
+</RCC>
+
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp b/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp
new file mode 100644
index 0000000000..86a3ecdcd6
--- /dev/null
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/main.cpp
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 André Klitzing <aklitzing@gmail.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QFile>
+#include <QResource>
+
+int main(int argc, char **argv)
+{
+ if (QResource::registerResource("rcc_file.rcc") &&
+ QFile::exists("://resource_file.txt") && QFile::exists("://resource_file_two.txt"))
+ {
+ return 0;
+ }
+
+ return -1;
+}
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file.txt b/tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file.txt
new file mode 100644
index 0000000000..2c604a4f18
--- /dev/null
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file.txt
@@ -0,0 +1 @@
+Ken sent me.
diff --git a/tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file_two.txt b/tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file_two.txt
new file mode 100644
index 0000000000..980a0d5f19
--- /dev/null
+++ b/tests/auto/cmake/test_add_binary_resources_delayed_file/resource_file_two.txt
@@ -0,0 +1 @@
+Hello World!