tests: Add tst_dummyplatform

Its only purpose is to instantiate some classes so we're sure
they implement all needed pure virtuals

The dummy platform is just used for copy-pasting into a new
platform, so let's cover as much boiler-plate as possible
This commit is contained in:
Sergio Martins
2022-07-11 13:42:08 +01:00
parent 1f7c1e4188
commit adcde3a65c
2 changed files with 41 additions and 0 deletions

View File

@@ -66,6 +66,9 @@ target_link_libraries(tst_window kddockwidgets kdbindings)
add_executable(tst_platform tst_platform.cpp ${TESTING_RESOURCES})
target_link_libraries(tst_platform kddockwidgets kdbindings)
add_executable(tst_dummyplatform tst_dummyplatform.cpp ${TESTING_RESOURCES})
target_link_libraries(tst_dummyplatform kddockwidgets kdbindings)
add_executable(tst_group controllers/tst_group.cpp ${TESTING_RESOURCES})
target_link_libraries(tst_group kddockwidgets kdbindings)

View File

@@ -0,0 +1,38 @@
/*
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.
*/
#define DOCTEST_CONFIG_IMPLEMENT
#include "Platform.h"
#include "dummy/Window_dummy.h"
#include <doctest/doctest.h>
using namespace KDDockWidgets;
TEST_CASE("Test pure-virtuals implemented")
{
Window_dummy dummy;
}
int main(int argc, char **argv)
{
doctest::Context ctx;
ctx.applyCommandLine(argc, argv);
Platform::tests_initPlatform(argc, argv, FrontendType::Dummy);
const int exitCode = ctx.run();
Platform::tests_deinitPlatform();
return exitCode;
}