Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtaptestlogger_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QTAPTESTLOGGER_P_H
5#define QTAPTESTLOGGER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtTest/private/qabstracttestlogger_p.h>
19
21
23{
24public:
25 QTapTestLogger(const char *filename);
27
28 void startLogging() override;
29 void stopLogging() override;
30
31 void enterTestFunction(const char *) override;
32 void leaveTestFunction() override {}
33
34 void enterTestData(QTestData *data) override;
35
36 void addIncident(IncidentTypes type, const char *description,
37 const char *file = nullptr, int line = 0) override;
39 const char *file = nullptr, int line = 0) override;
40
41 void addBenchmarkResult(const QBenchmarkResult &) override {}
42private:
43 void outputTestLine(bool ok, int testNumber, const QTestCharBuffer &directive);
44 void outputBuffer(const QTestCharBuffer &buffer);
45 void flushComments();
46 void flushMessages();
47 void beginYamlish();
48 void endYamlish();
49 QTestCharBuffer m_firstExpectedFail;
50 QTestCharBuffer m_comments;
51 QTestCharBuffer m_messages;
52 bool m_gatherMessages = false;
53};
54
56
57#endif // QTAPTESTLOGGER_P_H
Base class for test loggers.
IncidentTypes
\value Pass The test ran to completion successfully.
MessageTypes
The members whose names begin with Q describe messages that originate in calls, by the test or code u...
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void enterTestFunction(const char *) override
This virtual method is called before each test function is invoked.
void addMessage(MessageTypes type, const QString &message, const char *file=nullptr, int line=0) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
void enterTestData(QTestData *data) override
This virtual method is called before and after each call to a test function.
void stopLogging() override
Called after the end of a test run.
void leaveTestFunction() override
This virtual method is called after a test function has completed, to match \l enterTestFunction().
QTapTestLogger(const char *filename)
void addIncident(IncidentTypes type, const char *description, const char *file=nullptr, int line=0) override
This virtual method is called when an event occurs that relates to the resolution of the test.
void addBenchmarkResult(const QBenchmarkResult &) override
This virtual method is called after a benchmark has been run enough times to produce usable data.
void startLogging() override
Called before the start of a test run.
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint buffer
GLenum type
GLuint GLsizei const GLchar * message
QFile file
[0]