forked from qt-creator/qt-creator
BareMetal: Dissolve baremetalplugin.h
Split test so they can be closer to the implementation, move rest to plugin.cpp. Change-Id: I30310f5b2658ac669d219c2978c6a3d6c9d8b107 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -8,7 +8,7 @@ add_qtc_plugin(BareMetal
|
||||
baremetaldeviceconfigurationwidget.cpp baremetaldeviceconfigurationwidget.h
|
||||
baremetaldeviceconfigurationwizard.cpp baremetaldeviceconfigurationwizard.h
|
||||
baremetaldeviceconfigurationwizardpages.cpp baremetaldeviceconfigurationwizardpages.h
|
||||
baremetalplugin.cpp baremetalplugin.h
|
||||
baremetalplugin.cpp
|
||||
baremetalrunconfiguration.cpp baremetalrunconfiguration.h
|
||||
baremetaltr.h
|
||||
debugserverproviderchooser.cpp debugserverproviderchooser.h
|
||||
|
||||
@@ -22,7 +22,7 @@ QtcPlugin {
|
||||
"baremetaldeviceconfigurationwidget.cpp", "baremetaldeviceconfigurationwidget.h",
|
||||
"baremetaldeviceconfigurationwizard.cpp", "baremetaldeviceconfigurationwizard.h",
|
||||
"baremetaldeviceconfigurationwizardpages.cpp", "baremetaldeviceconfigurationwizardpages.h",
|
||||
"baremetalplugin.cpp", "baremetalplugin.h",
|
||||
"baremetalplugin.cpp",
|
||||
"baremetalrunconfiguration.cpp", "baremetalrunconfiguration.h",
|
||||
"baremetaltr.h",
|
||||
"debugserverproviderchooser.cpp", "debugserverproviderchooser.h",
|
||||
|
||||
@@ -2,23 +2,29 @@
|
||||
// Copyright (C) 2016 Denis Shienkov <denis.shienkov@gmail.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "baremetalplugin.h"
|
||||
|
||||
#include "baremetaldebugsupport.h"
|
||||
#include "baremetaldevice.h"
|
||||
#include "baremetalrunconfiguration.h"
|
||||
|
||||
#include "debugserverprovidermanager.h"
|
||||
|
||||
#include "iarewparser.h"
|
||||
#include "iarewtoolchain.h"
|
||||
#include "keilparser.h"
|
||||
#include "keiltoolchain.h"
|
||||
#include "sdccparser.h"
|
||||
#include "sdcctoolchain.h"
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
namespace BareMetal::Internal {
|
||||
|
||||
// BareMetalPlugin
|
||||
class BareMetalPlugin final : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "BareMetal.json")
|
||||
|
||||
void BareMetalPlugin::initialize()
|
||||
void initialize() final
|
||||
{
|
||||
setupBareMetalDevice();
|
||||
|
||||
@@ -28,11 +34,20 @@ void BareMetalPlugin::initialize()
|
||||
|
||||
setupBareMetalDeployAndRunConfigurations();
|
||||
setupBareMetalDebugSupport();
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
addTest<IarParserTest>();
|
||||
addTest<KeilParserTest>();
|
||||
addTest<SdccParserTest>();
|
||||
#endif
|
||||
}
|
||||
|
||||
void BareMetalPlugin::extensionsInitialized()
|
||||
void extensionsInitialized() final
|
||||
{
|
||||
setupDebugServerProviderManager(this);
|
||||
}
|
||||
};
|
||||
|
||||
} // BareMetal::Internal
|
||||
|
||||
#include "baremetalplugin.moc"
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
// Copyright (C) 2016 Tim Sander <tim@krieglstein.org>
|
||||
// Copyright (C) 2016 Denis Shienkov <denis.shienkov@gmail.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
namespace BareMetal::Internal {
|
||||
|
||||
class BareMetalPlugin final : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "BareMetal.json")
|
||||
|
||||
void initialize() final;
|
||||
void extensionsInitialized() final;
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
private slots:
|
||||
void testIarOutputParsers_data();
|
||||
void testIarOutputParsers();
|
||||
void testKeilOutputParsers_data();
|
||||
void testKeilOutputParsers();
|
||||
void testSdccOutputParsers_data();
|
||||
void testSdccOutputParsers();
|
||||
#endif // WITH_TESTS
|
||||
};
|
||||
|
||||
} // BareMetal::Internal
|
||||
@@ -226,14 +226,12 @@ void IarParser::flush()
|
||||
// Unit tests:
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
#include "baremetalplugin.h"
|
||||
#include <projectexplorer/outputparser_test.h>
|
||||
#include <QTest>
|
||||
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
namespace BareMetal::Internal {
|
||||
|
||||
void BareMetalPlugin::testIarOutputParsers_data()
|
||||
void IarParserTest::testIarOutputParsers_data()
|
||||
{
|
||||
QTest::addColumn<QString>("input");
|
||||
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
||||
@@ -392,7 +390,7 @@ void BareMetalPlugin::testIarOutputParsers_data()
|
||||
<< QString();
|
||||
}
|
||||
|
||||
void BareMetalPlugin::testIarOutputParsers()
|
||||
void IarParserTest::testIarOutputParsers()
|
||||
{
|
||||
OutputParserTester testbench;
|
||||
testbench.addLineParser(new IarParser);
|
||||
@@ -408,7 +406,6 @@ void BareMetalPlugin::testIarOutputParsers()
|
||||
outputLines);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace BareMetal
|
||||
} // BareMetal::Internal
|
||||
|
||||
#endif // WITH_TESTS
|
||||
|
||||
@@ -38,4 +38,15 @@ private:
|
||||
QStringList m_descriptionParts;
|
||||
};
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
class IarParserTest final : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void testIarOutputParsers_data();
|
||||
void testIarOutputParsers();
|
||||
};
|
||||
#endif // WITH_TESTS
|
||||
|
||||
} // BareMetal::Internal
|
||||
|
||||
@@ -247,13 +247,13 @@ void KeilParser::flush()
|
||||
// Unit tests:
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
#include "baremetalplugin.h"
|
||||
|
||||
#include <projectexplorer/outputparser_test.h>
|
||||
#include <QTest>
|
||||
|
||||
namespace BareMetal::Internal {
|
||||
|
||||
void BareMetalPlugin::testKeilOutputParsers_data()
|
||||
void KeilParserTest::testKeilOutputParsers_data()
|
||||
{
|
||||
QTest::addColumn<QString>("input");
|
||||
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
||||
@@ -504,7 +504,7 @@ void BareMetalPlugin::testKeilOutputParsers_data()
|
||||
<< QString();
|
||||
}
|
||||
|
||||
void BareMetalPlugin::testKeilOutputParsers()
|
||||
void KeilParserTest::testKeilOutputParsers()
|
||||
{
|
||||
OutputParserTester testbench;
|
||||
testbench.addLineParser(new KeilParser);
|
||||
|
||||
@@ -35,4 +35,15 @@ private:
|
||||
QStringList m_snippets;
|
||||
};
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
class KeilParserTest final : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void testKeilOutputParsers_data();
|
||||
void testKeilOutputParsers();
|
||||
};
|
||||
#endif // WITH_TESTS
|
||||
|
||||
} // BareMetal::Internal
|
||||
|
||||
@@ -141,13 +141,12 @@ void SdccParser::flush()
|
||||
// Unit tests:
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
#include "baremetalplugin.h"
|
||||
#include <projectexplorer/outputparser_test.h>
|
||||
#include <QTest>
|
||||
|
||||
namespace BareMetal::Internal {
|
||||
|
||||
void BareMetalPlugin::testSdccOutputParsers_data()
|
||||
void SdccParserTest::testSdccOutputParsers_data()
|
||||
{
|
||||
QTest::addColumn<QString>("input");
|
||||
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
||||
@@ -291,7 +290,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
|
||||
<< QString();
|
||||
}
|
||||
|
||||
void BareMetalPlugin::testSdccOutputParsers()
|
||||
void SdccParserTest::testSdccOutputParsers()
|
||||
{
|
||||
OutputParserTester testbench;
|
||||
testbench.addLineParser(new SdccParser);
|
||||
|
||||
@@ -25,4 +25,15 @@ private:
|
||||
int m_lines = 0;
|
||||
};
|
||||
|
||||
#ifdef WITH_TESTS
|
||||
class SdccParserTest final : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void testSdccOutputParsers_data();
|
||||
void testSdccOutputParsers();
|
||||
};
|
||||
#endif // WITH_TESTS
|
||||
|
||||
} // BareMetal::Internal
|
||||
|
||||
Reference in New Issue
Block a user