forked from qt-creator/qt-creator
Valgrind: Make tests not crash
Change-Id: I038fc59e87a5e05d325899d02eb67366dc65ce67 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -33,6 +33,9 @@
|
||||
#include <valgrind/xmlprotocol/stack.h>
|
||||
#include <valgrind/xmlprotocol/suppression.h>
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include "parsertests.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
@@ -101,6 +104,8 @@ static QString dataFile(const QLatin1String &file)
|
||||
|
||||
void ParserTests::initTestCase()
|
||||
{
|
||||
new ExtensionSystem::PluginManager;
|
||||
new ProjectExplorer::ProjectExplorerPlugin;
|
||||
m_server = new QTcpServer(this);
|
||||
QVERIFY(m_server->listen());
|
||||
|
||||
|
||||
@@ -103,8 +103,6 @@ public:
|
||||
this, SLOT(internalError(QString)));
|
||||
connect(parser, SIGNAL(status(Valgrind::XmlProtocol::Status)),
|
||||
this, SLOT(status(Valgrind::XmlProtocol::Status)));
|
||||
connect(runner, SIGNAL(processOutputReceived(QByteArray,Utils::OutputFormat)),
|
||||
this, SLOT(handleProcessOutput(QByteArray,Utils::OutputFormat)));
|
||||
connect(runner, SIGNAL(logMessageReceived(QByteArray)),
|
||||
this, SLOT(logMessageReceived(QByteArray)));
|
||||
connect(runner, SIGNAL(processErrorReceived(QString, QProcess::ProcessError)),
|
||||
@@ -121,10 +119,6 @@ public slots:
|
||||
{
|
||||
qDebug() << "internal error received:" << error;
|
||||
}
|
||||
void handleProcessOutput(const QByteArray &out, Utils::OutputFormat format)
|
||||
{
|
||||
qDebug() << "Output received:" << format << out;
|
||||
}
|
||||
void status(const Valgrind::XmlProtocol::Status &status)
|
||||
{
|
||||
qDebug() << "status received:" << status.state() << status.time();
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <valgrind/xmlprotocol/parser.h>
|
||||
#include <valgrind/memcheck/memcheckrunner.h>
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTest>
|
||||
#include <QDir>
|
||||
@@ -118,6 +121,12 @@ void TestRunner::cleanup()
|
||||
m_expectCrash = false;
|
||||
}
|
||||
|
||||
void TestRunner::initTestCase()
|
||||
{
|
||||
new ExtensionSystem::PluginManager;
|
||||
new ProjectExplorer::ProjectExplorerPlugin;
|
||||
}
|
||||
|
||||
void TestRunner::init()
|
||||
{
|
||||
Q_ASSERT(m_logMessages.isEmpty());
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
explicit TestRunner(QObject *parent = 0);
|
||||
|
||||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user