4#ifndef QABSTRACTTESTLOGGER_P_H
5#define QABSTRACTTESTLOGGER_P_H
18#include <QtTest/qttestglobal.h>
19#include <QtCore/private/qglobal_p.h>
20#include <QtCore/qbytearrayalgorithms.h>
27class QBenchmarkResult;
32 Q_DISABLE_COPY_MOVE(QAbstractTestLogger)
58 virtual ~QAbstractTestLogger();
68 virtual void addIncident(IncidentTypes type,
const char *description,
69 const char *file =
nullptr,
int line = 0) = 0;
77 const char *file =
nullptr,
int line = 0) = 0;
86 void filterUnprintable(
char *str)
const;
Base class for test loggers.
void outputString(const char *msg)
Convenience method to write msg to the output stream.
bool isLoggingToStdout() const
Returns true if the output stream is standard output.
virtual void addIncident(IncidentTypes type, const char *description, const char *file=nullptr, int line=0)=0
This virtual method is called when an event occurs that relates to the resolution of the test.
virtual void addBenchmarkResult(const QBenchmarkResult &result)=0
This virtual method is called after a benchmark has been run enough times to produce usable data.
QAbstractTestLogger(const char *filename)
Constructs the base-class parts of the logger.
virtual void startLogging()
Called before the start of a test run.
virtual void addMessage(QtMsgType, const QMessageLogContext &, const QString &)
This is an overloaded member function, provided for convenience. It differs from the above function o...
MessageTypes
The members whose names begin with Q describe messages that originate in calls, by the test or code u...
virtual void addMessage(MessageTypes type, const QString &message, const char *file=nullptr, int line=0)=0
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool isRepeatSupported() const
Returns true if the logger supports repeated test runs.
virtual void addBenchmarkResults(const QList< QBenchmarkResult > &result)
virtual void leaveTestFunction()=0
This virtual method is called after a test function has completed, to match \l enterTestFunction().
virtual void stopLogging()
Called after the end of a test run.
virtual void enterTestData(QTestData *)
This virtual method is called before and after each call to a test function.
virtual void enterTestFunction(const char *function)=0
This virtual method is called before each test function is invoked.
QCsvBenchmarkLogger(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 enterTestFunction(const char *function) override
This virtual method is called before each test function is invoked.
void addBenchmarkResult(const QBenchmarkResult &result) override
This virtual method is called after a benchmark has been run enough times to produce usable data.
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(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 startLogging() override
Called before the start of a test run.