summaryrefslogtreecommitdiffstats
path: root/libqsystemtest/qsystemtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libqsystemtest/qsystemtest.cpp')
-rw-r--r--libqsystemtest/qsystemtest.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/libqsystemtest/qsystemtest.cpp b/libqsystemtest/qsystemtest.cpp
index f472166..3535df2 100644
--- a/libqsystemtest/qsystemtest.cpp
+++ b/libqsystemtest/qsystemtest.cpp
@@ -42,7 +42,7 @@
#include <qsystemtest.h>
#include "qsystemtestmaster_p.h"
#include "qtuitest_config.h"
-//#include "gracefulquit.h"
+#include "qtestide.h"
#include "ui_recorddlg.h"
#ifdef QTCREATOR_QTEST
@@ -250,13 +250,13 @@ QSystemTest::QSystemTest()
, m_config_id()
, m_recording_events(false)
, m_expect_app_close(false)
- , m_qtest_ide(new QTestIDE(this))
{
m_env.clear();
ssh_param.host = "127.0.0.1";
ssh_param.port = 22;
device_controller = 0;
+ QTestIDE::instance()->setSystemTest(this);
(void)qMetaTypeId<RecordEvent>();
(void)qMetaTypeId< QList<RecordEvent> >();
qRegisterMetaType<QTestMessage>("QTestMessage");
@@ -275,7 +275,6 @@ QSystemTest::~QSystemTest()
delete device_controller;
delete event_timer;
delete m_test_app;
- delete m_qtest_ide;
while (expected_msg_boxes.count() > 0)
delete expected_msg_boxes.takeFirst();
}
@@ -914,7 +913,7 @@ void QSystemTest::verifyImage( const QString &expectedName, const QString &query
if ( !actualIm.save(expectedFilename, "PNG", 0) ) {
QWARN(QString("Failed to save image to %1!").arg(expectedFilename).toLatin1());
} else {
- testIDE()->newTestData(expectedFilename);
+ QTestIDE::instance()->newTestData(expectedFilename);
}
snapshotOk = true;
} else {
@@ -2585,8 +2584,8 @@ void QSystemTest::processCommandLine( QStringList &args )
if (!ok)
qFatal("'%s' is not a valid host:port argument", qPrintable(host_port));
- testIDE()->openRemote( host, port );
- connect(testIDE(), SIGNAL(abort()), this, SLOT(abortTest()));
+ QTestIDE::instance()->openRemote( host, port );
+ connect(QTestIDE::instance(), SIGNAL(abort()), this, SLOT(abortTest()));
} else if ( !arg.compare("-autip", Qt::CaseInsensitive) || !arg.compare("-authost", Qt::CaseInsensitive) ) {
it.remove();
if (!it.hasNext()) qFatal("Expected a value after %s", qPrintable(arg));
@@ -2687,15 +2686,15 @@ bool QSystemTest::recordEvents( const QString &manualSteps, bool gui )
m_recorded_code = QString();
if (!queryPassed( "OK", "", QTestMessage("startEventRecording"))) return false;
if (gui) {
- if (testIDE()->isConnected()) {
- testIDE()->eventRecordingStarted(currentFile(), currentLine(), manualSteps);
+ if (QTestIDE::instance()->isConnected()) {
+ QTestIDE::instance()->eventRecordingStarted(currentFile(), currentLine(), manualSteps);
m_recording_events = true;
- while (!testIDE()->mustStopEventRecording()) {
+ while (!QTestIDE::instance()->mustStopEventRecording()) {
QTest::qWait( 50 );
}
m_recording_events = false;
- if (testIDE()->eventRecordingAborted()) {
+ if (QTestIDE::instance()->eventRecordingAborted()) {
skip("Event recording aborted.", SkipSingle );
}
} else {
@@ -2924,7 +2923,7 @@ bool QSystemTest::fail(QString const &message)
// If we saved it, let the IDE know.
QFileInfo info(currentDataPath() + "/failure_" + config + ".png");
if (info.exists()) {
- testIDE()->failureScreenshot(info.canonicalFilePath(), currentFile(), currentLine(), QTest::currentTestFunction());
+ QTestIDE::instance()->failureScreenshot(info.canonicalFilePath(), currentFile(), currentLine(), QTest::currentTestFunction());
}
}
@@ -3471,11 +3470,6 @@ bool QSystemTest::runAsManualTest(void)
return m_run_as_manual_test;
}
-QTestIDE *QSystemTest::testIDE()
-{
- return m_qtest_ide;
-}
-
/*!
\internal
Pass any configuration values to the system under test