qcsvbenchmarklogger.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/testlib/qcsvbenchmarklogger.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2013 Intel Corporation-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the QtTest module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
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 http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qcsvbenchmarklogger_p.h"-
35#include "qtestresult_p.h"-
36#include "qbenchmark_p.h"-
37-
38QCsvBenchmarkLogger::QCsvBenchmarkLogger(const char *filename)-
39 : QAbstractTestLogger(filename)-
40{-
41}
executed 8 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
8
42-
43QCsvBenchmarkLogger::~QCsvBenchmarkLogger()-
44{-
45}-
46-
47void QCsvBenchmarkLogger::startLogging()-
48{-
49 // don't print anything-
50}-
51-
52void QCsvBenchmarkLogger::stopLogging()-
53{-
54 // don't print anything-
55}-
56-
57void QCsvBenchmarkLogger::enterTestFunction(const char *)-
58{-
59 // don't print anything-
60}-
61-
62void QCsvBenchmarkLogger::leaveTestFunction()-
63{-
64 // don't print anything-
65}-
66-
67void QCsvBenchmarkLogger::addIncident(QAbstractTestLogger::IncidentTypes, const char *, const char *, int)-
68{-
69 // don't print anything-
70}-
71-
72void QCsvBenchmarkLogger::addBenchmarkResult(const QBenchmarkResult &result)-
73{-
74 const char *fn = QTestResult::currentTestFunction() ? QTestResult::currentTestFunction()
QTestResult::c...TestFunction()Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
0-32
75 : "UnknownTestFunc";-
76 const char *tag = QTestResult::currentDataTag() ? QTestResult::currentDataTag() : "";
QTestResult::currentDataTag()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
4-28
77 const char *gtag = QTestResult::currentGlobalDataTag()
QTestResult::c...lobalDataTag()Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
0-32
78 ? QTestResult::currentGlobalDataTag()-
79 : "";-
80 const char *filler = (tag[0] && gtag[0]) ? ":" : "";
tag[0]Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
gtag[0]Description
TRUEnever evaluated
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
0-28
81-
82 const char *metric = QTest::benchmarkMetricName(result.metric);-
83-
84 char buf[1024];-
85 // "function","[globaltag:]tag","metric",value_per_iteration,total,iterations-
86 qsnprintf(buf, sizeof(buf), "\"%s\",\"%s%s%s\",\"%s\",%.13g,%.13g,%u\n",-
87 fn, gtag, filler, tag, metric,-
88 result.value / result.iterations, result.value, result.iterations);-
89 outputString(buf);-
90}
executed 32 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
32
91-
92void QCsvBenchmarkLogger::addMessage(QAbstractTestLogger::MessageTypes, const QString &, const char *, int)-
93{-
94 // don't print anything-
95}-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9