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
|
baremetaldeviceconfigurationwidget.cpp baremetaldeviceconfigurationwidget.h
|
||||||
baremetaldeviceconfigurationwizard.cpp baremetaldeviceconfigurationwizard.h
|
baremetaldeviceconfigurationwizard.cpp baremetaldeviceconfigurationwizard.h
|
||||||
baremetaldeviceconfigurationwizardpages.cpp baremetaldeviceconfigurationwizardpages.h
|
baremetaldeviceconfigurationwizardpages.cpp baremetaldeviceconfigurationwizardpages.h
|
||||||
baremetalplugin.cpp baremetalplugin.h
|
baremetalplugin.cpp
|
||||||
baremetalrunconfiguration.cpp baremetalrunconfiguration.h
|
baremetalrunconfiguration.cpp baremetalrunconfiguration.h
|
||||||
baremetaltr.h
|
baremetaltr.h
|
||||||
debugserverproviderchooser.cpp debugserverproviderchooser.h
|
debugserverproviderchooser.cpp debugserverproviderchooser.h
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ QtcPlugin {
|
|||||||
"baremetaldeviceconfigurationwidget.cpp", "baremetaldeviceconfigurationwidget.h",
|
"baremetaldeviceconfigurationwidget.cpp", "baremetaldeviceconfigurationwidget.h",
|
||||||
"baremetaldeviceconfigurationwizard.cpp", "baremetaldeviceconfigurationwizard.h",
|
"baremetaldeviceconfigurationwizard.cpp", "baremetaldeviceconfigurationwizard.h",
|
||||||
"baremetaldeviceconfigurationwizardpages.cpp", "baremetaldeviceconfigurationwizardpages.h",
|
"baremetaldeviceconfigurationwizardpages.cpp", "baremetaldeviceconfigurationwizardpages.h",
|
||||||
"baremetalplugin.cpp", "baremetalplugin.h",
|
"baremetalplugin.cpp",
|
||||||
"baremetalrunconfiguration.cpp", "baremetalrunconfiguration.h",
|
"baremetalrunconfiguration.cpp", "baremetalrunconfiguration.h",
|
||||||
"baremetaltr.h",
|
"baremetaltr.h",
|
||||||
"debugserverproviderchooser.cpp", "debugserverproviderchooser.h",
|
"debugserverproviderchooser.cpp", "debugserverproviderchooser.h",
|
||||||
|
|||||||
@@ -2,37 +2,52 @@
|
|||||||
// Copyright (C) 2016 Denis Shienkov <denis.shienkov@gmail.com>
|
// 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
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "baremetalplugin.h"
|
|
||||||
|
|
||||||
#include "baremetaldebugsupport.h"
|
#include "baremetaldebugsupport.h"
|
||||||
#include "baremetaldevice.h"
|
#include "baremetaldevice.h"
|
||||||
#include "baremetalrunconfiguration.h"
|
#include "baremetalrunconfiguration.h"
|
||||||
|
|
||||||
#include "debugserverprovidermanager.h"
|
#include "debugserverprovidermanager.h"
|
||||||
|
|
||||||
|
#include "iarewparser.h"
|
||||||
#include "iarewtoolchain.h"
|
#include "iarewtoolchain.h"
|
||||||
|
#include "keilparser.h"
|
||||||
#include "keiltoolchain.h"
|
#include "keiltoolchain.h"
|
||||||
|
#include "sdccparser.h"
|
||||||
#include "sdcctoolchain.h"
|
#include "sdcctoolchain.h"
|
||||||
|
|
||||||
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace BareMetal::Internal {
|
namespace BareMetal::Internal {
|
||||||
|
|
||||||
// BareMetalPlugin
|
class BareMetalPlugin final : public ExtensionSystem::IPlugin
|
||||||
|
|
||||||
void BareMetalPlugin::initialize()
|
|
||||||
{
|
{
|
||||||
setupBareMetalDevice();
|
Q_OBJECT
|
||||||
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "BareMetal.json")
|
||||||
|
|
||||||
setupIarToolChain();
|
void initialize() final
|
||||||
setupKeilToolChain();
|
{
|
||||||
setupSdccToolChain();
|
setupBareMetalDevice();
|
||||||
|
|
||||||
setupBareMetalDeployAndRunConfigurations();
|
setupIarToolChain();
|
||||||
setupBareMetalDebugSupport();
|
setupKeilToolChain();
|
||||||
}
|
setupSdccToolChain();
|
||||||
|
|
||||||
void BareMetalPlugin::extensionsInitialized()
|
setupBareMetalDeployAndRunConfigurations();
|
||||||
{
|
setupBareMetalDebugSupport();
|
||||||
setupDebugServerProviderManager(this);
|
|
||||||
}
|
#ifdef WITH_TESTS
|
||||||
|
addTest<IarParserTest>();
|
||||||
|
addTest<KeilParserTest>();
|
||||||
|
addTest<SdccParserTest>();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void extensionsInitialized() final
|
||||||
|
{
|
||||||
|
setupDebugServerProviderManager(this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // BareMetal::Internal
|
} // 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:
|
// Unit tests:
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
#include "baremetalplugin.h"
|
|
||||||
#include <projectexplorer/outputparser_test.h>
|
#include <projectexplorer/outputparser_test.h>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
namespace BareMetal {
|
namespace BareMetal::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
void BareMetalPlugin::testIarOutputParsers_data()
|
void IarParserTest::testIarOutputParsers_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QString>("input");
|
QTest::addColumn<QString>("input");
|
||||||
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
||||||
@@ -392,7 +390,7 @@ void BareMetalPlugin::testIarOutputParsers_data()
|
|||||||
<< QString();
|
<< QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BareMetalPlugin::testIarOutputParsers()
|
void IarParserTest::testIarOutputParsers()
|
||||||
{
|
{
|
||||||
OutputParserTester testbench;
|
OutputParserTester testbench;
|
||||||
testbench.addLineParser(new IarParser);
|
testbench.addLineParser(new IarParser);
|
||||||
@@ -408,7 +406,6 @@ void BareMetalPlugin::testIarOutputParsers()
|
|||||||
outputLines);
|
outputLines);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // BareMetal::Internal
|
||||||
} // namespace BareMetal
|
|
||||||
|
|
||||||
#endif // WITH_TESTS
|
#endif // WITH_TESTS
|
||||||
|
|||||||
@@ -38,4 +38,15 @@ private:
|
|||||||
QStringList m_descriptionParts;
|
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
|
} // BareMetal::Internal
|
||||||
|
|||||||
@@ -247,13 +247,13 @@ void KeilParser::flush()
|
|||||||
// Unit tests:
|
// Unit tests:
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
#include "baremetalplugin.h"
|
|
||||||
#include <projectexplorer/outputparser_test.h>
|
#include <projectexplorer/outputparser_test.h>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
namespace BareMetal::Internal {
|
namespace BareMetal::Internal {
|
||||||
|
|
||||||
void BareMetalPlugin::testKeilOutputParsers_data()
|
void KeilParserTest::testKeilOutputParsers_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QString>("input");
|
QTest::addColumn<QString>("input");
|
||||||
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
||||||
@@ -504,7 +504,7 @@ void BareMetalPlugin::testKeilOutputParsers_data()
|
|||||||
<< QString();
|
<< QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BareMetalPlugin::testKeilOutputParsers()
|
void KeilParserTest::testKeilOutputParsers()
|
||||||
{
|
{
|
||||||
OutputParserTester testbench;
|
OutputParserTester testbench;
|
||||||
testbench.addLineParser(new KeilParser);
|
testbench.addLineParser(new KeilParser);
|
||||||
|
|||||||
@@ -35,4 +35,15 @@ private:
|
|||||||
QStringList m_snippets;
|
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
|
} // BareMetal::Internal
|
||||||
|
|||||||
@@ -141,13 +141,12 @@ void SdccParser::flush()
|
|||||||
// Unit tests:
|
// Unit tests:
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
#include "baremetalplugin.h"
|
|
||||||
#include <projectexplorer/outputparser_test.h>
|
#include <projectexplorer/outputparser_test.h>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
namespace BareMetal::Internal {
|
namespace BareMetal::Internal {
|
||||||
|
|
||||||
void BareMetalPlugin::testSdccOutputParsers_data()
|
void SdccParserTest::testSdccOutputParsers_data()
|
||||||
{
|
{
|
||||||
QTest::addColumn<QString>("input");
|
QTest::addColumn<QString>("input");
|
||||||
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
QTest::addColumn<OutputParserTester::Channel>("inputChannel");
|
||||||
@@ -291,7 +290,7 @@ void BareMetalPlugin::testSdccOutputParsers_data()
|
|||||||
<< QString();
|
<< QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BareMetalPlugin::testSdccOutputParsers()
|
void SdccParserTest::testSdccOutputParsers()
|
||||||
{
|
{
|
||||||
OutputParserTester testbench;
|
OutputParserTester testbench;
|
||||||
testbench.addLineParser(new SdccParser);
|
testbench.addLineParser(new SdccParser);
|
||||||
|
|||||||
@@ -25,4 +25,15 @@ private:
|
|||||||
int m_lines = 0;
|
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
|
} // BareMetal::Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user