aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/squish/squishxmloutputhandler.h
blob: dfe6634199f191598526a7f7fdd91d47087b6a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (C) 2022 The Qt Company Ltd
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0

#pragma once

#include <utils/fileutils.h>

#include <QObject>
#include <QXmlStreamReader>

namespace Squish {
namespace Internal {

class SquishResultItem;

class SquishXmlOutputHandler : public QObject
{
    Q_OBJECT
public:
    explicit SquishXmlOutputHandler(QObject *parent = nullptr);
    void clearForNextRun();

    static void mergeResultFiles(const Utils::FilePaths &reportFiles,
                                 const Utils::FilePath &resultsDirectory,
                                 const QString &suiteName,
                                 QString *error = nullptr);

signals:
    void resultItemCreated(SquishResultItem *resultItem);
    void updateStatus(const QString &text);
    void increasePassCounter();
    void increaseFailCounter();

public slots:
    void outputAvailable(const QByteArray &output);

private:
    QXmlStreamReader m_xmlReader;
};

} // namespace Internal
} // namespace Squish