Commit 50499079 authored by hjk's avatar hjk
Browse files

Valgrind: Fix test compilation



Change-Id: I1b64cab7326830cec86b9b5154e9efb6d0ea8569
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 403fe30a
......@@ -30,6 +30,7 @@
#include <valgrind/xmlprotocol/suppression.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/runnables.h>
#include <extensionsystem/pluginmanager.h>
#include "parsertests.h"
......@@ -466,9 +467,12 @@ void ParserTests::testRealValgrind()
qDebug() << "running exe:" << executable << " HINT: set VALGRIND_TEST_BIN to change this";
ThreadedParser parser;
ProjectExplorer::StandardRunnable debuggee;
debuggee.executable = executable;
Memcheck::MemcheckRunner runner;
runner.setValgrindExecutable(QLatin1String("valgrind"));
runner.setDebuggeeExecutable(executable);
runner.setDebuggee(debuggee);
runner.setParser(&parser);
RunnerDumper dumper(&runner, &parser);
runner.start();
......@@ -497,17 +501,20 @@ void ParserTests::testValgrindStartError()
{
QFETCH(QString, valgrindExe);
QFETCH(QStringList, valgrindArgs);
QFETCH(QString, debuggee);
QFETCH(QString, debuggeeExecutable);
QFETCH(QString, debuggeeArgs);
ThreadedParser parser;
ProjectExplorer::StandardRunnable debuggee;
debuggee.executable = debuggeeExecutable;
debuggee.commandLineArguments = debuggeeArgs;
Memcheck::MemcheckRunner runner;
runner.setParser(&parser);
runner.setValgrindExecutable(valgrindExe);
runner.setValgrindArguments(valgrindArgs);
runner.setDebuggeeExecutable(debuggee);
runner.setDebuggeeArguments(debuggeeArgs);
runner.setDebuggee(debuggee);
RunnerDumper dumper(&runner, &parser);
runner.start();
runner.waitForFinished();
......
......@@ -34,6 +34,7 @@
#include <valgrind/memcheck/memcheckrunner.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/runnables.h>
#include <extensionsystem/pluginmanager.h>
#include <QDebug>
......@@ -77,8 +78,10 @@ QString TestRunner::runTestBinary(const QString &binary, const QStringList &vArg
const QString binPath = appBinDir + QLatin1Char('/') + binary;
if (!QFileInfo(binPath).isExecutable())
qFatal("No such test app: %s", qPrintable(binPath));
ProjectExplorer::StandardRunnable debuggee;
debuggee.executable = binPath;
m_runner->setValgrindArguments(QStringList() << "--num-callers=50" << "--track-origins=yes" << vArgs);
m_runner->setDebuggeeExecutable(binPath);
m_runner->setDebuggee(debuggee);
m_runner->start();
m_runner->waitForFinished();
return binPath;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment