Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qplaintestlogger_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QPLAINTESTLOGGER_P_H
5#define QPLAINTESTLOGGER_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 QPlainTestLogger(const char *filename);
27
28 void startLogging() override;
29 void stopLogging() override;
30
31 void enterTestFunction(const char *function) override;
32 void leaveTestFunction() override;
33
34 void addIncident(IncidentTypes type, const char *description,
35 const char *file = nullptr, int line = 0) override;
36 void addBenchmarkResult(const QBenchmarkResult &) final override
37 { Q_UNREACHABLE(); }
39
41 const QString &) override;
42
44 const char *file = nullptr, int line = 0) override;
45
46private:
47 enum class MessageSource {
48 Incident,
49 Other,
50 };
51 void printMessage(MessageSource source, const char *type, const char *msg,
52 const char *file = nullptr, int line = 0);
53 void outputMessage(const char *str);
54 void printBenchmarkResultsHeader(const QBenchmarkResult &result);
55 void printBenchmarkResults(const QList<QBenchmarkResult> &result);
56};
57
59
60#endif
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...
Definition qlist.h:74
\inmodule QtCore
Definition qlogging.h:39
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().
void addMessage(QtMsgType, const QMessageLogContext &, const QString &) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
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 startLogging() override
Called before the start of a test run.
void enterTestFunction(const char *function) override
This virtual method is called before each test function is invoked.
void addBenchmarkResults(const QList< QBenchmarkResult > &results) override
void addBenchmarkResult(const QBenchmarkResult &) final override
This virtual method is called after a benchmark has been run enough times to produce usable data.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
QString str
[2]
Combined button and popup list for selecting options.
QtMsgType
Definition qlogging.h:29
GLenum type
GLuint GLsizei const GLchar * message
GLsizei GLsizei GLchar * source
GLuint64EXT * result
[6]
QFile file
[0]