Fix qlocalsocket autotest

Lackey is currently not built due to a qscript dependency. Mark the
test as an expected failure, so we can resume testing QLocalSocket
again. See QTBUG-24142

Change-Id: I2642ed30cf7a2068f30f63801c632fea7dae7691
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
This commit is contained in:
Harald Fernengel 2012-02-07 09:55:01 +01:00 committed by Qt by Nokia
parent 5240055e08
commit a2bea730c2

View File

@ -53,10 +53,6 @@ class tst_QLocalSocket : public QObject
{ {
Q_OBJECT Q_OBJECT
public:
tst_QLocalSocket();
virtual ~tst_QLocalSocket();
public Q_SLOTS: public Q_SLOTS:
void init(); void init();
void cleanup(); void cleanup();
@ -110,20 +106,6 @@ private slots:
void asyncDisconnectNotify(); void asyncDisconnectNotify();
}; };
tst_QLocalSocket::tst_QLocalSocket()
{
if (!QFile::exists("lackey/lackey"
#ifdef Q_OS_WIN
".exe"
#endif
))
qWarning() << "lackey executable doesn't exists!";
}
tst_QLocalSocket::~tst_QLocalSocket()
{
}
void tst_QLocalSocket::init() void tst_QLocalSocket::init()
{ {
qRegisterMetaType<QLocalSocket::LocalSocketState>("QLocalSocket::LocalSocketState"); qRegisterMetaType<QLocalSocket::LocalSocketState>("QLocalSocket::LocalSocketState");
@ -749,6 +731,16 @@ void tst_QLocalSocket::processConnection_data()
*/ */
void tst_QLocalSocket::processConnection() void tst_QLocalSocket::processConnection()
{ {
#ifdef Q_OS_WIN
# define EXE_SUFFIX ".exe"
#else
# define EXE_SUFFIX
#endif
// ### lackey is currently not build
QEXPECT_FAIL("", "lackey is currently not built due to qscript dependency, QTBUG-24142", Abort);
QVERIFY(QFile::exists("lackey/lackey" EXE_SUFFIX));
QFETCH(int, processes); QFETCH(int, processes);
QStringList serverArguments = QStringList() << SRCDIR "lackey/scripts/server.js" << QString::number(processes); QStringList serverArguments = QStringList() << SRCDIR "lackey/scripts/server.js" << QString::number(processes);
QProcess producer; QProcess producer;
@ -758,7 +750,7 @@ void tst_QLocalSocket::processConnection()
#endif #endif
QList<QProcess*> consumers; QList<QProcess*> consumers;
producer.start("lackey/lackey", serverArguments); producer.start("lackey/lackey", serverArguments);
QVERIFY(producer.waitForStarted(-1)); QVERIFY2(producer.waitForStarted(-1), qPrintable(producer.errorString()));
QTest::qWait(2000); QTest::qWait(2000);
for (int i = 0; i < processes; ++i) { for (int i = 0; i < processes; ++i) {
QStringList arguments = QStringList() << SRCDIR "lackey/scripts/client.js"; QStringList arguments = QStringList() << SRCDIR "lackey/scripts/client.js";