2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2017-06-21 08:08:43 +02:00
|
|
|
#include "xmlprotocol/error.h"
|
|
|
|
|
|
2011-03-04 12:15:18 +01:00
|
|
|
#include <QObject>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
|
|
namespace Valgrind {
|
|
|
|
|
|
2017-06-21 08:08:43 +02:00
|
|
|
class ValgrindRunner;
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-12-06 12:05:05 +01:00
|
|
|
namespace Test {
|
|
|
|
|
|
|
|
|
|
class ValgrindTestRunnerTest : public QObject
|
2011-03-04 12:15:18 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-12-10 08:11:18 +01:00
|
|
|
explicit ValgrindTestRunnerTest(QObject *parent = nullptr);
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-12-06 12:05:05 +01:00
|
|
|
private slots:
|
2011-03-04 12:15:18 +01:00
|
|
|
void init();
|
|
|
|
|
void cleanup();
|
|
|
|
|
|
|
|
|
|
void testLeak1();
|
|
|
|
|
void testLeak2();
|
|
|
|
|
void testLeak3();
|
|
|
|
|
void testLeak4();
|
|
|
|
|
|
2016-12-06 12:05:05 +01:00
|
|
|
void testUninit1();
|
|
|
|
|
void testUninit2();
|
|
|
|
|
void testUninit3();
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-12-06 12:05:05 +01:00
|
|
|
void testFree1();
|
|
|
|
|
void testFree2();
|
2011-03-04 12:15:18 +01:00
|
|
|
|
2016-12-06 12:05:05 +01:00
|
|
|
void testInvalidjump();
|
|
|
|
|
void testSyscall();
|
|
|
|
|
void testOverlap();
|
2011-03-04 12:15:18 +01:00
|
|
|
|
|
|
|
|
void logMessageReceived(const QByteArray &message);
|
|
|
|
|
void internalError(const QString &error);
|
|
|
|
|
void error(const Valgrind::XmlProtocol::Error &error);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString runTestBinary(const QString &binary, const QStringList &vArgs = QStringList());
|
|
|
|
|
|
2017-06-21 08:08:43 +02:00
|
|
|
ValgrindRunner *m_runner = nullptr;
|
2011-03-04 12:15:18 +01:00
|
|
|
QList<QByteArray> m_logMessages;
|
|
|
|
|
QList<XmlProtocol::Error> m_errors;
|
2016-12-06 12:05:05 +01:00
|
|
|
bool m_expectCrash = false;
|
2011-03-04 12:15:18 +01:00
|
|
|
};
|
|
|
|
|
|
2016-12-06 12:05:05 +01:00
|
|
|
} // namespace Test
|
2011-03-04 12:15:18 +01:00
|
|
|
} // namespace Valgrind
|