1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the test suite of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29
30#ifndef QTEST_EXTERNAL_TESTS_H
31#define QTEST_EXTERNAL_TESTS_H
32
33#include <QList>
34#include <QByteArray>
35#include <QStringList>
36
37QT_BEGIN_NAMESPACE
38namespace QTest {
39 class QExternalTestPrivate;
40 class QExternalTest
41 {
42 public:
43 QExternalTest();
44 ~QExternalTest();
45
46 enum Stage {
47 FileStage,
48 QmakeStage,
49 CompilationStage,
50 LinkStage,
51 RunStage
52 };
53
54 enum QtModule {
55 QtCore = 0x0001,
56 QtGui = 0x0002,
57 QtNetwork = 0x0004,
58 QtXml = 0x0008,
59 QtXmlPatterns=0x0010,
60 QtOpenGL = 0x0020,
61 QtSql = 0x0040,
62 QtSvg = 0x0080,
63 QtScript = 0x0100,
64 QtTest = 0x0200,
65 QtDBus = 0x0400,
66 QtWebKit = 0x0800,
67 QtWidgets = 0x1000,
68 Phonon = 0x2000 // odd man out
69 };
70 Q_DECLARE_FLAGS(QtModules, QtModule)
71
72 enum ApplicationType {
73 AutoApplication,
74 Applicationless,
75 QCoreApplication,
76 QGuiApplication,
77 QApplication
78 };
79
80 QList<QByteArray> qmakeSettings() const;
81 void setQmakeSettings(const QList<QByteArray> &settings);
82
83 QtModules qtModules() const;
84 void setQtModules(QtModules modules);
85
86 ApplicationType applicationType() const;
87 void setApplicationType(ApplicationType type);
88
89 QStringList extraProgramSources() const;
90 void setExtraProgramSources(const QStringList &list);
91
92 QByteArray programHeader() const;
93 void setProgramHeader(const QByteArray &header);
94
95 // execution:
96 bool tryCompile(const QByteArray &body);
97 bool tryLink(const QByteArray &body);
98 bool tryRun(const QByteArray &body);
99 bool tryCompileFail(const QByteArray &body);
100 bool tryLinkFail(const QByteArray &body);
101 bool tryRunFail(const QByteArray &body);
102
103 Stage failedStage() const;
104 int exitCode() const;
105 QByteArray fullProgramSource() const;
106 QByteArray standardOutput() const;
107 QByteArray standardError() const;
108
109 QString errorReport() const;
110
111 private:
112 QExternalTestPrivate * const d;
113 };
114
115 Q_DECLARE_OPERATORS_FOR_FLAGS(QExternalTest::QtModules)
116}
117QT_END_NAMESPACE
118
119#endif
120

source code of qtbase/tests/auto/corelib/tools/qsharedpointer/externaltests.h