diff --git a/tests/blacksimpluginfsxp3d/main.cpp b/tests/blacksimpluginfsxp3d/main.cpp deleted file mode 100644 index 1f16d86d4..000000000 --- a/tests/blacksimpluginfsxp3d/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2018 - * swift Project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \cond PRIVATE_TESTS -//! \file -//! \ingroup testpluginfsxp3d - -#include "testblacksimpluginfsxp3dmain.h" -#include "blackmisc/registermetadata.h" -#include -#include - -using namespace BlackSimPluginFsxP3D; - -/*! - * Starter for test cases - * \brief main - * \param argc - * \param argv - * \return - */ -int main(int argc, char *argv[]) -{ - QCoreApplication a(argc, argv); - Q_UNUSED(a); - - BlackMisc::registerMetadata(); - return CBlackSimPluginFsxP3DTest::unitMain(argc, argv);; -} - -//! \endcond diff --git a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro index dd003cf0f..2f87271f8 100644 --- a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro +++ b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3d.pro @@ -2,18 +2,24 @@ load(common_pre) QT += core testlib dbus network gui widgets -TARGET = testsimpluginfsxp3d -TEMPLATE = app - -CONFIG += console +TARGET = testsimpluginfsxp3d CONFIG -= app_bundle CONFIG += blackmisc blackcore blackconfig blackgui CONFIG += simulatorfsxcommon simulatorfscommon simulatorplugincommon fsuipc simconnect CONFIG += testcase CONFIG += no_testcase_installs -DEPENDPATH += . $$SourceRoot/src -INCLUDEPATH += . $$SourceRoot/src +TEMPLATE = app + +DEPENDPATH += \ + . \ + $$SourceRoot/src \ + $$SourceRoot/tests \ + +INCLUDEPATH += \ + $$SourceRoot/src \ + $$SourceRoot/tests \ + HEADERS += *.h SOURCES += *.cpp DESTDIR = $$DestRoot/bin diff --git a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3dmain.cpp b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3dmain.cpp deleted file mode 100644 index b0f1934a8..000000000 --- a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3dmain.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2018 - * swift Project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \cond PRIVATE_TESTS -//! \file -//! \ingroup testplugins - -#include "testblacksimpluginfsxp3dmain.h" -#include "testfsxp3dcommon.h" -#include "testsimconnectsymbols.h" -#include "blackmisc/test/test.h" -#include -#include - -namespace BlackSimPluginFsxP3D -{ - int CBlackSimPluginFsxP3DTest::unitMain(int argc, char *argv[]) - { - BlackMisc::Test::CTest test(argc, argv); - - int status = 0; - { - CTestSimconnectSymbols simconnectSymbolsTest; - status |= test.exec(&simconnectSymbolsTest, "blacksimpluginfsxp3d_simconnectsymbols"); - - CTestFsxP3DCommon commonTest; - status |= test.exec(&commonTest, "blacksimpluginfsxp3d_fsxp3dcommon"); - } - return status; - } -} // namespace - -//! \endcond diff --git a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3dmain.h b/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3dmain.h deleted file mode 100644 index 7b1df8284..000000000 --- a/tests/blacksimpluginfsxp3d/testblacksimpluginfsxp3dmain.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 2018 - * swift project community / contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -#ifndef BLACKSIMPLUGINFSXP3D_TESTMAIN_H -#define BLACKSIMPLUGINFSXP3D_TESTMAIN_H - -//! \cond PRIVATE_TESTS -//! \file -//! \ingroup testplugins - -namespace BlackSimPluginFsxP3D -{ - /*! - * Class firing all unit tests in this namespace. - * Avoids clashes with other main(..) functions and allows to fire the test cases - * simply from any other main. - */ - class CBlackSimPluginFsxP3DTest - { - public: - //! Starting all - static int unitMain(int argc, char *argv[]); - }; -} // ns - -//! \endcond - -#endif // guard diff --git a/tests/blacksimpluginfsxp3d/testfsxp3dcommon.cpp b/tests/blacksimpluginfsxp3d/testfsxp3dcommon.cpp index f76f01ef2..cd4b2b925 100644 --- a/tests/blacksimpluginfsxp3d/testfsxp3dcommon.cpp +++ b/tests/blacksimpluginfsxp3d/testfsxp3dcommon.cpp @@ -16,6 +16,7 @@ #include "testfsxp3dcommon.h" #include "plugins/simulator/fsxcommon/simconnectdatadefinition.h" +#include "plugins/simulator/fsxcommon/simconnectsymbols.h" #include "plugins/simulator/fsxcommon/simulatorfsxcommon.h" #include @@ -23,6 +24,14 @@ using namespace BlackSimPlugin::FsxCommon; namespace BlackSimPluginFsxP3D { + void CTestFsxP3DCommon::resolveSymbols() + { + QVERIFY2(loadAndResolveSimConnect(false), "Could not load and resolve SimConnect library!"); + HANDLE hSimConnect; + SimConnect_Open(&hSimConnect, "Test", nullptr, 0, nullptr, 0); + SimConnect_Close(hSimConnect); + } + void CTestFsxP3DCommon::requestIds() { DWORD objectId = 666; @@ -61,4 +70,7 @@ namespace BlackSimPluginFsxP3D } } // ns +//! main +BLACKTEST_APPLESS_MAIN(BlackSimPluginFsxP3D::CTestFsxP3DCommon); + //! \endcond diff --git a/tests/blacksimpluginfsxp3d/testfsxp3dcommon.h b/tests/blacksimpluginfsxp3d/testfsxp3dcommon.h index 242069a44..0c5136acb 100644 --- a/tests/blacksimpluginfsxp3d/testfsxp3dcommon.h +++ b/tests/blacksimpluginfsxp3d/testfsxp3dcommon.h @@ -14,6 +14,7 @@ //! \file //! \ingroup testblacksimplugin +#include "test.h" #include namespace BlackSimPluginFsxP3D @@ -28,6 +29,9 @@ namespace BlackSimPluginFsxP3D explicit CTestFsxP3DCommon(QObject *parent = nullptr) : QObject(parent) {} private slots: + //! Resolve SimConnect Symbols + void resolveSymbols(); + //! Request IDs void requestIds(); }; diff --git a/tests/blacksimpluginfsxp3d/testsimconnectsymbols.cpp b/tests/blacksimpluginfsxp3d/testsimconnectsymbols.cpp deleted file mode 100644 index 40f2a2f81..000000000 --- a/tests/blacksimpluginfsxp3d/testsimconnectsymbols.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 2018 - * swift Project Community / Contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -//! \cond PRIVATE_TESTS - -/*! - * \file - * \ingroup testblacksimplugin - */ - -#include "testsimconnectsymbols.h" -#include "plugins/simulator/fsxcommon/simconnectsymbols.h" -#include "plugins/simulator/fsxcommon/simconnectwindows.h" -#include - -namespace BlackSimPluginFsxP3D -{ - void CTestSimconnectSymbols::resolveSymbols() - { - QVERIFY2(loadAndResolveSimConnect(false), "Could not load and resolve SimConnect library!"); - HANDLE hSimConnect; - SimConnect_Open(&hSimConnect, "Test", nullptr, 0, 0, 0); - SimConnect_Close(hSimConnect); - } - -} // ns - -//! \endcond diff --git a/tests/blacksimpluginfsxp3d/testsimconnectsymbols.h b/tests/blacksimpluginfsxp3d/testsimconnectsymbols.h deleted file mode 100644 index 54deac3eb..000000000 --- a/tests/blacksimpluginfsxp3d/testsimconnectsymbols.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2018 - * swift project community / contributors - * - * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -#ifndef BLACKSIMPLUGINFSXP3D_TESTSIMCONNECTSYMBOLS_H -#define BLACKSIMPLUGINFSXP3D_TESTSIMCONNECTSYMBOLS_H - -//! \cond PRIVATE_TESTS -//! \file -//! \ingroup testblacksimplugin - -#include - -namespace BlackSimPluginFsxP3D -{ - //! FSX/P3D common tests - class CTestSimconnectSymbols : public QObject - { - Q_OBJECT - - public: - //! Standard test case constructor - explicit CTestSimconnectSymbols(QObject *parent = nullptr) : QObject(parent) {} - - private slots: - //! Resolve SimConnect Symbols - void resolveSymbols(); - }; -} // namespace - -//! \endcond - -#endif // guard diff --git a/tests/test.h b/tests/test.h index fe72a22c4..39f7b1397 100644 --- a/tests/test.h +++ b/tests/test.h @@ -64,7 +64,6 @@ int main(int argc, char *argv[]) \ return QTest::qExec(&to, args); \ } - //! \endcond #endif // guard