Changeset 846 for trunk/src/testlib
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 63 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/testlib/qabstracttestlogger.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qabstracttestlogger_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qasciikey.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qbenchmark.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 42 42 #include "QtTest/qbenchmark.h" 43 43 #include "QtTest/private/qbenchmark_p.h" 44 #include "QtTest/private/qbenchmarkmetric_p.h" 44 45 45 46 #ifdef QT_GUI_LIB … … 139 140 int QBenchmarkTestMethodData::adjustIterationCount(int suggestion) 140 141 { 141 // Let the -iteration -countoption override the measurer.142 // Let the -iterations option override the measurer. 142 143 if (QBenchmarkGlobalData::current->iterationCount != -1) { 143 144 iterationCount = QBenchmarkGlobalData::current->iterationCount; … … 149 150 } 150 151 151 void QBenchmarkTestMethodData::setResult(qint64 value) 152 void QBenchmarkTestMethodData::setResult( 153 qreal value, QTest::QBenchmarkMetric metric, bool setByMacro) 152 154 { 153 155 bool accepted = false; 154 156 155 157 // Always accept the result if the iteration count has been 156 // specified on the command line with -ite artion-count.158 // specified on the command line with -iterations. 157 159 if (QBenchmarkGlobalData::current->iterationCount != -1) 158 160 accepted = true; 159 161 160 if (QBenchmarkTestMethodData::current->runOnce) {162 else if (QBenchmarkTestMethodData::current->runOnce || !setByMacro) { 161 163 iterationCount = 1; 162 164 accepted = true; 163 165 } 164 166 165 167 // Test the result directly without calling the measurer if the minimum time 166 // has been specif ed on the command line with -minimumvalue.168 // has been specified on the command line with -minimumvalue. 167 169 else if (QBenchmarkGlobalData::current->walltimeMinimum != -1) 168 170 accepted = (value > QBenchmarkGlobalData::current->walltimeMinimum); … … 176 178 iterationCount *= 2; 177 179 178 this->result = 179 QBenchmark Result(QBenchmarkGlobalData::current->context, value, iterationCount);180 this->result = QBenchmarkResult( 181 QBenchmarkGlobalData::current->context, value, iterationCount, metric, setByMacro); 180 182 } 181 183 … … 209 211 QTest::QBenchmarkIterationController::~QBenchmarkIterationController() 210 212 { 211 QBenchmarkTestMethodData::current->setResult(QTest::endBenchmarkMeasurement()); 213 const qreal result = QTest::endBenchmarkMeasurement(); 214 QBenchmarkTestMethodData::current->setResult(result, QBenchmarkGlobalData::current->measurer->metricType()); 212 215 } 213 216 … … 260 263 /*! \internal 261 264 */ 262 q int64 QTest::endBenchmarkMeasurement()265 quint64 QTest::endBenchmarkMeasurement() 263 266 { 264 267 // the clock is ticking before the line below, don't add code here. … … 266 269 } 267 270 268 /*! \internal 269 */ 270 void QTest::setResult(qint64 result) 271 { 272 QBenchmarkTestMethodData::current->setResult(result); 273 } 274 275 /*! \internal 276 */ 277 void QTest::setResult(const QString &tag, qint64 result) 278 { 279 QBenchmarkContext context = QBenchmarkGlobalData::current->context; 280 context.tag = tag; 281 QBenchmarkTestMethodData::current->result = 282 QBenchmarkResult( context, result, 283 QBenchmarkTestMethodData::current->iterationCount); 271 /*! 272 Sets the benchmark result for this test function to \a result. 273 274 Use this function if you want to report benchmark results without 275 using the QBENCHMARK macro. Use \a metric to specify how QTestLib 276 should interpret the results. 277 278 The context for the result will be the test function name and any 279 data tag from the _data function. This function can only be called 280 once in each test function, subsequent calls will replace the 281 earlier reported results. 282 283 Note that the -iterations command line argument has no effect 284 on test functions without the QBENCHMARK macro. 285 286 \since 4.7 287 */ 288 void QTest::setBenchmarkResult(qreal result, QTest::QBenchmarkMetric metric) 289 { 290 QBenchmarkTestMethodData::current->setResult(result, metric, false); 284 291 } 285 292 … … 299 306 } 300 307 301 302 308 QT_END_NAMESPACE 303 -
trunk/src/testlib/qbenchmark.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 45 45 #include <QtTest/qtest_global.h> 46 #include <QtTest/qbenchmarkmetric.h> 46 47 47 48 QT_BEGIN_HEADER … … 76 77 } 77 78 79 // --- BEGIN public API --- 80 78 81 #define QBENCHMARK \ 79 82 for (QTest::QBenchmarkIterationController __iteration_controller; \ … … 84 87 __iteration_controller.isDone() == false; __iteration_controller.next()) 85 88 89 namespace QTest 90 { 91 void Q_TESTLIB_EXPORT setBenchmarkResult(qreal result, QBenchmarkMetric metric); 92 } 93 94 // --- END public API --- 95 86 96 QT_END_NAMESPACE 87 97 -
trunk/src/testlib/qbenchmark_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 #define QBENCHMARK_P_H 44 44 45 #include <stdlib.h> 46 45 47 // 46 48 // W A R N I N G … … 69 71 #endif 70 72 #include "QtTest/private/qbenchmarkevent_p.h" 73 #include "QtTest/private/qbenchmarkmetric_p.h" 71 74 72 75 QT_BEGIN_NAMESPACE … … 93 96 public: 94 97 QBenchmarkContext context; 95 q int64value;98 qreal value; 96 99 int iterations; 100 QTest::QBenchmarkMetric metric; 101 bool setByMacro; 97 102 bool valid; 98 103 … … 100 105 : value(-1) 101 106 , iterations(-1) 107 , setByMacro(true) 102 108 , valid(false) 103 { } 104 105 QBenchmarkResult(const QBenchmarkContext &context, const qint64 value, const int iterations) 109 { } 110 111 QBenchmarkResult( 112 const QBenchmarkContext &context, const qreal value, const int iterations, 113 QTest::QBenchmarkMetric metric, bool setByMacro) 106 114 : context(context) 107 115 , value(value) 108 116 , iterations(iterations) 117 , metric(metric) 118 , setByMacro(setByMacro) 109 119 , valid(true) 110 { 111 } 120 { } 112 121 113 122 bool operator<(const QBenchmarkResult &other) const … … 168 177 bool resultsAccepted() const { return resultAccepted; } 169 178 int adjustIterationCount(int suggestion); 170 void setResult(q int64 value);179 void setResult(qreal value, QTest::QBenchmarkMetric metric, bool setByMacro = true); 171 180 172 181 QBenchmarkResult result; … … 184 193 185 194 Q_TESTLIB_EXPORT void beginBenchmarkMeasurement(); 186 Q_TESTLIB_EXPORT qint64 endBenchmarkMeasurement(); 187 188 void setResult(qint64 result); 189 void setResult(const QString &tag, qint64 result); 195 Q_TESTLIB_EXPORT quint64 endBenchmarkMeasurement(); 190 196 } 191 197 -
trunk/src/testlib/qbenchmarkevent.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 42 42 #include "QtTest/private/qbenchmarkevent_p.h" 43 43 #include "QtTest/private/qbenchmark_p.h" 44 #include "QtTest/private/qbenchmarkmetric_p.h" 44 45 #include <qdebug.h> 45 46 … … 92 93 } 93 94 94 Q String QBenchmarkEvent::unitText()95 QTest::QBenchmarkMetric QBenchmarkEvent::metricType() 95 96 { 96 return QLatin1String("events"); 97 } 98 99 QString QBenchmarkEvent::metricText() 100 { 101 return QLatin1String("events"); 97 return QTest::Events; 102 98 } 103 99 -
trunk/src/testlib/qbenchmarkevent_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 71 71 int adjustMedianCount(int suggestion); 72 72 bool repeatCount() { return 1; } 73 QString unitText(); 74 QString metricText(); 73 QTest::QBenchmarkMetric metricType(); 75 74 static bool eventCountingMechanism(void *message); 76 75 static qint64 eventCounter; -
trunk/src/testlib/qbenchmarkmeasurement.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 42 42 #include "QtTest/private/qbenchmarkmeasurement_p.h" 43 43 #include "QtTest/private/qbenchmark_p.h" 44 #include "QtTest/private/qbenchmarkmetric_p.h" 45 #include "qbenchmark.h" 44 46 #include <qdebug.h> 45 47 … … 65 67 bool QBenchmarkTimeMeasurer::isMeasurementAccepted(qint64 measurement) 66 68 { 67 return (measurement > 20);69 return (measurement > 50); 68 70 } 69 71 … … 73 75 } 74 76 77 bool QBenchmarkTimeMeasurer::needsWarmupIteration() 78 { 79 return true; 80 } 81 75 82 int QBenchmarkTimeMeasurer::adjustMedianCount(int) 76 83 { … … 78 85 } 79 86 80 Q String QBenchmarkTimeMeasurer::unitText()87 QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType() 81 88 { 82 return QLatin1String("msec"); 83 } 84 85 QString QBenchmarkTimeMeasurer::metricText() 86 { 87 return QLatin1String("walltime"); 89 return QTest::WalltimeMilliseconds; 88 90 } 89 91 … … 127 129 } 128 130 129 Q String QBenchmarkTickMeasurer::unitText()131 QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType() 130 132 { 131 return QLatin1String("ticks"); 132 } 133 134 QString QBenchmarkTickMeasurer::metricText() 135 { 136 return QLatin1String("cputicks"); 133 return QTest::CPUTicks; 137 134 } 138 135 -
trunk/src/testlib/qbenchmarkmeasurement_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 54 54 // 55 55 56 #include <QtCore/q datetime.h>56 #include <QtCore/qelapsedtimer.h> 57 57 #include "3rdparty/cycle_p.h" 58 #include "qbenchmark.h" 58 59 59 60 QT_BEGIN_NAMESPACE … … 72 73 virtual bool repeatCount() { return 1; } 73 74 virtual bool needsWarmupIteration() { return false; } 74 virtual QString unitText() = 0; 75 virtual QString metricText() = 0; 75 virtual QTest::QBenchmarkMetric metricType() = 0; 76 76 }; 77 77 … … 85 85 int adjustIterationCount(int sugestion); 86 86 int adjustMedianCount(int suggestion); 87 QString unitText();88 Q String metricText();87 bool needsWarmupIteration(); 88 QTest::QBenchmarkMetric metricType(); 89 89 private: 90 Q Timetime;90 QElapsedTimer time; 91 91 }; 92 92 … … 103 103 int adjustMedianCount(int suggestion); 104 104 bool needsWarmupIteration(); 105 QString unitText(); 106 QString metricText(); 105 QTest::QBenchmarkMetric metricType(); 107 106 private: 108 107 CycleCounterTicks startTicks; -
trunk/src/testlib/qbenchmarkvalgrind.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 264 264 } 265 265 266 QString QBenchmarkCallgrindMeasurer::unitText() 267 { 268 return QLatin1String("instr. loads"); 269 } 270 271 QString QBenchmarkCallgrindMeasurer::metricText() 272 { 273 return QLatin1String("callgrind"); 266 QTest::QBenchmarkMetric QBenchmarkCallgrindMeasurer::metricType() 267 { 268 return QTest::InstructionReads; 274 269 } 275 270 -
trunk/src/testlib/qbenchmarkvalgrind_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 55 55 56 56 #include "QtTest/private/qbenchmarkmeasurement_p.h" 57 #include "QtTest/private/qbenchmarkmetric_p.h" 57 58 #include <QtCore/qmap.h> 58 59 #include <QtCore/qstring.h> … … 85 86 int adjustMedianCount(int); 86 87 bool needsWarmupIteration(); 87 QString unitText(); 88 QString metricText(); 88 QTest::QBenchmarkMetric metricType(); 89 89 }; 90 90 -
trunk/src/testlib/qplaintestlogger.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include "QtTest/private/qplaintestlogger_p.h" 46 46 #include "QtTest/private/qbenchmark_p.h" 47 #include "QtTest/private/qbenchmarkmetric_p.h" 47 48 48 49 #include <stdarg.h> … … 326 327 result.context.slotName.toAscii().data()); 327 328 328 329 329 char bufTag[1024]; 330 330 bufTag[0] = 0; … … 342 342 QTest::qt_snprintf(fill, sizeof(fill), fillFormat, ""); 343 343 344 345 QByteArray unitText = QBenchmarkGlobalData::current->measurer->unitText().toAscii(); 344 const char * unitText = QTest::benchmarkMetricUnit(result.metric); 346 345 347 346 qreal valuePerIteration = qreal(result.value) / qreal(result.iterations); … … 349 348 formatResult(resultBuffer, 100, valuePerIteration, countSignificantDigits(result.value)); 350 349 351 QByteArray iterationText = "per iteration";352 353 350 char buf2[1024]; 351 QTest::qt_snprintf( 352 buf2, sizeof(buf2), "%s %s", 353 resultBuffer, 354 unitText); 355 356 char buf2_[1024]; 357 QByteArray iterationText = " per iteration"; 354 358 Q_ASSERT(result.iterations > 0); 355 359 QTest::qt_snprintf( 356 buf2, sizeof(buf2), "%s %s %s", 357 resultBuffer, 358 unitText.data(), 360 buf2_, 361 sizeof(buf2_), "%s", 359 362 iterationText.data()); 360 363 361 364 char buf3[1024]; 362 365 Q_ASSERT(result.iterations > 0); 366 formatResult(resultBuffer, 100, result.value, countSignificantDigits(result.value)); 363 367 QTest::qt_snprintf( 364 buf3, sizeof(buf3), " (total: %s, iterations: %d) \n",365 QByteArray::number(result.value).constData(), // no 64-bit qt_snprintf support368 buf3, sizeof(buf3), " (total: %s, iterations: %d)", 369 resultBuffer, 366 370 result.iterations); 367 371 368 372 char buf[1024]; 369 QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s%s", buf1, bufTag, fill, buf2, buf3); 373 374 if (result.setByMacro) { 375 QTest::qt_snprintf( 376 buf, sizeof(buf), "%s%s%s%s%s%s\n", buf1, bufTag, fill, buf2, buf2_, buf3); 377 } else { 378 QTest::qt_snprintf(buf, sizeof(buf), "%s%s%s%s\n", buf1, bufTag, fill, buf2); 379 } 380 370 381 memcpy(buf, bmtag, strlen(bmtag)); 371 382 outputMessage(buf); -
trunk/src/testlib/qplaintestlogger_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qsignaldumper.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qsignaldumper_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qsignalspy.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qsignalspy.qdoc
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 7 7 ** This file is part of the documentation of the Qt Toolkit. 8 8 ** 9 ** $QT_BEGIN_LICENSE: LGPL$9 ** $QT_BEGIN_LICENSE:FDL$ 10 10 ** Commercial Usage 11 11 ** Licensees holding valid Qt Commercial licenses may use this file in 12 12 ** accordance with the Qt Commercial License Agreement provided with the 13 ** Software or, alternatively, in accordance with the terms contained in 14 ** awritten agreement between you and Nokia.13 ** Software or, alternatively, in accordance with the terms contained in a 14 ** written agreement between you and Nokia. 15 15 ** 16 ** GNU Lesser General Public License Usage 17 ** Alternatively, this file may be used under the terms of the GNU Lesser 18 ** General Public License version 2.1 as published by the Free Software 19 ** Foundation and appearing in the file LICENSE.LGPL included in the 20 ** packaging of this file. Please review the following information to 21 ** ensure the GNU Lesser General Public License version 2.1 requirements 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 23 ** 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 ** 28 ** GNU General Public License Usage 29 ** Alternatively, this file may be used under the terms of the GNU 30 ** General Public License version 3.0 as published by the Free Software 31 ** Foundation and appearing in the file LICENSE.GPL included in the 32 ** packaging of this file. Please review the following information to 33 ** ensure the GNU General Public License version 3.0 requirements will be 34 ** met: http://www.gnu.org/copyleft/gpl.html. 16 ** GNU Free Documentation License 17 ** Alternatively, this file may be used under the terms of the GNU Free 18 ** Documentation License version 1.3 as published by the Free Software 19 ** Foundation and appearing in the file included in the packaging of this 20 ** file. 35 21 ** 36 22 ** If you have questions regarding the use of this file, please contact -
trunk/src/testlib/qtest.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtest_global.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtest_gui.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestaccessible.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestassert.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestbasicstreamer.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestbasicstreamer.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestcase.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 55 55 #include <QtCore/qprocess.h> 56 56 #include <QtCore/qdebug.h> 57 #include <QtCore/qlibraryinfo.h>58 57 59 58 #include "QtTest/private/qtestlog_p.h" … … 300 299 \relates QTest 301 300 302 Implements a main() function that instantiates a QApplication object and301 Implements a main() function that instantiates an application object and 303 302 the \a TestClass, and executes all tests in the order they were defined. 304 303 Use this macro to build stand-alone executables. 304 305 If \c QT_GUI_LIB is defined, the application object will be a QApplication, 306 otherwise it will be a QCoreApplication. If qmake is used and the configuration 307 includes \c{QT += gui}, then \c QT_GUI_LIB will be defined automatically. 305 308 306 309 \bold {Note:} On platforms that have keypad navigation enabled by default (eg: Symbian), … … 757 760 the sequence by calling press(), move(), release() and stationary(), and let the 758 761 instance run out of scope to commit the sequence to the event system. 762 763 Example: 764 \snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 25 759 765 */ 760 766 … … 847 853 static int eventDelay = -1; 848 854 static int keyVerbose = -1; 855 #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) 856 static bool noCrashHandler = false; 857 #endif 849 858 850 859 void filter_unprintable(char *str) … … 873 882 874 883 return res; 884 } 885 886 /*! \internal 887 Invoke a method of the object without generating warning if the method does not exist 888 */ 889 static void invokeMethod(QObject *obj, const char *methodName) 890 { 891 const QMetaObject *metaObject = obj->metaObject(); 892 int funcIndex = metaObject->indexOfMethod(methodName); 893 if (funcIndex >= 0) { 894 QMetaMethod method = metaObject->method(funcIndex); 895 method.invoke(obj, Qt::DirectConnection); 896 } 875 897 } 876 898 … … 977 999 " -maxwarnings n : Sets the maximum amount of messages to output.\n" 978 1000 " 0 means unlimited, default: 2000\n" 1001 #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) 1002 " -nocrashhandler : Disables the crash handler\n" 1003 #endif 979 1004 "\n" 980 1005 " Benchmark related options:\n" … … 990 1015 " -median n : Sets the number of median iterations.\n" 991 1016 " -vb : Print out verbose benchmarking information.\n" 992 #if !defined(QT_NO_PROCESS) && !defined(QT_NO_SETTINGS)993 " -chart : Create chart based on the benchmark result.\n"994 #endif995 1017 "\n" 996 1018 " -help : This help\n"; … … 1057 1079 QTestLog::setMaxWarnings(qToInt(argv[++i])); 1058 1080 } 1081 #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) 1082 } else if (strcmp(argv[i], "-nocrashhandler") == 0) { 1083 QTest::noCrashHandler = true; 1084 #endif 1059 1085 } else if (strcmp(argv[i], "-keyevent-verbose") == 0) { 1060 1086 QTest::keyVerbose = 1; … … 1106 1132 } else if (strcmp(argv[i], "-vb") == 0) { 1107 1133 QBenchmarkGlobalData::current->verboseOutput = true; 1108 #if !defined(QT_NO_PROCESS) && !defined(QT_NO_SETTINGS)1109 1134 } else if (strcmp(argv[i], "-chart") == 0) { 1110 QBenchmarkGlobalData::current->createChart = true; 1111 QTestLog::setLogMode(QTestLog::XML); 1112 QTestLog::redirectOutput("results.xml"); 1113 #endif 1135 fprintf(stderr, "Warning: `-chart' option is not available\n"); 1114 1136 } else if (strcmp(argv[i], "-qws") == 0) { 1115 1137 // do nothing … … 1204 1226 do { 1205 1227 QTestResult::setCurrentTestLocation(QTestResult::InitFunc); 1206 QMetaObject::invokeMethod(QTest::currentTestObject, "init");1228 invokeMethod(QTest::currentTestObject, "init()"); 1207 1229 if (QTestResult::skipCurrentTest()) 1208 1230 break; … … 1224 1246 1225 1247 QTestResult::setCurrentTestLocation(QTestResult::CleanupFunc); 1226 QMetaObject::invokeMethod(QTest::currentTestObject, "cleanup");1248 invokeMethod(QTest::currentTestObject, "cleanup()"); 1227 1249 QTestResult::setCurrentTestLocation(QTestResult::NoWhere); 1228 1250 … … 1291 1313 if (curGlobalDataIndex == 0) { 1292 1314 QTestResult::setCurrentTestLocation(QTestResult::DataFunc); 1293 QTest::qt_snprintf(member, 512, "%s_data", slot); 1294 QMetaObject::invokeMethod(QTest::currentTestObject, member, Qt::DirectConnection); 1315 QTest::qt_snprintf(member, 512, "%s_data()", slot); 1316 invokeMethod(QTest::currentTestObject, member); 1317 1295 1318 // if we encounter a SkipAll in the _data slot, we skip the whole 1296 1319 // testfunction, no matter how much global data exists … … 1457 1480 QTestResult::setCurrentTestLocation(QTestResult::DataFunc); 1458 1481 QTestTable::globalTestTable(); 1459 QMetaObject::invokeMethod(testObject, "initTestCase_data", Qt::DirectConnection);1482 invokeMethod(testObject, "initTestCase_data()"); 1460 1483 1461 1484 if (!QTestResult::skipCurrentTest() && !QTest::currentTestFailed()) { 1462 1485 QTestResult::setCurrentTestLocation(QTestResult::InitFunc); 1463 QMetaObject::invokeMethod(testObject, "initTestCase");1486 invokeMethod(testObject, "initTestCase()"); 1464 1487 1465 1488 // finishedCurrentTestFunction() resets QTestResult::testFailed(), so use a local copy. … … 1489 1512 QTestResult::setSkipCurrentTest(false); 1490 1513 QTestResult::setCurrentTestFunction("cleanupTestCase"); 1491 QMetaObject::invokeMethod(testObject, "cleanupTestCase");1514 invokeMethod(testObject, "cleanupTestCase()"); 1492 1515 } 1493 1516 QTestResult::finishedCurrentTestFunction(); … … 1542 1565 // Don't overwrite any non-default handlers 1543 1566 // however, we need to replace the default QWS handlers 1544 if (oldact.sa_flags & SA_SIGINFO || oldact.sa_handler != SIG_DFL) { 1567 if ( 1568 #ifdef SA_SIGINFO 1569 oldact.sa_flags & SA_SIGINFO || 1570 #endif 1571 oldact.sa_handler != SIG_DFL) { 1545 1572 sigaction(fatalSignals[i], &oldact, 0); 1546 1573 } else … … 1682 1709 { 1683 1710 #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) 1684 FatalSignalHandler handler; 1711 QScopedPointer<FatalSignalHandler> handler; 1712 if (!noCrashHandler) 1713 handler.reset(new FatalSignalHandler); 1685 1714 #endif 1686 1715 qInvokeTestMethods(testObject); … … 1712 1741 IOPMAssertionRelease(powerID); 1713 1742 } 1714 #endif1715 1716 1717 #if !defined(QT_NO_PROCESS) && !defined(QT_NO_SETTINGS)1718 if (QBenchmarkGlobalData::current->createChart) {1719 QString chartLocation = QLibraryInfo::location(QLibraryInfo::BinariesPath);1720 #ifdef Q_OS_WIN1721 chartLocation += QLatin1String("/../tools/qtestlib/chart/release/chart.exe");1722 #else1723 chartLocation += QLatin1String("/../tools/qtestlib/chart/chart");1724 #endif1725 if (QFile::exists(chartLocation)) {1726 QProcess p;1727 p.setProcessChannelMode(QProcess::ForwardedChannels);1728 p.start(chartLocation, QStringList() << QLatin1String("results.xml"));1729 p.waitForFinished(-1);1730 } else {1731 qDebug() << QLatin1String("Could not find the chart tool in ") + chartLocation + QLatin1String(", please make sure it is compiled.");1732 }1733 }1734 1743 #endif 1735 1744 -
trunk/src/testlib/qtestcase.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestcoreelement.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestcorelist.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestdata.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestdata.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestelement.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestelement.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestelementattribute.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestelementattribute.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestevent.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestevent.qdoc
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 7 7 ** This file is part of the documentation of the Qt Toolkit. 8 8 ** 9 ** $QT_BEGIN_LICENSE: LGPL$9 ** $QT_BEGIN_LICENSE:FDL$ 10 10 ** Commercial Usage 11 11 ** Licensees holding valid Qt Commercial licenses may use this file in 12 12 ** accordance with the Qt Commercial License Agreement provided with the 13 ** Software or, alternatively, in accordance with the terms contained in 14 ** awritten agreement between you and Nokia.13 ** Software or, alternatively, in accordance with the terms contained in a 14 ** written agreement between you and Nokia. 15 15 ** 16 ** GNU Lesser General Public License Usage 17 ** Alternatively, this file may be used under the terms of the GNU Lesser 18 ** General Public License version 2.1 as published by the Free Software 19 ** Foundation and appearing in the file LICENSE.LGPL included in the 20 ** packaging of this file. Please review the following information to 21 ** ensure the GNU Lesser General Public License version 2.1 requirements 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 23 ** 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 ** 28 ** GNU General Public License Usage 29 ** Alternatively, this file may be used under the terms of the GNU 30 ** General Public License version 3.0 as published by the Free Software 31 ** Foundation and appearing in the file LICENSE.GPL included in the 32 ** packaging of this file. Please review the following information to 33 ** ensure the GNU General Public License version 3.0 requirements will be 34 ** met: http://www.gnu.org/copyleft/gpl.html. 16 ** GNU Free Documentation License 17 ** Alternatively, this file may be used under the terms of the GNU Free 18 ** Documentation License version 1.3 as published by the Free Software 19 ** Foundation and appearing in the file included in the packaging of this 20 ** file. 35 21 ** 36 22 ** If you have questions regarding the use of this file, please contact -
trunk/src/testlib/qtesteventloop.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestfilelogger.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include "QtTest/private/qtestresult_p.h" 46 46 47 #include <QtCore/qdir.h> 48 47 49 #include <stdlib.h> 48 50 #include <stdio.h> … … 70 72 { 71 73 char filename[100]; 74 int index = 0; 75 #if defined(Q_OS_SYMBIAN) 76 QByteArray ba(QDir::toNativeSeparators(QString(QDir::homePath()+QDir::separator())).toUtf8()); 77 index = ba.length(); 78 QTest::qt_snprintf(filename, sizeof(filename), "%s%s.log", 79 ba.constData(), QTestResult::currentTestObjectName()); 80 #else 72 81 QTest::qt_snprintf(filename, sizeof(filename), "%s.log", 73 82 QTestResult::currentTestObjectName()); 74 75 // Keep filenames simple 76 for (uint i = 0; i < sizeof(filename) && filename[i]; ++i) { 83 #endif 84 85 // Keep filenames simple 86 for (uint i = index; i < sizeof(filename) && filename[i]; ++i) { 77 87 char& c = filename[i]; 78 88 if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') -
trunk/src/testlib/qtestfilelogger.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestkeyboard.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestlightxmlstreamer.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestlightxmlstreamer.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestlog.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestlog_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestlogger.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 265 265 // printf("element %i", benchmarkElement->elementType()); 266 266 267 benchmarkElement->addAttribute(QTest::AI_Metric, QBenchmarkGlobalData::current->measurer->metricText().toAscii().data()); 267 benchmarkElement->addAttribute( 268 QTest::AI_Metric, 269 QTest::benchmarkMetricName(QBenchmarkTestMethodData::current->result.metric)); 268 270 benchmarkElement->addAttribute(QTest::AI_Tag, result.context.tag.toAscii().data()); 269 271 benchmarkElement->addAttribute(QTest::AI_Value, QByteArray::number(result.value).constData()); -
trunk/src/testlib/qtestlogger_p.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestmouse.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestresult.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestresult_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestspontaneevent.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestsystem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include <QtTest/qtestcase.h> 46 46 #include <QtCore/qcoreapplication.h> 47 #include <QtCore/q datetime.h>47 #include <QtCore/qelapsedtimer.h> 48 48 49 49 QT_BEGIN_HEADER … … 64 64 Q_ASSERT(QCoreApplication::instance()); 65 65 66 Q Timetimer;66 QElapsedTimer timer; 67 67 timer.start(); 68 68 do { -
trunk/src/testlib/qtesttable.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtesttable_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtesttouch.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 107 107 108 108 private: 109 QTouchEventSequence(QWidget *widget, QTouchEvent::DeviceType deviceType)110 : targetWidget(widget), deviceType( deviceType)109 QTouchEventSequence(QWidget *widget, QTouchEvent::DeviceType aDeviceType) 110 : targetWidget(widget), deviceType(aDeviceType) 111 111 { 112 112 } -
trunk/src/testlib/qtestxmlstreamer.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestxmlstreamer.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestxunitstreamer.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qtestxunitstreamer.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/qxmltestlogger.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #include "QtTest/private/qtestresult_p.h" 48 48 #include "QtTest/private/qbenchmark_p.h" 49 #include "QtTest/private/qbenchmarkmetric_p.h" 49 50 #include "QtTest/qtestcase.h" 50 51 … … 244 245 245 246 xmlQuote("edMetric, 246 QBenchmarkGlobalData::current->measurer->metricText().toAscii().constData());247 benchmarkMetricName(result.metric)); 247 248 xmlQuote("edTag, result.context.tag.toAscii().constData()); 248 249 -
trunk/src/testlib/qxmltestlogger_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/src/testlib/testlib.pro
r561 r846 48 48 qbenchmarkvalgrind.cpp \ 49 49 qbenchmarkevent.cpp \ 50 qbenchmarkmetric.cpp \ 50 51 qtestelement.cpp \ 51 52 qtestelementattribute.cpp \
Note:
See TracChangeset
for help on using the changeset viewer.