2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2010-03-03 18:05:37 +01:00
|
|
|
|
2016-02-02 18:26:51 +01:00
|
|
|
#pragma once
|
2010-03-03 18:05:37 +01:00
|
|
|
|
2024-01-17 14:10:27 +01:00
|
|
|
#ifdef WITH_TESTS
|
2010-03-29 17:59:27 +02:00
|
|
|
|
2010-03-03 18:05:37 +01:00
|
|
|
#include "projectexplorer_export.h"
|
2013-05-03 16:02:53 +02:00
|
|
|
|
|
|
|
|
#include "task.h"
|
2010-03-03 18:05:37 +01:00
|
|
|
|
2024-01-17 14:10:27 +01:00
|
|
|
#include <utils/outputformatter.h>
|
|
|
|
|
|
2010-03-03 18:05:37 +01:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
2013-05-03 16:02:53 +02:00
|
|
|
class TestTerminator;
|
|
|
|
|
|
2020-04-16 13:53:05 +02:00
|
|
|
class PROJECTEXPLORER_EXPORT OutputParserTester : public Utils::OutputFormatter
|
2010-03-03 18:05:37 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum Channel {
|
|
|
|
|
STDOUT,
|
|
|
|
|
STDERR
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-07 13:49:34 +02:00
|
|
|
OutputParserTester();
|
2020-04-16 13:53:05 +02:00
|
|
|
~OutputParserTester();
|
2020-04-07 13:49:34 +02:00
|
|
|
|
2013-10-07 13:34:40 +02:00
|
|
|
// test functions:
|
2010-03-03 18:05:37 +01:00
|
|
|
void testParsing(const QString &lines, Channel inputChannel,
|
2019-05-27 16:09:44 +02:00
|
|
|
Tasks tasks,
|
2010-03-03 18:05:37 +01:00
|
|
|
const QString &childStdOutLines,
|
|
|
|
|
const QString &childStdErrLines,
|
|
|
|
|
const QString &outputLines);
|
|
|
|
|
|
|
|
|
|
void setDebugEnabled(bool);
|
|
|
|
|
|
2010-09-02 16:42:19 +02:00
|
|
|
signals:
|
|
|
|
|
void aboutToDeleteParser();
|
|
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2010-03-03 18:05:37 +01:00
|
|
|
void reset();
|
|
|
|
|
|
2018-06-14 20:57:35 +02:00
|
|
|
bool m_debug = false;
|
2010-03-03 18:05:37 +01:00
|
|
|
|
|
|
|
|
QString m_receivedStdErrChildLine;
|
|
|
|
|
QString m_receivedStdOutChildLine;
|
2019-05-27 16:09:44 +02:00
|
|
|
Tasks m_receivedTasks;
|
2010-03-03 18:05:37 +01:00
|
|
|
QString m_receivedOutput;
|
2013-05-03 16:02:53 +02:00
|
|
|
|
|
|
|
|
friend class TestTerminator;
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-17 14:10:27 +01:00
|
|
|
QObject *createOutputParserTest();
|
2010-03-03 18:05:37 +01:00
|
|
|
|
|
|
|
|
} // namespace ProjectExplorer
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(ProjectExplorer::OutputParserTester::Channel)
|
|
|
|
|
|
2010-03-29 17:59:27 +02:00
|
|
|
#endif
|