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
qcsvbenchmarklogger.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 Intel Corporation.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5#include "qtestresult_p.h"
6#include "qbenchmark_p.h"
7
19 : QAbstractTestLogger(filename)
20{
21}
22
24
26{
27 // don't print anything
28}
29
31{
32 // don't print anything
33}
34
36{
37 // don't print anything
38}
39
41{
42 // don't print anything
43}
44
46{
47 // don't print anything
48}
49
51{
53 : "UnknownTestFunc";
55 const char *gtag = QTestResult::currentGlobalDataTag()
57 : "";
58 const char *filler = (tag[0] && gtag[0]) ? ":" : "";
59
60 const char *metric = QTest::benchmarkMetricName(result.measurement.metric);
61
62 char buf[1024];
63 // "function","[globaltag:]tag","metric",value_per_iteration,total,iterations
64 qsnprintf(buf, sizeof(buf), "\"%s\",\"%s%s%s\",\"%s\",%.13g,%.13g,%u\n",
65 fn, gtag, filler, tag, metric,
66 result.measurement.value / result.iterations,
67 result.measurement.value, result.iterations);
69}
70
72{
73 // don't print anything
74}
Base class for test loggers.
void outputString(const char *msg)
Convenience method to write msg to the output stream.
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...
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.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static const char * currentGlobalDataTag()
static const char * currentDataTag()
static const char * currentTestFunction()
const char * benchmarkMetricName(QBenchmarkMetric metric)
Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt,...)
AudioChannelLayoutTag tag
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint64EXT * result
[6]