Changeset 846 for trunk/src/testlib


Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
63 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/testlib/qabstracttestlogger.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qabstracttestlogger_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qasciikey.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qbenchmark.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4242#include "QtTest/qbenchmark.h"
    4343#include "QtTest/private/qbenchmark_p.h"
     44#include "QtTest/private/qbenchmarkmetric_p.h"
    4445
    4546#ifdef QT_GUI_LIB
     
    139140int QBenchmarkTestMethodData::adjustIterationCount(int suggestion)
    140141{
    141     // Let the -iteration-count option override the measurer.
     142    // Let the -iterations option override the measurer.
    142143    if (QBenchmarkGlobalData::current->iterationCount != -1) {
    143144        iterationCount = QBenchmarkGlobalData::current->iterationCount;
     
    149150}
    150151
    151 void QBenchmarkTestMethodData::setResult(qint64 value)
     152void QBenchmarkTestMethodData::setResult(
     153    qreal value, QTest::QBenchmarkMetric metric, bool setByMacro)
    152154{
    153155    bool accepted = false;
    154156
    155157    // Always accept the result if the iteration count has been
    156     // specified on the command line with -iteartion-count.
     158    // specified on the command line with -iterations.
    157159    if (QBenchmarkGlobalData::current->iterationCount != -1)
    158160        accepted = true;
    159161
    160     if (QBenchmarkTestMethodData::current->runOnce) {
     162    else if (QBenchmarkTestMethodData::current->runOnce || !setByMacro) {
    161163        iterationCount = 1;
    162164        accepted = true;
    163165    }
    164    
     166
    165167    // Test the result directly without calling the measurer if the minimum time
    166     // has been specifed on the command line with -minimumvalue.
     168    // has been specified on the command line with -minimumvalue.
    167169    else if (QBenchmarkGlobalData::current->walltimeMinimum != -1)
    168170        accepted = (value > QBenchmarkGlobalData::current->walltimeMinimum);
     
    176178        iterationCount *= 2;
    177179
    178     this->result =
    179         QBenchmarkResult(QBenchmarkGlobalData::current->context, value, iterationCount);
     180    this->result = QBenchmarkResult(
     181        QBenchmarkGlobalData::current->context, value, iterationCount, metric, setByMacro);
    180182}
    181183
     
    209211QTest::QBenchmarkIterationController::~QBenchmarkIterationController()
    210212{
    211     QBenchmarkTestMethodData::current->setResult(QTest::endBenchmarkMeasurement());
     213    const qreal result = QTest::endBenchmarkMeasurement();
     214    QBenchmarkTestMethodData::current->setResult(result, QBenchmarkGlobalData::current->measurer->metricType());
    212215}
    213216
     
    260263/*! \internal
    261264*/
    262 qint64 QTest::endBenchmarkMeasurement()
     265quint64 QTest::endBenchmarkMeasurement()
    263266{
    264267    // the clock is ticking before the line below, don't add code here.
     
    266269}
    267270
    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*/
     288void QTest::setBenchmarkResult(qreal result, QTest::QBenchmarkMetric metric)
     289{
     290    QBenchmarkTestMethodData::current->setResult(result, metric, false);
    284291}
    285292
     
    299306}
    300307
    301 
    302308QT_END_NAMESPACE
    303 
  • trunk/src/testlib/qbenchmark.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444
    4545#include <QtTest/qtest_global.h>
     46#include <QtTest/qbenchmarkmetric.h>
    4647
    4748QT_BEGIN_HEADER
     
    7677}
    7778
     79// --- BEGIN public API ---
     80
    7881#define QBENCHMARK \
    7982    for (QTest::QBenchmarkIterationController __iteration_controller; \
     
    8487            __iteration_controller.isDone() == false; __iteration_controller.next())
    8588
     89namespace QTest
     90{
     91    void Q_TESTLIB_EXPORT setBenchmarkResult(qreal result, QBenchmarkMetric metric);
     92}
     93
     94// --- END public API ---
     95
    8696QT_END_NAMESPACE
    8797
  • trunk/src/testlib/qbenchmark_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4343#define QBENCHMARK_P_H
    4444
     45#include <stdlib.h>
     46
    4547//
    4648//  W A R N I N G
     
    6971#endif
    7072#include "QtTest/private/qbenchmarkevent_p.h"
     73#include "QtTest/private/qbenchmarkmetric_p.h"
    7174
    7275QT_BEGIN_NAMESPACE
     
    9396public:
    9497    QBenchmarkContext context;
    95     qint64 value;
     98    qreal value;
    9699    int iterations;
     100    QTest::QBenchmarkMetric metric;
     101    bool setByMacro;
    97102    bool valid;
    98103
     
    100105    : value(-1)
    101106    , iterations(-1)
     107    , setByMacro(true)
    102108    , 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)
    106114        : context(context)
    107115        , value(value)
    108116        , iterations(iterations)
     117        , metric(metric)
     118        , setByMacro(setByMacro)
    109119        , valid(true)
    110     {
    111     }
     120    { }
    112121
    113122    bool operator<(const QBenchmarkResult &other) const
     
    168177    bool resultsAccepted() const { return resultAccepted; }
    169178    int adjustIterationCount(int suggestion);
    170     void setResult(qint64 value);
     179    void setResult(qreal value, QTest::QBenchmarkMetric metric, bool setByMacro = true);
    171180
    172181    QBenchmarkResult result;
     
    184193
    185194    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();
    190196}
    191197
  • trunk/src/testlib/qbenchmarkevent.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4242#include "QtTest/private/qbenchmarkevent_p.h"
    4343#include "QtTest/private/qbenchmark_p.h"
     44#include "QtTest/private/qbenchmarkmetric_p.h"
    4445#include <qdebug.h>
    4546
     
    9293}
    9394
    94 QString QBenchmarkEvent::unitText()
     95QTest::QBenchmarkMetric QBenchmarkEvent::metricType()
    9596{
    96     return QLatin1String("events");
    97 }
    98 
    99 QString QBenchmarkEvent::metricText()
    100 {
    101     return QLatin1String("events");
     97    return QTest::Events;
    10298}
    10399
  • trunk/src/testlib/qbenchmarkevent_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7171    int adjustMedianCount(int suggestion);
    7272    bool repeatCount() { return 1; }
    73     QString unitText();
    74     QString metricText();
     73    QTest::QBenchmarkMetric metricType();
    7574    static bool eventCountingMechanism(void *message);
    7675    static qint64 eventCounter;
  • trunk/src/testlib/qbenchmarkmeasurement.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4242#include "QtTest/private/qbenchmarkmeasurement_p.h"
    4343#include "QtTest/private/qbenchmark_p.h"
     44#include "QtTest/private/qbenchmarkmetric_p.h"
     45#include "qbenchmark.h"
    4446#include <qdebug.h>
    4547
     
    6567bool QBenchmarkTimeMeasurer::isMeasurementAccepted(qint64 measurement)
    6668{
    67     return (measurement > 20);
     69    return (measurement > 50);
    6870}
    6971
     
    7375}
    7476
     77bool QBenchmarkTimeMeasurer::needsWarmupIteration()
     78{
     79    return true;
     80}
     81
    7582int QBenchmarkTimeMeasurer::adjustMedianCount(int)
    7683{
     
    7885}
    7986
    80 QString QBenchmarkTimeMeasurer::unitText()
     87QTest::QBenchmarkMetric QBenchmarkTimeMeasurer::metricType()
    8188{
    82     return QLatin1String("msec");
    83 }
    84 
    85 QString QBenchmarkTimeMeasurer::metricText()
    86 {
    87     return QLatin1String("walltime");
     89    return QTest::WalltimeMilliseconds;
    8890}
    8991
     
    127129}
    128130
    129 QString QBenchmarkTickMeasurer::unitText()
     131QTest::QBenchmarkMetric QBenchmarkTickMeasurer::metricType()
    130132{
    131     return QLatin1String("ticks");
    132 }
    133 
    134 QString QBenchmarkTickMeasurer::metricText()
    135 {
    136     return QLatin1String("cputicks");
     133    return QTest::CPUTicks;
    137134}
    138135
  • trunk/src/testlib/qbenchmarkmeasurement_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5454//
    5555
    56 #include <QtCore/qdatetime.h>
     56#include <QtCore/qelapsedtimer.h>
    5757#include "3rdparty/cycle_p.h"
     58#include "qbenchmark.h"
    5859
    5960QT_BEGIN_NAMESPACE
     
    7273    virtual bool repeatCount() { return 1; }
    7374    virtual bool needsWarmupIteration() { return false; }
    74     virtual QString unitText() = 0;
    75     virtual QString metricText() = 0;
     75    virtual QTest::QBenchmarkMetric metricType() = 0;
    7676};
    7777
     
    8585    int adjustIterationCount(int sugestion);
    8686    int adjustMedianCount(int suggestion);
    87     QString unitText();
    88     QString metricText();
     87    bool needsWarmupIteration();
     88    QTest::QBenchmarkMetric metricType();
    8989private:
    90     QTime time;
     90    QElapsedTimer time;
    9191};
    9292
     
    103103    int adjustMedianCount(int suggestion);
    104104    bool needsWarmupIteration();
    105     QString unitText();
    106     QString metricText();
     105    QTest::QBenchmarkMetric metricType();
    107106private:
    108107    CycleCounterTicks startTicks;
  • trunk/src/testlib/qbenchmarkvalgrind.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    264264}
    265265
    266 QString QBenchmarkCallgrindMeasurer::unitText()
    267 {
    268     return QLatin1String("instr. loads");
    269 }
    270 
    271 QString QBenchmarkCallgrindMeasurer::metricText()
    272 {
    273     return QLatin1String("callgrind");
     266QTest::QBenchmarkMetric QBenchmarkCallgrindMeasurer::metricType()
     267{
     268    return QTest::InstructionReads;
    274269}
    275270
  • trunk/src/testlib/qbenchmarkvalgrind_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5555
    5656#include "QtTest/private/qbenchmarkmeasurement_p.h"
     57#include "QtTest/private/qbenchmarkmetric_p.h"
    5758#include <QtCore/qmap.h>
    5859#include <QtCore/qstring.h>
     
    8586    int adjustMedianCount(int);
    8687    bool needsWarmupIteration();
    87     QString unitText();
    88     QString metricText();
     88    QTest::QBenchmarkMetric metricType();
    8989};
    9090
  • trunk/src/testlib/qplaintestlogger.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545#include "QtTest/private/qplaintestlogger_p.h"
    4646#include "QtTest/private/qbenchmark_p.h"
     47#include "QtTest/private/qbenchmarkmetric_p.h"
    4748
    4849#include <stdarg.h>
     
    326327            result.context.slotName.toAscii().data());
    327328
    328 
    329329        char bufTag[1024];
    330330        bufTag[0] = 0;
     
    342342        QTest::qt_snprintf(fill, sizeof(fill), fillFormat, "");
    343343
    344 
    345         QByteArray unitText = QBenchmarkGlobalData::current->measurer->unitText().toAscii();
     344        const char * unitText = QTest::benchmarkMetricUnit(result.metric);
    346345
    347346        qreal valuePerIteration = qreal(result.value) / qreal(result.iterations);
     
    349348        formatResult(resultBuffer, 100, valuePerIteration, countSignificantDigits(result.value));
    350349
    351         QByteArray iterationText = "per iteration";
    352 
    353350        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";
    354358        Q_ASSERT(result.iterations > 0);
    355359        QTest::qt_snprintf(
    356             buf2, sizeof(buf2), "%s %s %s",
    357             resultBuffer,
    358             unitText.data(),
     360            buf2_,
     361            sizeof(buf2_), "%s",
    359362            iterationText.data());
    360363
    361364        char buf3[1024];
    362365        Q_ASSERT(result.iterations > 0);
     366        formatResult(resultBuffer, 100, result.value, countSignificantDigits(result.value));
    363367        QTest::qt_snprintf(
    364             buf3, sizeof(buf3), " (total: %s, iterations: %d)\n",
    365             QByteArray::number(result.value).constData(), // no 64-bit qt_snprintf support
     368            buf3, sizeof(buf3), " (total: %s, iterations: %d)",
     369            resultBuffer,
    366370            result.iterations);
    367371
    368372        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
    370381        memcpy(buf, bmtag, strlen(bmtag));
    371382        outputMessage(buf);
  • trunk/src/testlib/qplaintestlogger_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qsignaldumper.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qsignaldumper_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qsignalspy.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qsignalspy.qdoc

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    77** This file is part of the documentation of the Qt Toolkit.
    88**
    9 ** $QT_BEGIN_LICENSE:LGPL$
     9** $QT_BEGIN_LICENSE:FDL$
    1010** Commercial Usage
    1111** Licensees holding valid Qt Commercial licenses may use this file in
    1212** accordance with the Qt Commercial License Agreement provided with the
    13 ** Software or, alternatively, in accordance with the terms contained in
    14 ** a written agreement between you and Nokia.
     13** Software or, alternatively, in accordance with the terms contained in a
     14** written agreement between you and Nokia.
    1515**
    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.
    3521**
    3622** If you have questions regarding the use of this file, please contact
  • trunk/src/testlib/qtest.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtest_global.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtest_gui.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestaccessible.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestassert.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestbasicstreamer.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestbasicstreamer.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestcase.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5555#include <QtCore/qprocess.h>
    5656#include <QtCore/qdebug.h>
    57 #include <QtCore/qlibraryinfo.h>
    5857
    5958#include "QtTest/private/qtestlog_p.h"
     
    300299    \relates QTest
    301300
    302     Implements a main() function that instantiates a QApplication object and
     301    Implements a main() function that instantiates an application object and
    303302    the \a TestClass, and executes all tests in the order they were defined.
    304303    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.
    305308
    306309    \bold {Note:} On platforms that have keypad navigation enabled by default (eg: Symbian),
     
    757760    the sequence by calling press(), move(), release() and stationary(), and let the
    758761    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
    759765*/
    760766
     
    847853    static int eventDelay = -1;
    848854    static int keyVerbose = -1;
     855#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
     856    static bool noCrashHandler = false;
     857#endif
    849858
    850859void filter_unprintable(char *str)
     
    873882
    874883    return res;
     884}
     885
     886/*! \internal
     887    Invoke a method of the object without generating warning if the method does not exist
     888 */
     889static 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    }
    875897}
    876898
     
    977999         " -maxwarnings n    : Sets the maximum amount of messages to output.\n"
    9781000         "                     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
    9791004         "\n"
    9801005         " Benchmark related options:\n"
     
    9901015        " -median  n      : Sets the number of median iterations.\n"
    9911016        " -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 #endif
    9951017         "\n"
    9961018        " -help      : This help\n";
     
    10571079                QTestLog::setMaxWarnings(qToInt(argv[++i]));
    10581080            }
     1081#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
     1082        } else if (strcmp(argv[i], "-nocrashhandler") == 0) {
     1083            QTest::noCrashHandler = true;
     1084#endif
    10591085        } else if (strcmp(argv[i], "-keyevent-verbose") == 0) {
    10601086            QTest::keyVerbose = 1;
     
    11061132        } else if (strcmp(argv[i], "-vb") == 0) {
    11071133            QBenchmarkGlobalData::current->verboseOutput = true;
    1108 #if !defined(QT_NO_PROCESS) && !defined(QT_NO_SETTINGS)
    11091134        } 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");
    11141136        } else if (strcmp(argv[i], "-qws") == 0) {
    11151137            // do nothing
     
    12041226        do {
    12051227            QTestResult::setCurrentTestLocation(QTestResult::InitFunc);
    1206             QMetaObject::invokeMethod(QTest::currentTestObject, "init");
     1228            invokeMethod(QTest::currentTestObject, "init()");
    12071229            if (QTestResult::skipCurrentTest())
    12081230                break;
     
    12241246
    12251247            QTestResult::setCurrentTestLocation(QTestResult::CleanupFunc);
    1226             QMetaObject::invokeMethod(QTest::currentTestObject, "cleanup");
     1248            invokeMethod(QTest::currentTestObject, "cleanup()");
    12271249            QTestResult::setCurrentTestLocation(QTestResult::NoWhere);
    12281250
     
    12911313        if (curGlobalDataIndex == 0) {
    12921314            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
    12951318            // if we encounter a SkipAll in the _data slot, we skip the whole
    12961319            // testfunction, no matter how much global data exists
     
    14571480    QTestResult::setCurrentTestLocation(QTestResult::DataFunc);
    14581481    QTestTable::globalTestTable();
    1459     QMetaObject::invokeMethod(testObject, "initTestCase_data", Qt::DirectConnection);
     1482    invokeMethod(testObject, "initTestCase_data()");
    14601483
    14611484    if (!QTestResult::skipCurrentTest() && !QTest::currentTestFailed()) {
    14621485        QTestResult::setCurrentTestLocation(QTestResult::InitFunc);
    1463         QMetaObject::invokeMethod(testObject, "initTestCase");
     1486        invokeMethod(testObject, "initTestCase()");
    14641487
    14651488        // finishedCurrentTestFunction() resets QTestResult::testFailed(), so use a local copy.
     
    14891512        QTestResult::setSkipCurrentTest(false);
    14901513        QTestResult::setCurrentTestFunction("cleanupTestCase");
    1491         QMetaObject::invokeMethod(testObject, "cleanupTestCase");
     1514        invokeMethod(testObject, "cleanupTestCase()");
    14921515    }
    14931516    QTestResult::finishedCurrentTestFunction();
     
    15421565        // Don't overwrite any non-default handlers
    15431566        // 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) {
    15451572            sigaction(fatalSignals[i], &oldact, 0);
    15461573        } else
     
    16821709    {
    16831710#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
    1684         FatalSignalHandler handler;
     1711        QScopedPointer<FatalSignalHandler> handler;
     1712        if (!noCrashHandler)
     1713            handler.reset(new FatalSignalHandler);
    16851714#endif
    16861715        qInvokeTestMethods(testObject);
     
    17121741         IOPMAssertionRelease(powerID);
    17131742     }
    1714 #endif
    1715 
    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_WIN
    1721         chartLocation += QLatin1String("/../tools/qtestlib/chart/release/chart.exe");
    1722 #else
    1723         chartLocation += QLatin1String("/../tools/qtestlib/chart/chart");
    1724 #endif
    1725         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     }
    17341743#endif
    17351744
  • trunk/src/testlib/qtestcase.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestcoreelement.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestcorelist.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestdata.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestdata.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestelement.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestelement.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestelementattribute.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestelementattribute.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestevent.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestevent.qdoc

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    77** This file is part of the documentation of the Qt Toolkit.
    88**
    9 ** $QT_BEGIN_LICENSE:LGPL$
     9** $QT_BEGIN_LICENSE:FDL$
    1010** Commercial Usage
    1111** Licensees holding valid Qt Commercial licenses may use this file in
    1212** accordance with the Qt Commercial License Agreement provided with the
    13 ** Software or, alternatively, in accordance with the terms contained in
    14 ** a written agreement between you and Nokia.
     13** Software or, alternatively, in accordance with the terms contained in a
     14** written agreement between you and Nokia.
    1515**
    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.
    3521**
    3622** If you have questions regarding the use of this file, please contact
  • trunk/src/testlib/qtesteventloop.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestfilelogger.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545#include "QtTest/private/qtestresult_p.h"
    4646
     47#include <QtCore/qdir.h>
     48
    4749#include <stdlib.h>
    4850#include <stdio.h>
     
    7072{
    7173    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
    7281    QTest::qt_snprintf(filename, sizeof(filename), "%s.log",
    7382                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) {
    7787        char& c = filename[i];
    7888        if (!((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
  • trunk/src/testlib/qtestfilelogger.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestkeyboard.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestlightxmlstreamer.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestlightxmlstreamer.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestlog.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestlog_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestlogger.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    265265//    printf("element %i", benchmarkElement->elementType());
    266266
    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));
    268270    benchmarkElement->addAttribute(QTest::AI_Tag, result.context.tag.toAscii().data());
    269271    benchmarkElement->addAttribute(QTest::AI_Value, QByteArray::number(result.value).constData());
  • trunk/src/testlib/qtestlogger_p.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestmouse.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestresult.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestresult_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestspontaneevent.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestsystem.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545#include <QtTest/qtestcase.h>
    4646#include <QtCore/qcoreapplication.h>
    47 #include <QtCore/qdatetime.h>
     47#include <QtCore/qelapsedtimer.h>
    4848
    4949QT_BEGIN_HEADER
     
    6464        Q_ASSERT(QCoreApplication::instance());
    6565
    66         QTime timer;
     66        QElapsedTimer timer;
    6767        timer.start();
    6868        do {
  • trunk/src/testlib/qtesttable.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtesttable_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtesttouch.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    107107
    108108    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)
    111111        {
    112112        }
  • trunk/src/testlib/qtestxmlstreamer.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestxmlstreamer.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestxunitstreamer.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qtestxunitstreamer.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/qxmltestlogger.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4747#include "QtTest/private/qtestresult_p.h"
    4848#include "QtTest/private/qbenchmark_p.h"
     49#include "QtTest/private/qbenchmarkmetric_p.h"
    4950#include "QtTest/qtestcase.h"
    5051
     
    244245
    245246    xmlQuote(&quotedMetric,
    246         QBenchmarkGlobalData::current->measurer->metricText().toAscii().constData());
     247        benchmarkMetricName(result.metric));
    247248    xmlQuote(&quotedTag, result.context.tag.toAscii().constData());
    248249
  • trunk/src/testlib/qxmltestlogger_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/src/testlib/testlib.pro

    r561 r846  
    4848    qbenchmarkvalgrind.cpp \
    4949    qbenchmarkevent.cpp \
     50    qbenchmarkmetric.cpp \
    5051    qtestelement.cpp \
    5152    qtestelementattribute.cpp \
Note: See TracChangeset for help on using the changeset viewer.