From: Kai Koehne Date: Wed, 30 Nov 2011 16:16:42 +0000 (+0100) Subject: Debugger: Run js autotests with QML_DISABLE_OPTIMIZER X-Git-Tag: qt-v5.0.0-alpha1~891 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b611725b095760f880d5970908989d7ea26f60a;p=profile%2Fivi%2Fqtdeclarative.git Debugger: Run js autotests with QML_DISABLE_OPTIMIZER That's how you'd usually debug your app too. Change-Id: I5acbf2fea0db3cb8593d690638f90ec849cf316a Reviewed-by: Aurindam Jana --- diff --git a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp index 8967b84..aa50d64 100644 --- a/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp +++ b/tests/auto/declarative/debugger/qdeclarativedebugjs/tst_qdeclarativedebugjs.cpp @@ -972,6 +972,9 @@ bool tst_QDeclarativeDebugJS::init(const QString &qmlFile, bool blockMode) process = new QDeclarativeDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene"); client = new QJSDebugClient(connection); + QStringList systemEnvironment = QProcess::systemEnvironment(); + systemEnvironment << "QML_DISABLE_OPTIMIZER=1"; + process->setEnvironment(systemEnvironment); if (blockMode) process->start(QStringList() << QLatin1String(BLOCKMODE) << TESTDATA(qmlFile)); else diff --git a/tests/auto/declarative/debugger/shared/debugutil.cpp b/tests/auto/declarative/debugger/shared/debugutil.cpp index 04770a9..c259ac9 100644 --- a/tests/auto/declarative/debugger/shared/debugutil.cpp +++ b/tests/auto/declarative/debugger/shared/debugutil.cpp @@ -122,6 +122,7 @@ QDeclarativeDebugProcess::~QDeclarativeDebugProcess() void QDeclarativeDebugProcess::start(const QStringList &arguments) { m_mutex.lock(); + m_process.setEnvironment(m_environment); m_process.start(m_executable, arguments); m_process.waitForStarted(); m_timer.start(); @@ -147,6 +148,11 @@ bool QDeclarativeDebugProcess::waitForSessionStart() return m_started; } +void QDeclarativeDebugProcess::setEnvironment(const QStringList &environment) +{ + m_environment = environment; +} + QString QDeclarativeDebugProcess::output() const { return m_output; diff --git a/tests/auto/declarative/debugger/shared/debugutil_p.h b/tests/auto/declarative/debugger/shared/debugutil_p.h index cb0e10c..4d2ee16 100644 --- a/tests/auto/declarative/debugger/shared/debugutil_p.h +++ b/tests/auto/declarative/debugger/shared/debugutil_p.h @@ -101,6 +101,8 @@ public: QDeclarativeDebugProcess(const QString &executable); ~QDeclarativeDebugProcess(); + void setEnvironment(const QStringList &environment); + void start(const QStringList &arguments); bool waitForSessionStart(); @@ -119,6 +121,7 @@ private: QEventLoop m_eventLoop; QMutex m_mutex; bool m_started; + QStringList m_environment; }; #endif // DEBUGUTIL_H