diff options
-rw-r--r-- | tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro | 15 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/data/test.qml (renamed from tests/auto/qml/debugger/qqmldebuggingenabler/data/test.qml) | 0 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/qqmldebuggingenabler.pro | 13 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp (renamed from tests/auto/qml/debugger/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp) | 25 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp | 66 | ||||
-rw-r--r-- | tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.pro | 11 |
6 files changed, 95 insertions, 35 deletions
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro index eb41f759c9..4bcbc2a97e 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler.pro @@ -1,13 +1,4 @@ -CONFIG += testcase -TARGET = tst_qqmldebuggingenabler -QT += qml testlib gui-private core-private -osx:CONFIG -= app_bundle +TEMPLATE = subdirs +SUBDIRS = qqmldebuggingenabler qqmldebuggingenablerserver -SOURCES += tst_qqmldebuggingenabler.cpp - -INCLUDEPATH += ../shared -include(../../../shared/util.pri) -include(../shared/debugutil.pri) - -OTHER_FILES += data/test.qml -DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT_QML_DEBUG_NO_WARNING +qqmldebuggingenabler.depends = qqmldebuggingenablerserver diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/data/test.qml b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/data/test.qml index 5a7fa718f2..5a7fa718f2 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/data/test.qml +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/data/test.qml diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/qqmldebuggingenabler.pro b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/qqmldebuggingenabler.pro new file mode 100644 index 0000000000..f8014f04f4 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/qqmldebuggingenabler.pro @@ -0,0 +1,13 @@ +CONFIG += testcase +TARGET = tst_qqmldebuggingenabler +QT += qml testlib gui-private core-private +CONFIG -= debug_and_release_target +osx:CONFIG -= app_bundle + +SOURCES += tst_qqmldebuggingenabler.cpp + +INCLUDEPATH += ../../shared +include(../../../../shared/util.pri) +include(../../shared/debugutil.pri) + +OTHER_FILES += data/test.qml diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp index 73abc03e28..4ab1ac0a4c 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp @@ -92,7 +92,7 @@ bool tst_QQmlDebuggingEnabler::init(bool blockMode, bool qmlscene, int portFrom, process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this); process->setMaximumBindErrors(1); } else { - process = new QQmlDebugProcess(QCoreApplication::applicationFilePath(), this); + process = new QQmlDebugProcess(QCoreApplication::applicationDirPath() + QLatin1String("/qqmldebuggingenablerserver"), this); process->setMaximumBindErrors(portTo - portFrom); } @@ -103,7 +103,6 @@ bool tst_QQmlDebuggingEnabler::init(bool blockMode, bool qmlscene, int portFrom, testFile(QLatin1String("test.qml"))); } else { QStringList args; - args << QLatin1String("-server"); if (blockMode) args << QLatin1String("-block"); args << QString::number(portFrom) << QString::number(portTo); @@ -163,27 +162,7 @@ void tst_QQmlDebuggingEnabler::customBlock() QVERIFY(init(true, false, 5555, 5565)); } -namespace QQmlDebuggingEnablerTest { - QTEST_MAIN(tst_QQmlDebuggingEnabler) -} - -int main(int argc, char *argv[]) -{ - if (argc > 1 && QLatin1String(argv[1]) == QLatin1String("-server")) { - int one = 1; - QCoreApplication app(one, argv); - bool block = argc > 2 && QLatin1String(argv[2]) == QLatin1String("-block"); - int portFrom = QString(QLatin1String(argv[argc - 2])).toInt(); - int portTo = QString(QLatin1String(argv[argc - 1])).toInt(); - while (portFrom <= portTo) - QQmlDebuggingEnabler::startTcpDebugServer(portFrom++, block); - QQmlEngine engine; - Q_UNUSED(engine); - app.exec(); - } else { - QQmlDebuggingEnablerTest::main(argc, argv); - } -} +QTEST_MAIN(tst_QQmlDebuggingEnabler) #include "tst_qqmldebuggingenabler.moc" diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp new file mode 100644 index 0000000000..68279413e0 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** As a special exception, The Qt Company gives you certain additional +** rights. These rights are described in The Qt Company LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "debugutil_p.h" +#include <QtCore/QCoreApplication> + +int main(int argc, char *argv[]) +{ + bool block = false; + int portFrom = 0; + int portTo = 0; + + QCoreApplication app(argc, argv); + QStringList arguments = app.arguments(); + arguments.removeFirst(); + + if (arguments.size() && arguments.first() == QLatin1String("-block")) { + block = true; + arguments.removeFirst(); + } + + if (arguments.size() >= 2) { + portFrom = arguments.takeFirst().toInt(); + portTo = arguments.takeFirst().toInt(); + } + + if (!portFrom || !portTo) + qFatal("Port range has to be specified."); + + while (portFrom <= portTo) + QQmlDebuggingEnabler::startTcpDebugServer(portFrom++, block); + QQmlEngine engine; + Q_UNUSED(engine); + return app.exec(); +} + diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.pro b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.pro new file mode 100644 index 0000000000..fdd9ce8f11 --- /dev/null +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.pro @@ -0,0 +1,11 @@ +QT += qml testlib +osx:CONFIG -= app_bundle +CONFIG -= debug_and_release_target +INCLUDEPATH += ../../shared +SOURCES += qqmldebuggingenablerserver.cpp +DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 QT_QML_DEBUG_NO_WARNING + +DESTDIR = ../qqmldebuggingenabler + +target.path = $$[QT_INSTALL_TESTS]/tst_qqmldebuggingenabler +INSTALLS += target |