/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
**
** This file is part of the test suite of the Qt Toolkit.
**
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qscopedpointer.h>
+#include <QtQuick/qquickitem.h>
QT_BEGIN_NAMESPACE
class Q_QUICK_TEST_EXPORT QuickTestResult : public QObject
{
Q_OBJECT
- Q_ENUMS(FunctionType RunMode)
+ Q_ENUMS(RunMode)
Q_PROPERTY(QString testCaseName READ testCaseName WRITE setTestCaseName NOTIFY testCaseNameChanged)
Q_PROPERTY(QString functionName READ functionName WRITE setFunctionName NOTIFY functionNameChanged)
- Q_PROPERTY(FunctionType functionType READ functionType WRITE setFunctionType NOTIFY functionTypeChanged)
Q_PROPERTY(QString dataTag READ dataTag WRITE setDataTag NOTIFY dataTagChanged)
Q_PROPERTY(bool failed READ isFailed)
- Q_PROPERTY(bool dataFailed READ isDataFailed)
Q_PROPERTY(bool skipped READ isSkipped WRITE setSkipped NOTIFY skippedChanged)
Q_PROPERTY(int passCount READ passCount)
Q_PROPERTY(int failCount READ failCount)
QuickTestResult(QObject *parent = 0);
~QuickTestResult();
- // Values must match QTestResult::TestLocation.
- enum FunctionType
- {
- NoWhere = 0,
- DataFunc = 1,
- InitFunc = 2,
- Func = 3,
- CleanupFunc = 4
- };
-
// Values must match QBenchmarkIterationController::RunMode.
enum RunMode
{
QString functionName() const;
void setFunctionName(const QString &name);
- FunctionType functionType() const;
- void setFunctionType(FunctionType type);
-
QString dataTag() const;
void setDataTag(const QString &tag);
bool isFailed() const;
- bool isDataFailed() const;
bool isSkipped() const;
void setSkipped(bool skip);
void initTestTable();
void clearTestTable();
+ void finishTestData();
+ void finishTestDataCleanup();
void finishTestFunction();
void fail(const QString &message, const QUrl &location, int line);
void nextBenchmark();
void stopBenchmark();
+ QObject *grabImage(QQuickItem *item);
+
public:
// Helper functions for the C++ main() shell.
static void parseArgs(int argc, char *argv[]);
static void setProgramName(const char *name);
+ static void setCurrentAppname(const char *appname);
static int exitCode();
Q_SIGNALS:
void programNameChanged();
void testCaseNameChanged();
void functionNameChanged();
- void functionTypeChanged();
void dataTagChanged();
void skippedChanged();