testinfo.h 3.81 KB
Newer Older
Christian Stenger's avatar
Christian Stenger committed
1
2
/****************************************************************************
**
Christian Stenger's avatar
Christian Stenger committed
3
4
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
Christian Stenger's avatar
Christian Stenger committed
5
**
Christian Stenger's avatar
Christian Stenger committed
6
** This file is part of Qt Creator.
Christian Stenger's avatar
Christian Stenger committed
7
**
Christian Stenger's avatar
Christian Stenger committed
8
9
10
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
Christian Stenger's avatar
Christian Stenger committed
11
** Software or, alternatively, in accordance with the terms contained in
Christian Stenger's avatar
Christian Stenger committed
12
13
14
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
Christian Stenger's avatar
Christian Stenger committed
15
**
Christian Stenger's avatar
Christian Stenger committed
16
17
18
19
20
21
22
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
Christian Stenger's avatar
Christian Stenger committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
**
****************************************************************************/

#ifndef TESTINFO_H
#define TESTINFO_H

#include <QStringList>

namespace Autotest {
namespace Internal {

class TestInfo
{
public:
37
38
    explicit TestInfo(const QString &className = QString(),
                      const QStringList &functions = QStringList(),
Christian Stenger's avatar
Christian Stenger committed
39
40
                      unsigned revision = 0, unsigned editorRevision = 0);

41
    ~TestInfo();
Christian Stenger's avatar
Christian Stenger committed
42
43
44
45
46
47
48
49
    const QString testClass() const { return m_className; }
    void setTestClass(const QString &className) { m_className = className; }
    const QStringList testFunctions() const { return m_functions; }
    void setTestFunctions(const QStringList &functions) { m_functions = functions; }
    unsigned revision() const { return m_revision; }
    void setRevision(unsigned revision) { m_revision = revision; }
    unsigned editorRevision() const { return m_editorRevision; }
    void setEditorRevision(unsigned editorRevision) { m_editorRevision = editorRevision; }
50
    const QString referencingFile() const { return m_referencingFile; }
51
52
    void setReferencingFile(const QString &refFile) { m_referencingFile = refFile; }
    const QString proFile() const { return m_proFile; }
53
    void setProFile(const QString &proFile) { m_proFile = proFile; }
Christian Stenger's avatar
Christian Stenger committed
54
55
56
57
58
59

private:
    QString m_className;
    QStringList m_functions;
    unsigned m_revision;
    unsigned m_editorRevision;
60
    QString m_referencingFile;
61
    QString m_proFile;
Christian Stenger's avatar
Christian Stenger committed
62
63
};

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
class UnnamedQuickTestInfo {
public:
    explicit UnnamedQuickTestInfo(const QString &function = QString(),
                                  const QString& fileName = QString());
    ~UnnamedQuickTestInfo() {}

    const QString function() const { return m_function; }
    void setFunction(const QString &function) { m_function = function; }
    const QString fileName() const { return m_fileName; }
    void setFileName(const QString &fileName) { m_fileName = fileName; }

private:
    QString m_function;
    QString m_fileName;
};

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class GTestInfo {
public:
    explicit GTestInfo(const QString &caseName, const QString &setName, const QString &file);

    const QString caseName() const { return m_caseName; }
    void setCaseName(const QString &caseName) { m_caseName = caseName; }
    const QString setName() const { return m_setName; }
    void setSetName(const QString &setName) { m_setName = setName; }
    const QString fileName() const { return m_fileName; }
    void setFileName(const QString &fileName) { m_fileName = fileName; }
    bool isEnabled() const { return m_enabled; }
    void setEnabled(bool enabled) { m_enabled = enabled; }

private:
    QString m_caseName;
    QString m_setName;
    QString m_fileName;
    bool m_enabled;
};

Christian Stenger's avatar
Christian Stenger committed
100
101
102
103
} // namespace Internal
} // namespace Autotest

#endif // TESTINFO_H