tests: Add tst_titlebar
At least for the ctor, which already helps to find bugs in the .qml file
This commit is contained in:
@@ -357,6 +357,7 @@ if(${PROJECT_NAME}_TESTS)
|
||||
add_test(NAME tst_viewwrapper COMMAND tst_viewwrapper)
|
||||
add_test(NAME tst_viewguard COMMAND tst_viewguard)
|
||||
add_test(NAME tst_frame COMMAND tst_frame)
|
||||
add_test(NAME tst_titlebar COMMAND tst_titlebar)
|
||||
|
||||
if(NOT ${PROJECT_NAME}_QTQUICK)
|
||||
# tst_multisplitter depends on QWidget
|
||||
|
||||
@@ -63,4 +63,7 @@ add_executable(tst_viewwrapper tst_viewwrapper.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_viewwrapper kddockwidgets)
|
||||
|
||||
add_executable(tst_frame controllers/tst_frame.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_frame kddockwidgets)
|
||||
target_link_libraries(tst_frame kddockwidgets)
|
||||
|
||||
add_executable(tst_titlebar controllers/tst_titlebar.cpp ${TESTING_RESOURCES})
|
||||
target_link_libraries(tst_titlebar kddockwidgets)
|
||||
27
tests/controllers/tst_titlebar.cpp
Normal file
27
tests/controllers/tst_titlebar.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
This file is part of KDDockWidgets.
|
||||
|
||||
SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
|
||||
Author: Sérgio Martins <sergio.martins@kdab.com>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "../main.h"
|
||||
#include "controllers/TitleBar.h"
|
||||
#include "controllers/Frame.h"
|
||||
|
||||
#include "qtquick/Platform_qtquick.h"
|
||||
|
||||
#include <QQmlContext>
|
||||
#include <QQmlEngine>
|
||||
|
||||
TEST_CASE("TitleBar Ctor")
|
||||
{
|
||||
auto frame = new Controllers::Frame(nullptr, {});
|
||||
auto tb = new Controllers::TitleBar(frame);
|
||||
delete tb;
|
||||
delete frame;
|
||||
}
|
||||
Reference in New Issue
Block a user