mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-06 09:15:23 +08:00
qt 6.5.1 original
This commit is contained in:
25
tests/auto/cmake/test_add_resource_prefix/CMakeLists.txt
Normal file
25
tests/auto/cmake/test_add_resource_prefix/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(test_add_resource_prefix)
|
||||
|
||||
find_package(Qt6 REQUIRED
|
||||
COMPONENTS Core Test
|
||||
)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
add_executable(test_add_resource_prefix main.cpp)
|
||||
|
||||
# Tests if "/" is being used when PREFIX is missing
|
||||
qt_add_resources(test_add_resource_prefix "resources_without_prefix"
|
||||
FILES resource_file.txt)
|
||||
|
||||
# Tests if the PREFIX parameter is being respected
|
||||
qt_add_resources(test_add_resource_prefix "resources_with_prefix"
|
||||
PREFIX "/resources"
|
||||
FILES resource_file.txt)
|
||||
|
||||
target_link_libraries(test_add_resource_prefix PRIVATE Qt::Core Qt::Test)
|
26
tests/auto/cmake/test_add_resource_prefix/main.cpp
Normal file
26
tests/auto/cmake/test_add_resource_prefix/main.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QFile>
|
||||
#include <QtTest>
|
||||
|
||||
class TestAddResourcePrefix : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
void resourceInDefaultPathExists();
|
||||
void resourceInGivenPathExists();
|
||||
};
|
||||
|
||||
void TestAddResourcePrefix::resourceInDefaultPathExists()
|
||||
{
|
||||
QVERIFY(QFile::exists(":/resource_file.txt"));
|
||||
}
|
||||
|
||||
void TestAddResourcePrefix::resourceInGivenPathExists()
|
||||
{
|
||||
QVERIFY(QFile::exists(":/resources/resource_file.txt"));
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestAddResourcePrefix)
|
||||
#include "main.moc"
|
@ -0,0 +1 @@
|
||||
Ken sent me.
|
Reference in New Issue
Block a user