Make the QApplication autotest work for shadow builds.

Use QFINDTESTDATA to locate the helper applications.

Change-Id: I604d10e37c9367f2e95225864edf5bf705f1d961
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Jason McDonald 2012-02-20 16:01:43 +10:00 committed by Qt by Nokia
parent 8a182591be
commit ca1aa0da03
1 changed files with 22 additions and 3 deletions

View File

@ -1398,12 +1398,21 @@ void tst_QApplication::testDeleteLaterProcessEvents()
void tst_QApplication::desktopSettingsAware()
{
#ifndef QT_NO_PROCESS
QProcess testProcess;
const QString path = QStringLiteral("desktopsettingsaware/desktopsettingsaware");
QString path;
{
// We need an application object for QFINDTESTDATA to work
// properly in all cases.
int argc = 0;
QCoreApplication app(argc, 0);
path = QFINDTESTDATA("desktopsettingsaware/");
}
QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application");
path += "desktopsettingsaware";
#ifdef Q_OS_WINCE
int argc = 0;
QApplication tmpApp(argc, 0, QApplication::GuiServer);
#endif
QProcess testProcess;
testProcess.start(path);
QVERIFY2(testProcess.waitForStarted(),
qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
@ -2061,9 +2070,19 @@ void tst_QApplication::touchEventPropagation()
void tst_QApplication::qtbug_12673()
{
QString path;
{
// We need an application object for QFINDTESTDATA to work
// properly in all cases.
int argc = 0;
QCoreApplication app(argc, 0);
path = QFINDTESTDATA("modal/");
}
QVERIFY2(!path.isEmpty(), "Cannot locate modal helper application");
path += "modal";
QProcess testProcess;
QStringList arguments;
const QString path = QStringLiteral("modal/modal");
testProcess.start(path, arguments);
QVERIFY2(testProcess.waitForStarted(),
qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));