aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/debugger
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-12-21 09:06:26 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-21 15:35:22 +0100
commit8249c72213bc7d212c05aa086b3145a5742706a3 (patch)
tree4a34b97b0d57a05707c65b7328d5ab1bf4254920 /tests/auto/declarative/debugger
parent3c211558f6b571555558bd1fc59774e36a6da710 (diff)
QDeclarative tests: Introduce base class for data tests.
In tests/auto/shared/util.* replace macros/find functions by a base class QDeclarativeDataTest with accessors for the data directory helper functions to create URLs from it. The class relies on QFINDTESTDATA, which is the standard way of locating test data. Using the class should reduce the number of calls to QFileInfo.exists(), etc significantly. In addition, provide utility functions for messages. Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Change-Id: Id2beacb157922ee9412f9e45cf9695cec1f8379a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto/declarative/debugger')
-rw-r--r--tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro7
-rw-r--r--tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp7
-rw-r--r--tests/auto/declarative/debugger/qdeclarativedebugtrace/qdeclarativedebugtrace.pro6
-rw-r--r--tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp4
-rw-r--r--tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro6
-rw-r--r--tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp4
6 files changed, 20 insertions, 14 deletions
diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro b/tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro
index 8f61aae8c6..f51b1f3b35 100644
--- a/tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro
+++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/qdeclarativedebugjs.pro
@@ -3,10 +3,11 @@ TARGET = tst_qdeclarativedebugjs
QT += declarative-private testlib
macx:CONFIG -= app_bundle
-HEADERS += ../shared/debugutil_p.h
-
+HEADERS += ../shared/debugutil_p.h \
+ ../../../shared/util.h
SOURCES += tst_qdeclarativedebugjs.cpp \
- ../shared/debugutil.cpp
+ ../shared/debugutil.cpp \
+ ../../../shared/util.cpp
INCLUDEPATH += ../shared
diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
index 0f9da032e8..4b6e863df9 100644
--- a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
+++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp
@@ -159,7 +159,7 @@ do {\
class QJSDebugClient;
-class tst_QDeclarativeDebugJS : public QObject
+class tst_QDeclarativeDebugJS : public QDeclarativeDataTest
{
Q_OBJECT
@@ -982,6 +982,7 @@ QByteArray QJSDebugClient::packMessage(const QByteArray &type, const QByteArray
void tst_QDeclarativeDebugJS::initTestCase()
{
+ QDeclarativeDataTest::initTestCase();
t.start();
process = 0;
client = 0;
@@ -1014,9 +1015,9 @@ bool tst_QDeclarativeDebugJS::init(const QString &qmlFile, bool blockMode)
systemEnvironment << "QML_DISABLE_OPTIMIZER=1";
process->setEnvironment(systemEnvironment);
if (blockMode)
- process->start(QStringList() << QLatin1String(BLOCKMODE) << TESTDATA(qmlFile));
+ process->start(QStringList() << QLatin1String(BLOCKMODE) << testFile(qmlFile));
else
- process->start(QStringList() << QLatin1String(NORMALMODE) << TESTDATA(qmlFile));
+ process->start(QStringList() << QLatin1String(NORMALMODE) << testFile(qmlFile));
if (!process->waitForSessionStart()) {
return false;
diff --git a/tests/auto/declarative/debugger/qdeclarativedebugtrace/qdeclarativedebugtrace.pro b/tests/auto/declarative/debugger/qdeclarativedebugtrace/qdeclarativedebugtrace.pro
index fca909b261..112c8f015f 100644
--- a/tests/auto/declarative/debugger/qdeclarativedebugtrace/qdeclarativedebugtrace.pro
+++ b/tests/auto/declarative/debugger/qdeclarativedebugtrace/qdeclarativedebugtrace.pro
@@ -2,10 +2,12 @@ CONFIG += testcase
TARGET = tst_qdeclarativedebugtrace
macx:CONFIG -= app_bundle
-HEADERS += ../shared/debugutil_p.h
+HEADERS += ../shared/debugutil_p.h \
+ ../../../shared/util.h
SOURCES += tst_qdeclarativedebugtrace.cpp \
- ../shared/debugutil.cpp
+ ../shared/debugutil.cpp \
+ ../../../shared/util.cpp
OTHER_FILES += data/test.qml
diff --git a/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp b/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp
index 0a23a5b4a4..528d84ca98 100644
--- a/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp
+++ b/tests/auto/declarative/debugger/qdeclarativedebugtrace/tst_qdeclarativedebugtrace.cpp
@@ -75,7 +75,7 @@ protected:
void messageReceived(const QByteArray &message);
};
-class tst_QDeclarativeDebugTrace : public QObject
+class tst_QDeclarativeDebugTrace : public QDeclarativeDataTest
{
Q_OBJECT
@@ -190,7 +190,7 @@ void tst_QDeclarativeDebugTrace::connect(bool block)
else
arguments << QString("-qmljsdebugger=port:"STR_PORT);
- arguments << QString(TESTDATA(QLatin1String("test.qml")));
+ arguments << testFile("test.qml");
m_process = new QDeclarativeDebugProcess(executable);
m_process->start(QStringList() << arguments);
diff --git a/tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro b/tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro
index 12c8394645..6ef72350e9 100644
--- a/tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro
+++ b/tests/auto/declarative/debugger/qv8profilerservice/qv8profilerservice.pro
@@ -2,10 +2,12 @@ CONFIG += testcase
TARGET = tst_qv8profilerservice
macx:CONFIG -= app_bundle
-HEADERS += ../shared/debugutil_p.h
+HEADERS += ../shared/debugutil_p.h \
+ ../../../shared/util.h
SOURCES += tst_qv8profilerservice.cpp \
- ../shared/debugutil.cpp
+ ../shared/debugutil.cpp \
+ ../../../shared/util.cpp
OTHER_FILES += data/test.qml
diff --git a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp b/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp
index 46c587da83..2ddff64049 100644
--- a/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp
+++ b/tests/auto/declarative/debugger/qv8profilerservice/tst_qv8profilerservice.cpp
@@ -98,7 +98,7 @@ protected:
void messageReceived(const QByteArray &message);
};
-class tst_QV8ProfilerService : public QObject
+class tst_QV8ProfilerService : public QDeclarativeDataTest
{
Q_OBJECT
@@ -174,7 +174,7 @@ void tst_QV8ProfilerService::connect(bool block)
else
arguments << QString("-qmljsdebugger=port:"STR_PORT);
- arguments << QString(TESTDATA(QLatin1String("test.qml")));
+ arguments << QDeclarativeDataTest::instance()->testFile("test.qml");
m_process = new QDeclarativeDebugProcess(executable);
m_process->start(QStringList() << arguments);