diff options
Diffstat (limited to 'tests/auto/qml/debugger')
86 files changed, 394 insertions, 226 deletions
diff --git a/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt index d3df19bc40..07b6e26544 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qdebugmessageservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qdebugmessageservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qdebugmessageservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qdebugmessageservice/data/test.qml b/tests/auto/qml/debugger/qdebugmessageservice/data/test.qml index b8134b37e6..bdb91d08e5 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/data/test.qml +++ b/tests/auto/qml/debugger/qdebugmessageservice/data/test.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp index 11c4203429..cd39b51b25 100644 --- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp +++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only //QQmlDebugTest #include "../shared/debugutil_p.h" diff --git a/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt index 146999b9bd..91941de381 100644 --- a/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt +++ b/tests/auto/qml/debugger/qpacketprotocol/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qpacketprotocol Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qpacketprotocol LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qpacketprotocol SOURCES ../shared/debugutil.cpp ../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp index 81d8694406..2ce062b0cc 100644 --- a/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp +++ b/tests/auto/qml/debugger/qpacketprotocol/tst_qpacketprotocol.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qtest.h> #include <QSignalSpy> #include <QTimer> @@ -18,9 +18,9 @@ class tst_QPacketProtocol : public QObject Q_OBJECT private: - QTcpServer *m_server; - QTcpSocket *m_client; - QTcpSocket *m_serverConn; + std::unique_ptr<QTcpServer> m_server; + std::unique_ptr<QTcpSocket> m_client; + std::unique_ptr<QTcpSocket> m_serverConn; private slots: void init(); @@ -34,34 +34,34 @@ private slots: void tst_QPacketProtocol::init() { - m_server = new QTcpServer(this); + m_server = std::make_unique<QTcpServer>(this); m_serverConn = nullptr; QVERIFY(m_server->listen(QHostAddress("127.0.0.1"))); - m_client = new QTcpSocket(this); + m_client = std::make_unique<QTcpSocket>(this); - QSignalSpy serverSpy(m_server, SIGNAL(newConnection())); - QSignalSpy clientSpy(m_client, SIGNAL(connected())); + QSignalSpy serverSpy(m_server.get(), SIGNAL(newConnection())); + QSignalSpy clientSpy(m_client.get(), SIGNAL(connected())); m_client->connectToHost(m_server->serverAddress(), m_server->serverPort()); QVERIFY(clientSpy.size() > 0 || clientSpy.wait()); QVERIFY(serverSpy.size() > 0 || serverSpy.wait()); - m_serverConn = m_server->nextPendingConnection(); + m_serverConn.reset(m_server->nextPendingConnection()); } void tst_QPacketProtocol::cleanup() { - delete m_client; - delete m_serverConn; - delete m_server; + m_client.reset(); + m_serverConn.reset(); + m_server.reset(); } void tst_QPacketProtocol::send() { - QPacketProtocol in(m_client); - QPacketProtocol out(m_serverConn); + QPacketProtocol in(m_client.get()); + QPacketProtocol out(m_serverConn.get()); QByteArray ba; int num; @@ -82,8 +82,8 @@ void tst_QPacketProtocol::packetsAvailable() { QFETCH(int, packetCount); - QPacketProtocol out(m_client); - QPacketProtocol in(m_serverConn); + QPacketProtocol out(m_client.get()); + QPacketProtocol in(m_serverConn.get()); QCOMPARE(out.packetsAvailable(), qint64(0)); QCOMPARE(in.packetsAvailable(), qint64(0)); @@ -109,8 +109,8 @@ void tst_QPacketProtocol::packetsAvailable_data() void tst_QPacketProtocol::read() { - QPacketProtocol in(m_client); - QPacketProtocol out(m_serverConn); + QPacketProtocol in(m_client.get()); + QPacketProtocol out(m_serverConn.get()); QVERIFY(in.read().isEmpty()); diff --git a/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt index 6b33ee0024..d0a63440da 100644 --- a/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugclient/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugclient Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugclient LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebugclient SOURCES ../shared/debugutil.cpp ../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp b/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp index 509791b96d..d0e9c22f2c 100644 --- a/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp +++ b/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "debugutil_p.h" #include "qqmldebugtestservice.h" @@ -44,11 +44,16 @@ void tst_QQmlDebugClient::initTestCase() m_service = new QQmlDebugTestService("tst_QQmlDebugClient::handshake()"); - foreach (const QString &service, QQmlDebuggingEnabler::debuggerServices()) + const QStringList debuggerServices = QQmlDebuggingEnabler::debuggerServices(); + for (const QString &service : debuggerServices) QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr); - foreach (const QString &service, QQmlDebuggingEnabler::inspectorServices()) + + const QStringList inspectorServices = QQmlDebuggingEnabler::inspectorServices(); + for (const QString &service : inspectorServices) QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr); - foreach (const QString &service, QQmlDebuggingEnabler::profilerServices()) + + const QStringList profilerServices = QQmlDebuggingEnabler::profilerServices(); + for (const QString &service : profilerServices) QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr); const QString waitingMsg = QString("QML Debugger: Waiting for connection on port %1...").arg(PORT); diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt index b73c2aa218..53b1e9c683 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebuggingenabler Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebuggingenabler LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebuggingenabler SOURCES ../../shared/debugutil.cpp ../../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/data/test.qml b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/data/test.qml index 9bd5130e71..2474016705 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/data/test.qml +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/data/test.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp index ab599e9a23..03a65f56ca 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenabler/tst_qqmldebuggingenabler.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "debugutil_p.h" #include "qqmldebugprocess_p.h" @@ -41,14 +41,14 @@ void tst_QQmlDebuggingEnabler::data() QTest::addColumn<bool>("blockMode"); QTest::addColumn<QStringList>("services"); - QStringList connectors({ + const QStringList connectors({ QLatin1String("QQmlDebugServer"), QLatin1String("QQmlNativeDebugConnector") }); - QList<bool> blockModes({ true, false }); + const QList<bool> blockModes({ true, false }); - QList<QStringList> serviceLists({ + const QList<QStringList> serviceLists({ QStringList(), QQmlDebuggingEnabler::nativeDebuggerServices(), QQmlDebuggingEnabler::debuggerServices(), @@ -57,9 +57,9 @@ void tst_QQmlDebuggingEnabler::data() QQmlDebuggingEnabler::debuggerServices() + QQmlDebuggingEnabler::inspectorServices() }); - foreach (const QString &connector, connectors) { - foreach (bool blockMode, blockModes) { - foreach (const QStringList &serviceList, serviceLists) { + for (const QString &connector : connectors) { + for (bool blockMode : blockModes) { + for (const QStringList &serviceList : serviceLists) { QString name = connector + QLatin1Char(',') + QLatin1String(blockMode ? "block" : "noblock") + QLatin1Char(',') + serviceList.join(QLatin1Char('-')); @@ -103,7 +103,7 @@ void tst_QQmlDebuggingEnabler::qmlscene() m_clients = QQmlDebugTest::createOtherClients(m_connection); m_connection->connectToHost("127.0.0.1", m_process->debugPort()); QVERIFY(m_connection->waitForConnected()); - foreach (QQmlDebugClient *client, m_clients) + for (QQmlDebugClient *client : std::as_const(m_clients)) QCOMPARE(client->state(), (services.isEmpty() || services.contains(client->name())) ? QQmlDebugClient::Enabled : QQmlDebugClient::Unavailable); } diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp index 33bb0d6d37..6baaf8f430 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/qcoreapplication.h> #include <QtCore/qlibraryinfo.h> diff --git a/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt index e48f8e965d..3d65442ebf 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugjs/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugjs Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugjs LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/breakOnAnchor.qml b/tests/auto/qml/debugger/qqmldebugjs/data/breakOnAnchor.qml index 03bc85f5a4..6650096b55 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/breakOnAnchor.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/breakOnAnchor.qml @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.11 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/breakpointRelocation.qml b/tests/auto/qml/debugger/qqmldebugjs/data/breakpointRelocation.qml index 3a846c0eeb..254924743e 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/breakpointRelocation.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/breakpointRelocation.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/changeBreakpoint.qml b/tests/auto/qml/debugger/qqmldebugjs/data/changeBreakpoint.qml index 2d747c28a5..3ebe44ea76 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/changeBreakpoint.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/changeBreakpoint.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/condition.qml b/tests/auto/qml/debugger/qqmldebugjs/data/condition.qml index a4952f79cc..0f02f62750 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/condition.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/condition.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/createComponent.qml b/tests/auto/qml/debugger/qqmldebugjs/data/createComponent.qml index e67713ba67..f58b474876 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/createComponent.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/createComponent.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/exception.qml b/tests/auto/qml/debugger/qqmldebugjs/data/exception.qml index dc3be646ce..807735573e 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/exception.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/exception.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/loadjsfile.qml b/tests/auto/qml/debugger/qqmldebugjs/data/loadjsfile.qml index 0af1188015..bcd8f4e9d5 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/loadjsfile.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/loadjsfile.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import "test.js" as Script diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/oncompleted.qml b/tests/auto/qml/debugger/qqmldebugjs/data/oncompleted.qml index 6cf2d7c030..4cc13a7952 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/oncompleted.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/oncompleted.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/quit.qml b/tests/auto/qml/debugger/qqmldebugjs/data/quit.qml index 026911d1cc..788cd86cce 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/quit.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/quit.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/quitInJS.qml b/tests/auto/qml/debugger/qqmldebugjs/data/quitInJS.qml index 4f21b53ff4..ab8566b77c 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/quitInJS.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/quitInJS.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import "quit.js" as Quit; diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/stepAction.qml b/tests/auto/qml/debugger/qqmldebugjs/data/stepAction.qml index f442a9c491..1de3078f19 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/stepAction.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/stepAction.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/test.js b/tests/auto/qml/debugger/qqmldebugjs/data/test.js index 7a28dafdd2..f631b1657b 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/test.js +++ b/tests/auto/qml/debugger/qqmldebugjs/data/test.js @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only function printMessage(msg) { diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/test.qml b/tests/auto/qml/debugger/qqmldebugjs/data/test.qml index 687955dffc..bc84f7b3af 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/test.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/test.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/data/timer.qml b/tests/auto/qml/debugger/qqmldebugjs/data/timer.qml index 923acb72ad..a823a9a407 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/data/timer.qml +++ b/tests/auto/qml/debugger/qqmldebugjs/data/timer.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp index ac607df0a0..35a94aae78 100644 --- a/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp +++ b/tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "debugutil_p.h" #include "qqmldebugprocess_p.h" @@ -140,8 +140,8 @@ private slots: void letConstLocals(); private: - ConnectResult init(bool qmlscene, const QString &qmlFile = QString(TEST_QMLFILE), - bool blockMode = true, bool restrictServices = false); + ConnectResult runAndConnect(bool qmlscene, const QString &qmlFile = QString(TEST_QMLFILE), + bool blockMode = true, bool restrictServices = false); QList<QQmlDebugClient *> createClients() override; QPointer<QV4DebugClient> m_client; @@ -163,7 +163,7 @@ void tst_QQmlDebugJS::initTestCase() QQmlDebugTest::initTestCase(); } #include <iostream> -QQmlDebugTest::ConnectResult tst_QQmlDebugJS::init(bool qmlscene, const QString &qmlFile, +QQmlDebugTest::ConnectResult tst_QQmlDebugJS::runAndConnect(bool qmlscene, const QString &qmlFile, bool blockMode, bool restrictServices) { const QString executable = qmlscene @@ -195,7 +195,7 @@ void tst_QQmlDebugJS::connect() QFETCH(bool, restrictMode); QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene, QString(TEST_QMLFILE), blockMode, restrictMode), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, QString(TEST_QMLFILE), blockMode, restrictMode), ConnectSuccess); m_client->connect(); QVERIFY(waitForClientSignal(SIGNAL(connected()))); } @@ -205,7 +205,7 @@ void tst_QQmlDebugJS::interrupt() //void connect() QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene), ConnectSuccess); m_client->connect(); m_client->interrupt(); @@ -217,7 +217,7 @@ void tst_QQmlDebugJS::getVersion() //void version() QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene), ConnectSuccess); m_client->connect(); QVERIFY(waitForClientSignal(SIGNAL(connected()))); @@ -231,7 +231,7 @@ void tst_QQmlDebugJS::getVersionWhenAttaching() //void version() QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene, QLatin1String(TIMER_QMLFILE), false), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, QLatin1String(TIMER_QMLFILE), false), ConnectSuccess); m_client->connect(); m_client->version(); @@ -244,7 +244,7 @@ void tst_QQmlDebugJS::disconnect() //void disconnect() QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene), ConnectSuccess); m_client->connect(); m_client->disconnect(); @@ -257,7 +257,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnCompleted() QFETCH(bool, qmlscene); int sourceLine = 9; - QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -276,7 +276,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComponentCreated() QFETCH(bool, qmlscene); int sourceLine = 9; - QCOMPARE(init(qmlscene, CREATECOMPONENT_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, CREATECOMPONENT_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -294,7 +294,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnTimerCallback() QFETCH(bool, qmlscene); int sourceLine = 10; - QCOMPARE(init(qmlscene, TIMER_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, TIMER_QMLFILE), ConnectSuccess); m_client->connect(); //We can set the breakpoint after connect() here because the timer is repeating and if we miss @@ -315,7 +315,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptInDifferentFile() QFETCH(bool, qmlscene); int sourceLine = 6; - QCOMPARE(init(qmlscene, LOADJSFILE_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, LOADJSFILE_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(TEST_JSFILE), sourceLine, -1, true); m_client->connect(); @@ -335,7 +335,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnComment() int sourceLine = 9; int actualLine = 11; - QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -356,7 +356,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnEmptyLine() int sourceLine = 10; int actualLine = 11; - QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -376,7 +376,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptOnOptimizedBinding() QFETCH(bool, qmlscene); int sourceLine = 14; - QCOMPARE(init(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, BREAKPOINTRELOCATION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(BREAKPOINTRELOCATION_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -395,7 +395,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptWithCondition() int out = 10; int sourceLine = 12; - QCOMPARE(init(qmlscene, CONDITION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, CONDITION_QMLFILE), ConnectSuccess); m_client->connect(); //The breakpoint is in a timer loop so we can set it after connect(). @@ -425,7 +425,7 @@ void tst_QQmlDebugJS::setBreakpointInScriptThatQuits() { QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene, QUIT_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, QUIT_QMLFILE), ConnectSuccess); int sourceLine = 11; @@ -465,7 +465,7 @@ void tst_QQmlDebugJS::setBreakpointInJavaScript() QTRY_COMPARE(process.state(), QProcess::NotRunning); } - QCOMPARE(init(qmlscene, QUITINJS_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, QUITINJS_QMLFILE), ConnectSuccess); const int sourceLine = 2; @@ -488,7 +488,7 @@ void tst_QQmlDebugJS::setBreakpointInJavaScript() void tst_QQmlDebugJS::setBreakpointWhenAttaching() { int sourceLine = 10; - QCOMPARE(init(true, QLatin1String(TIMER_QMLFILE), false), ConnectSuccess); + QCOMPARE(runAndConnect(true, QLatin1String(TIMER_QMLFILE), false), ConnectSuccess); m_client->connect(); @@ -509,7 +509,7 @@ void tst_QQmlDebugJS::clearBreakpoint() int sourceLine1 = 12; int sourceLine2 = 13; - QCOMPARE(init(qmlscene, CHANGEBREAKPOINT_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, CHANGEBREAKPOINT_QMLFILE), ConnectSuccess); m_client->connect(); //The breakpoints are in a timer loop so we can set them after connect(). @@ -556,7 +556,7 @@ void tst_QQmlDebugJS::changeBreakpoint() int sourceLine2 = 12; int sourceLine1 = 13; const QString file = QLatin1String(CHANGEBREAKPOINT_QMLFILE); - QCOMPARE(init(qmlscene, file), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, file), ConnectSuccess); bool isStopped = false; QObject::connect(m_client.data(), &QV4DebugClient::stopped, this, [&]() { isStopped = true; }); @@ -629,7 +629,7 @@ void tst_QQmlDebugJS::setExceptionBreak() //void setExceptionBreak(QString type, bool enabled = false); QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene, EXCEPTION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, EXCEPTION_QMLFILE), ConnectSuccess); m_client->setExceptionBreak(QV4DebugClient::All,true); m_client->connect(); QVERIFY(waitForClientSignal(SIGNAL(stopped()))); @@ -641,7 +641,7 @@ void tst_QQmlDebugJS::stepNext() QFETCH(bool, qmlscene); int sourceLine = 12; - QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -669,7 +669,7 @@ void tst_QQmlDebugJS::stepIn() int sourceLine = 16; int actualLine = 11; - QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, 1, true); m_client->connect(); @@ -691,7 +691,7 @@ void tst_QQmlDebugJS::stepOut() int sourceLine = 12; int actualLine = 16; - QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -713,7 +713,7 @@ void tst_QQmlDebugJS::continueDebugging() int sourceLine1 = 16; int sourceLine2 = 13; - QCOMPARE(init(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, STEPACTION_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine1, -1, true); m_client->setBreakpoint(QLatin1String(STEPACTION_QMLFILE), sourceLine2, -1, true); @@ -736,7 +736,7 @@ void tst_QQmlDebugJS::backtrace() QFETCH(bool, qmlscene); int sourceLine = 9; - QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -752,7 +752,7 @@ void tst_QQmlDebugJS::getFrameDetails() QFETCH(bool, qmlscene); int sourceLine = 9; - QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -768,7 +768,7 @@ void tst_QQmlDebugJS::getScopeDetails() QFETCH(bool, qmlscene); int sourceLine = 9; - QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -781,7 +781,7 @@ void tst_QQmlDebugJS::getScopeDetails() void tst_QQmlDebugJS::evaluateInGlobalScope() { //void evaluate(QString expr, int frame = -1); - QCOMPARE(init(true), ConnectSuccess); + QCOMPARE(runAndConnect(true), ConnectSuccess); m_client->connect(); @@ -802,7 +802,7 @@ void tst_QQmlDebugJS::evaluateInLocalScope() QFETCH(bool, qmlscene); int sourceLine = 9; - QCOMPARE(init(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene, ONCOMPLETED_QMLFILE), ConnectSuccess); m_client->setBreakpoint(QLatin1String(ONCOMPLETED_QMLFILE), sourceLine, -1, true); m_client->connect(); @@ -889,7 +889,7 @@ void tst_QQmlDebugJS::getScripts() //void scripts(int types = -1, QList<int> ids = QList<int>(), bool includeSource = false, QVariant filter = QVariant()); QFETCH(bool, qmlscene); - QCOMPARE(init(qmlscene), ConnectSuccess); + QCOMPARE(runAndConnect(qmlscene), ConnectSuccess); m_client->setBreakpoint(QString(TEST_QMLFILE), 10, -1, true); m_client->connect(); @@ -908,7 +908,7 @@ void tst_QQmlDebugJS::getScripts() void tst_QQmlDebugJS::encodeQmlScope() { QString file(ENCODEQMLSCOPE_QMLFILE); - QCOMPARE(init(true, file), ConnectSuccess); + QCOMPARE(runAndConnect(true, file), ConnectSuccess); int numFrames = 0; int numExpectedScopes = 0; @@ -968,7 +968,7 @@ void tst_QQmlDebugJS::encodeQmlScope() void tst_QQmlDebugJS::breakOnAnchor() { QString file(BREAKONANCHOR_QMLFILE); - QCOMPARE(init(true, file), ConnectSuccess); + QCOMPARE(runAndConnect(true, file), ConnectSuccess); int breaks = 0; bool stopped = false; @@ -1005,7 +1005,7 @@ void tst_QQmlDebugJS::breakOnAnchor() void tst_QQmlDebugJS::breakPointIds() { QString file(BREAKPOINTIDS_QMLFILE); - QCOMPARE(init(true, file), ConnectSuccess); + QCOMPARE(runAndConnect(true, file), ConnectSuccess); int breaks = 0; int breakPointIds[] = { -1, -1, -1, -1, -1, -1}; @@ -1038,7 +1038,7 @@ void tst_QQmlDebugJS::breakPointIds() void tst_QQmlDebugJS::letConstLocals() { QString file(LETCONSTLOCALS_QMLFILE); - QCOMPARE(init(true, file), ConnectSuccess); + QCOMPARE(runAndConnect(true, file), ConnectSuccess); QObject::connect(m_client.data(), &QV4DebugClient::stopped, this, [&]() { m_client->frame(); diff --git a/tests/auto/qml/debugger/qqmldebugjsserver/qqmldebugjsserver.cpp b/tests/auto/qml/debugger/qqmldebugjsserver/qqmldebugjsserver.cpp index b24e4c4445..4b3d7dc6fa 100644 --- a/tests/auto/qml/debugger/qqmldebugjsserver/qqmldebugjsserver.cpp +++ b/tests/auto/qml/debugger/qqmldebugjsserver/qqmldebugjsserver.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtGui/qguiapplication.h> #include <QtQml/qqmlengine.h> diff --git a/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt index 471336139d..03dcb24b3f 100644 --- a/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebuglocal/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebuglocal Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebuglocal LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebuglocal SOURCES ../shared/debugutil.cpp ../shared/debugutil_p.h diff --git a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp index 7449062332..bca70b7273 100644 --- a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp +++ b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qqmldebugtestservice.h" #include "debugutil_p.h" diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt index ea07333ec7..54fe36b7d5 100644 --- a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugprocess Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugprocess LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmldebugprocess SOURCES ../../shared/qqmldebugprocess.cpp ../../shared/qqmldebugprocess_p.h diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/tst_qqmldebugprocess.cpp b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/tst_qqmldebugprocess.cpp index 7b1faa1131..2a403fa361 100644 --- a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/tst_qqmldebugprocess.cpp +++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocess/tst_qqmldebugprocess.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qqmldebugprocess_p.h> #include <QtTest> diff --git a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.cpp b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.cpp index 595fe70e58..f275c2e836 100644 --- a/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.cpp +++ b/tests/auto/qml/debugger/qqmldebugprocess/qqmldebugprocessprocess/qqmldebugprocessprocess.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/qdebug.h> #include <QtCore/qcoreapplication.h> diff --git a/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt index 33b7ba1c2f..2169cb8e0e 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmldebugservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmldebugservice/data/test.qml b/tests/auto/qml/debugger/qqmldebugservice/data/test.qml index 687955dffc..bc84f7b3af 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/data/test.qml +++ b/tests/auto/qml/debugger/qqmldebugservice/data/test.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp index 7dbff4279e..462caf930f 100644 --- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp @@ -1,6 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qqmldebugtestservice.h" #include "debugutil_p.h" @@ -30,7 +29,7 @@ public: tst_QQmlDebugService(); private: - QQmlDebugConnection *m_conn; + std::unique_ptr<QQmlDebugConnection> m_conn; QQmlDebugTestService *m_service; private slots: @@ -60,20 +59,23 @@ void tst_QQmlDebugService::initTestCase() << QStringLiteral("tst_QQmlDebugService")); m_service = new QQmlDebugTestService("tst_QQmlDebugService", 2); - foreach (const QString &service, QQmlDebuggingEnabler::debuggerServices()) + const QStringList debuggerServices = QQmlDebuggingEnabler::debuggerServices(); + for (const QString &service : debuggerServices) QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr); - foreach (const QString &service, QQmlDebuggingEnabler::inspectorServices()) + + const QStringList inspectorServices = QQmlDebuggingEnabler::inspectorServices(); + for (const QString &service : inspectorServices) QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr); - foreach (const QString &service, QQmlDebuggingEnabler::profilerServices()) + + const QStringList profilerServices = QQmlDebuggingEnabler::profilerServices(); + for (const QString &service : profilerServices) QCOMPARE(QQmlDebugConnector::instance()->service(service), (QQmlDebugService *)nullptr); const QString waitingMsg = QString("QML Debugger: Waiting for connection on port %1...").arg(PORT); QTest::ignoreMessage(QtDebugMsg, waitingMsg.toLatin1().constData()); QQmlDebuggingEnabler::startTcpDebugServer(PORT); - new QQmlEngine(this); - - m_conn = new QQmlDebugConnection(this); + m_conn = std::make_unique<QQmlDebugConnection>(this); for (int i = 0; i < 50; ++i) { // try for 5 seconds ... @@ -136,7 +138,7 @@ void tst_QQmlDebugService::state() QCOMPARE(m_service->state(), QQmlDebugService::Unavailable); { - QQmlDebugTestClient client("tst_QQmlDebugService", m_conn); + QQmlDebugTestClient client("tst_QQmlDebugService", m_conn.get()); QTRY_COMPARE(client.state(), QQmlDebugClient::Enabled); QTRY_COMPARE(m_service->state(), QQmlDebugService::Enabled); } @@ -154,7 +156,7 @@ void tst_QQmlDebugService::state() void tst_QQmlDebugService::sendMessage() { - QQmlDebugTestClient client("tst_QQmlDebugService", m_conn); + QQmlDebugTestClient client("tst_QQmlDebugService", m_conn.get()); QByteArray msg = "hello!"; @@ -175,7 +177,7 @@ void tst_QQmlDebugService::sendMessage() void tst_QQmlDebugService::checkSupportForDataStreamVersion() { - QQmlDebugTestClient client("tst_QQmlDebugService", m_conn); + QQmlDebugTestClient client("tst_QQmlDebugService", m_conn.get()); QByteArray msg = "hello!"; @@ -192,22 +194,19 @@ void tst_QQmlDebugService::idForObject() { QCOMPARE(QQmlDebugService::idForObject(nullptr), -1); - QObject *objA = new QObject; + std::unique_ptr<QObject> objA = std::make_unique<QObject>(); - int idA = QQmlDebugService::idForObject(objA); + int idA = QQmlDebugService::idForObject(objA.get()); QVERIFY(idA >= 0); - QCOMPARE(QQmlDebugService::objectForId(idA), objA); + QCOMPARE(QQmlDebugService::objectForId(idA), objA.get()); - int idAA = QQmlDebugService::idForObject(objA); + int idAA = QQmlDebugService::idForObject(objA.get()); QCOMPARE(idAA, idA); - QObject *objB = new QObject; - int idB = QQmlDebugService::idForObject(objB); + std::unique_ptr<QObject> objB = std::make_unique<QObject>(); + int idB = QQmlDebugService::idForObject(objB.get()); QVERIFY(idB != idA); - QCOMPARE(QQmlDebugService::objectForId(idB), objB); - - delete objA; - delete objB; + QCOMPARE(QQmlDebugService::objectForId(idB), objB.get()); } void tst_QQmlDebugService::objectForId() @@ -215,19 +214,18 @@ void tst_QQmlDebugService::objectForId() QCOMPARE(QQmlDebugService::objectForId(-1), static_cast<QObject*>(nullptr)); QCOMPARE(QQmlDebugService::objectForId(1), static_cast<QObject*>(nullptr)); - QObject *obj = new QObject; - int id = QQmlDebugService::idForObject(obj); - QCOMPARE(QQmlDebugService::objectForId(id), obj); + std::unique_ptr<QObject> obj = std::make_unique<QObject>(); + int id = QQmlDebugService::idForObject(obj.get()); + QCOMPARE(QQmlDebugService::objectForId(id), obj.get()); - delete obj; + obj.reset(); QCOMPARE(QQmlDebugService::objectForId(id), static_cast<QObject*>(nullptr)); } void tst_QQmlDebugService::checkSupportForOldDataStreamVersion() { //create a new connection; - delete m_conn; - m_conn = new QQmlDebugConnection(this); + m_conn = std::make_unique<QQmlDebugConnection>(this); m_conn->setMaximumDataStreamVersion(QDataStream::Qt_5_0); for (int i = 0; i < 50; ++i) { // try for 5 seconds ... @@ -238,7 +236,7 @@ void tst_QQmlDebugService::checkSupportForOldDataStreamVersion() } QVERIFY(m_conn->isConnected()); - QQmlDebugTestClient client("tst_QQmlDebugService", m_conn); + QQmlDebugTestClient client("tst_QQmlDebugService", m_conn.get()); QByteArray msg = "hello!"; diff --git a/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt index fd44b5d32f..56c2e8d88a 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugtranslationclient/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qqmldebugtranslationclient Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugtranslationclient LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmldebugtranslationclient/data/test.qml b/tests/auto/qml/debugger/qqmldebugtranslationclient/data/test.qml index 5b4784bbff..e90f9a5a80 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationclient/data/test.qml +++ b/tests/auto/qml/debugger/qqmldebugtranslationclient/data/test.qml @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp b/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp index 4ad9699cb9..068ab69d4c 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp +++ b/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only //QQmlDebugTest #include <debugutil_p.h> @@ -105,9 +105,7 @@ private: if (newCurrentOutputLine > m_currentOutputLine) { // lets wait a little bit more to not cut anything int triggeredCount = 0; - int debugCounter = 0; do { - debugCounter++; triggeredCount = m_process->output().size(); QTest::qWait(updateTimeOut); newCurrentOutputLine = m_process->output().size(); diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt index 7f971df399..5081f51557 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qqmldebugtranslationservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmldebugtranslationservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/data/test.qml b/tests/auto/qml/debugger/qqmldebugtranslationservice/data/test.qml index 1212fa100a..5d3957bffa 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationservice/data/test.qml +++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/data/test.qml @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp index 0e0340b672..88d7bd39fd 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only //QQmlDebugTest #include <debugutil_p.h> diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt index 39435fe894..12c5b4ad1f 100644 --- a/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlenginecontrol/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlenginecontrol Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlenginecontrol LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp index 638389eb3c..bd01c69163 100644 --- a/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp +++ b/tests/auto/qml/debugger/qqmlenginecontrol/tst_qqmlenginecontrol.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "debugutil_p.h" #include <QtQuickTestUtils/private/qmlutils_p.h> diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt index 8b4fc93594..bb36f678c3 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlenginedebuginspectorintegration Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlenginedebuginspectorintegration LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp index 890f4eeef6..7bbc8830b1 100644 --- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "../shared/debugutil_p.h" #include <QtQuickTestUtils/private/qmlutils_p.h> @@ -24,7 +24,7 @@ public: tst_QQmlEngineDebugInspectorIntegration(); private: - ConnectResult init(bool restrictServices); + ConnectResult runAndConnect(bool restrictServices); QList<QQmlDebugClient *> createClients() override; QQmlEngineDebugObjectReference findRootObject(); @@ -68,7 +68,7 @@ tst_QQmlEngineDebugInspectorIntegration::tst_QQmlEngineDebugInspectorIntegration { } -QQmlDebugTest::ConnectResult tst_QQmlEngineDebugInspectorIntegration::init(bool restrictServices) +QQmlDebugTest::ConnectResult tst_QQmlEngineDebugInspectorIntegration::runAndConnect(bool restrictServices) { return QQmlDebugTest::connectTo( QLibraryInfo::path(QLibraryInfo::BinariesPath) + "/qml", @@ -96,15 +96,15 @@ void tst_QQmlEngineDebugInspectorIntegration::connect_data() void tst_QQmlEngineDebugInspectorIntegration::connect() { QFETCH(bool, restrictMode); - QCOMPARE(init(restrictMode), ConnectSuccess); + QCOMPARE(runAndConnect(restrictMode), ConnectSuccess); } void tst_QQmlEngineDebugInspectorIntegration::objectLocationLookup() { - QCOMPARE(init(true), ConnectSuccess); + QCOMPARE(runAndConnect(true), ConnectSuccess); bool success = false; - QQmlEngineDebugObjectReference rootObject = findRootObject(); + const QQmlEngineDebugObjectReference rootObject = findRootObject(); QVERIFY(rootObject.debugId != -1); const QString fileName = QFileInfo(rootObject.source.url.toString()).fileName(); int lineNumber = rootObject.source.lineNumber; @@ -114,7 +114,7 @@ void tst_QQmlEngineDebugInspectorIntegration::objectLocationLookup() QVERIFY(success); QVERIFY(QQmlDebugTest::waitForSignal(m_engineDebugClient, SIGNAL(result()))); - foreach (QQmlEngineDebugObjectReference child, rootObject.children) { + for (const QQmlEngineDebugObjectReference &child : rootObject.children) { success = false; lineNumber = child.source.lineNumber; columnNumber = child.source.columnNumber; @@ -127,12 +127,12 @@ void tst_QQmlEngineDebugInspectorIntegration::objectLocationLookup() void tst_QQmlEngineDebugInspectorIntegration::select() { - QCOMPARE(init(true), ConnectSuccess); + QCOMPARE(runAndConnect(true), ConnectSuccess); - QQmlEngineDebugObjectReference rootObject = findRootObject(); + const QQmlEngineDebugObjectReference rootObject = findRootObject(); QList<int> childIds; int requestId = 0; - foreach (const QQmlEngineDebugObjectReference &child, rootObject.children) { + for (const QQmlEngineDebugObjectReference &child : rootObject.children) { requestId = m_inspectorClient->select(QList<int>() << child.debugId); QTRY_COMPARE(m_recipient->lastResponseId, requestId); QVERIFY(m_recipient->lastResult); @@ -145,7 +145,7 @@ void tst_QQmlEngineDebugInspectorIntegration::select() void tst_QQmlEngineDebugInspectorIntegration::createObject() { - QCOMPARE(init(true), ConnectSuccess); + QCOMPARE(runAndConnect(true), ConnectSuccess); QString qml = QLatin1String("Rectangle {\n" " id: xxxyxxx\n" @@ -172,7 +172,7 @@ void tst_QQmlEngineDebugInspectorIntegration::createObject() void tst_QQmlEngineDebugInspectorIntegration::moveObject() { - QCOMPARE(init(true), ConnectSuccess); + QCOMPARE(runAndConnect(true), ConnectSuccess); QCOMPARE(m_inspectorClient->state(), QQmlDebugClient::Enabled); QQmlEngineDebugObjectReference rootObject = findRootObject(); @@ -197,7 +197,7 @@ void tst_QQmlEngineDebugInspectorIntegration::moveObject() void tst_QQmlEngineDebugInspectorIntegration::destroyObject() { - QCOMPARE(init(true), ConnectSuccess); + QCOMPARE(runAndConnect(true), ConnectSuccess); QCOMPARE(m_inspectorClient->state(), QQmlDebugClient::Enabled); QQmlEngineDebugObjectReference rootObject = findRootObject(); diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt index 4d4a939da5..d412368767 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlenginedebugservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlenginedebugservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/complexItem.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/complexItem.qml index 9e4546bdac..bda1673b18 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/complexItem.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/complexItem.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import Test 1.0 @@ -7,7 +7,7 @@ Item { id: root width: 10; height: 20; scale: blueRect.scale; Rectangle { id: blueRect; width: 500; height: 600; color: "blue"; } - Text { font.bold: true; color: blueRect.color; } + Text { id: blueText; font.bold: true; color: blueRect.color; } MouseArea { onEntered: { console.log('hello') } } diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/customTypes.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/customTypes.qml index a472988772..3203cc5bfc 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/customTypes.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/customTypes.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import Backend 1.0 CustomTypes { diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/debuggerCrashOnAttach.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/debuggerCrashOnAttach.qml index 0532b44726..994b2f82f1 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/debuggerCrashOnAttach.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/debuggerCrashOnAttach.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtQuick.Controls 2.5 diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/emptyItem.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/emptyItem.qml index ebbf3f85e3..ded2b620ce 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/emptyItem.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/emptyItem.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 Item { diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/fetchValueType.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/fetchValueType.qml index ea0c3ff8c0..0a2e68f786 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/fetchValueType.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/fetchValueType.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick import QtQuick.Controls diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/itemWithFunctions.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/itemWithFunctions.qml index 118b13f2d7..e107ed5259 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/itemWithFunctions.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/itemWithFunctions.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 Item { diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/jsonTest.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/jsonTest.qml index eb0c65b42f..27f6ffcc92 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/jsonTest.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/jsonTest.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import JsonTest 1.0 JsonTest { diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/rectangleWithTransitions.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/rectangleWithTransitions.qml index fee3f969b8..d8fe7f98c3 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/data/rectangleWithTransitions.qml +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/rectangleWithTransitions.qml @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 Rectangle { diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp index e6e21cbb9e..a63c690cf0 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "debugutil_p.h" #include <QtQuickTestUtils/private/qmlutils_p.h> @@ -22,6 +22,7 @@ #include <QtQml/qqmlproperty.h> #include <QtQml/qqmlincubator.h> #include <QtQml/qqmlapplicationengine.h> +#include <QtQml/private/qqmlsignalnames_p.h> #include <QtQuick/qquickitem.h> #include <QtNetwork/qhostaddress.h> @@ -244,7 +245,7 @@ void tst_QQmlEngineDebugService::recursiveObjectTest( QCOMPARE(p.objectDebugId, QQmlDebugService::idForObject(o)); // signal properties are fake - they are generated from QQmlAbstractBoundSignal children - if (p.name.startsWith("on") && p.name.size() > 2 && p.name[2].isUpper()) { + if (QQmlSignalNames::isHandlerName(p.name)) { QString signal = p.value.toString(); QQmlBoundSignalExpression *expr = QQmlPropertyPrivate::signalExpression(QQmlProperty(o, p.name)); QVERIFY(expr && expr->expression() == signal); @@ -414,10 +415,10 @@ void tst_QQmlEngineDebugService::watch_property() bool success; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->addWatch(prop, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->addWatch(QQmlEngineDebugPropertyReference(), &success); QVERIFY(success); @@ -458,10 +459,10 @@ void tst_QQmlEngineDebugService::watch_object() bool success; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->addWatch(obj, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->addWatch(QQmlEngineDebugObjectReference(), &success); QVERIFY(success); @@ -525,10 +526,10 @@ void tst_QQmlEngineDebugService::watch_expression() bool success; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->addWatch(obj, expr, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->addWatch(QQmlEngineDebugObjectReference(), expr, &success); QVERIFY(success); @@ -600,10 +601,10 @@ void tst_QQmlEngineDebugService::queryAvailableEngines() { bool success; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->queryAvailableEngines(&success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->queryAvailableEngines(&success); QVERIFY(success); @@ -628,10 +629,10 @@ void tst_QQmlEngineDebugService::queryRootContexts() QVERIFY(m_dbg->engines().size()); const QQmlEngineDebugEngineReference engine = m_dbg->engines()[0]; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->queryRootContexts(engine, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->queryRootContexts(engine, &success); QVERIFY(success); @@ -659,10 +660,10 @@ void tst_QQmlEngineDebugService::queryObject() QQmlEngineDebugObjectReference rootObject = findRootObject(); QVERIFY(!rootObject.className.isEmpty()); - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); recursive ? unconnected->queryObjectRecursive(rootObject, &success) : unconnected->queryObject(rootObject, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); recursive ? m_dbg->queryObjectRecursive(rootObject, &success) : m_dbg->queryObject(rootObject, &success); QVERIFY(success); @@ -690,9 +691,9 @@ void tst_QQmlEngineDebugService::queryObject() QQmlEngineDebugObjectReference text; for (const QQmlEngineDebugObjectReference &child : obj.children) { QVERIFY(!child.className.isEmpty()); - if (child.className == "Rectangle") + if (child.idString == "blueRect") rect = child; - else if (child.className == "Text") + else if (child.idString == "blueText") text = child; } @@ -731,13 +732,13 @@ void tst_QQmlEngineDebugService::queryObjectsForLocation() int lineNumber = rootObject.source.lineNumber; int columnNumber = rootObject.source.columnNumber; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); recursive ? unconnected->queryObjectsForLocationRecursive(fileName, lineNumber, columnNumber, &success) : unconnected->queryObjectsForLocation(fileName, lineNumber, columnNumber, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); recursive ? m_dbg->queryObjectsForLocationRecursive(fileName, lineNumber, columnNumber, &success) @@ -769,9 +770,9 @@ void tst_QQmlEngineDebugService::queryObjectsForLocation() QQmlEngineDebugObjectReference text; for (const QQmlEngineDebugObjectReference &child : obj.children) { QVERIFY(!child.className.isEmpty()); - if (child.className == "Rectangle") + if (child.idString == "blueRect") rect = child; - else if (child.className == "Text") + else if (child.idString == "blueText") text = child; } @@ -813,9 +814,9 @@ void tst_QQmlEngineDebugService::regression_QTCREATORBUG_7451() "text: \"test\"\n" "}"); component.setData(content, rootObject.source.url); - QObject *object = component.create(context); + std::unique_ptr<QObject> object { component.create(context) }; QVERIFY(object); - int idNew = QQmlDebugService::idForObject(object); + int idNew = QQmlDebugService::idForObject(object.get()); QVERIFY(idNew >= 0); const QString fileName = QFileInfo(rootObject.source.url.toString()).fileName(); @@ -839,7 +840,7 @@ void tst_QQmlEngineDebugService::regression_QTCREATORBUG_7451() QVERIFY(QQmlDebugTest::waitForSignal(m_dbg, SIGNAL(result()))); } - delete object; + object.reset(); QObject *deleted = QQmlDebugService::objectForId(idNew); QVERIFY(!deleted); @@ -870,10 +871,10 @@ void tst_QQmlEngineDebugService::queryObjectWithNonStreamableTypes() QQmlEngineDebugObjectReference rootObject = findRootObject(4, true); QVERIFY(!rootObject.className.isEmpty()); - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->queryObject(rootObject, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->queryObject(rootObject, &success); QVERIFY(success); @@ -914,10 +915,10 @@ void tst_QQmlEngineDebugService::queryExpressionResult() bool success; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->queryExpressionResult(objectId, expr, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->queryExpressionResult(objectId, expr, &success); QVERIFY(success); @@ -967,10 +968,10 @@ void tst_QQmlEngineDebugService::queryExpressionResultBC() bool success; - QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(nullptr); + std::unique_ptr<QQmlEngineDebugClient> unconnected = std::make_unique<QQmlEngineDebugClient>(nullptr); unconnected->queryExpressionResultBC(objectId, expr, &success); QVERIFY(!success); - delete unconnected; + unconnected.reset(); m_dbg->queryExpressionResultBC(objectId, expr, &success); QVERIFY(success); diff --git a/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt index 7e6fb3559d..34a9b7a393 100644 --- a/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlinspector/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlinspector Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlinspector LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp index 897d8c8688..7f4e5eb73f 100644 --- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp +++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "../shared/debugutil_p.h" #include "../shared/qqmldebugprocess_p.h" diff --git a/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt b/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt index 705361c3be..f6d8988ec2 100644 --- a/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlnativeconnector/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlnativeconnector Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlnativeconnector LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qqmlnativeconnector SOURCES tst_qqmlnativeconnector.cpp diff --git a/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp b/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp index 55a9aeb3f5..dd9789cdc5 100644 --- a/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp +++ b/tests/auto/qml/debugger/qqmlnativeconnector/tst_qqmlnativeconnector.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtCore/qjsondocument.h> #include <QtCore/qjsonobject.h> diff --git a/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt index 3eaf14b35d..83d33a617f 100644 --- a/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlpreview/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlpreview Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlpreview LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data list(APPEND test_data "data/window.qml") list(APPEND test_data "data/qtquick2.qml") diff --git a/tests/auto/qml/debugger/qqmlpreview/data/broken.qml b/tests/auto/qml/debugger/qqmlpreview/data/broken.qml index 75387c42aa..e8f82461a0 100644 --- a/tests/auto/qml/debugger/qqmlpreview/data/broken.qml +++ b/tests/auto/qml/debugger/qqmlpreview/data/broken.qml @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmlpreview/data/qtquick2.qml b/tests/auto/qml/debugger/qqmlpreview/data/qtquick2.qml index 4013dfc9ff..d49b94fc7e 100644 --- a/tests/auto/qml/debugger/qqmlpreview/data/qtquick2.qml +++ b/tests/auto/qml/debugger/qqmlpreview/data/qtquick2.qml @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmlpreview/data/window.qml b/tests/auto/qml/debugger/qqmlpreview/data/window.qml index 951b9a7f10..1141292a2c 100644 --- a/tests/auto/qml/debugger/qqmlpreview/data/window.qml +++ b/tests/auto/qml/debugger/qqmlpreview/data/window.qml @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtQuick.Window 2.0 diff --git a/tests/auto/qml/debugger/qqmlpreview/data/window1.qml b/tests/auto/qml/debugger/qqmlpreview/data/window1.qml index 4a24041dea..20c7ab04ea 100644 --- a/tests/auto/qml/debugger/qqmlpreview/data/window1.qml +++ b/tests/auto/qml/debugger/qqmlpreview/data/window1.qml @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtQuick.Window 2.3 diff --git a/tests/auto/qml/debugger/qqmlpreview/data/window2.qml b/tests/auto/qml/debugger/qqmlpreview/data/window2.qml index 0de5dc36c8..d144cfb033 100644 --- a/tests/auto/qml/debugger/qqmlpreview/data/window2.qml +++ b/tests/auto/qml/debugger/qqmlpreview/data/window2.qml @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtQuick.Window 2.3 diff --git a/tests/auto/qml/debugger/qqmlpreview/data/zoom.qml b/tests/auto/qml/debugger/qqmlpreview/data/zoom.qml index 86445a2fdc..18712a7e2d 100644 --- a/tests/auto/qml/debugger/qqmlpreview/data/zoom.qml +++ b/tests/auto/qml/debugger/qqmlpreview/data/zoom.qml @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick diff --git a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp index 0c4fd568a9..5874100ebd 100644 --- a/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp +++ b/tests/auto/qml/debugger/qqmlpreview/tst_qqmlpreview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2018 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <qqmldebugprocess_p.h> #include <debugutil_p.h> @@ -303,7 +303,7 @@ void tst_QQmlPreview::zoom() for (auto testZoomFactor : {2.0f, 1.5f, 0.5f}) { m_client->triggerZoom(testZoomFactor); - verifyZoomFactor(m_process, testZoomFactor); + verifyZoomFactor(m_process, testZoomFactor * baseZoomFactor); } m_client->triggerZoom(-1.0f); diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt index 1e6c4c1753..d770f1fb27 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt +++ b/tests/auto/qml/debugger/qqmlprofilerservice/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qqmlprofilerservice Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qqmlprofilerservice LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/controlFromJS.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/controlFromJS.qml index 3a7c093fa5..6e16eaa7b1 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/data/controlFromJS.qml +++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/controlFromJS.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQml 2.0 diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/data/quit.qml b/tests/auto/qml/debugger/qqmlprofilerservice/data/quit.qml index 026911d1cc..788cd86cce 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/data/quit.qml +++ b/tests/auto/qml/debugger/qqmlprofilerservice/data/quit.qml @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp index 53971d3e8b..2088f958ae 100644 --- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp +++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "debugutil_p.h" #include "qqmldebugprocess_p.h" @@ -80,7 +80,7 @@ void QQmlProfilerTestClient::addEvent(const QQmlProfilerEvent &event) const QQmlProfilerEventType &type = types[typeIndex]; - QVERIFY(event.timestamp() >= lastTimestamp); + const qint64 oldTimestamp = lastTimestamp; lastTimestamp = event.timestamp(); switch (type.message()) { @@ -149,6 +149,8 @@ void QQmlProfilerTestClient::addEvent(const QQmlProfilerEvent &event) } break; } + + QCOMPARE_GE(lastTimestamp, oldTimestamp); } class tst_QQmlProfilerService : public QQmlDebugTest @@ -287,7 +289,7 @@ void tst_QQmlProfilerService::checkJsHeap() qint64 allocated = 0; qint64 used = 0; qint64 lastTimestamp = -1; - foreach (const QQmlProfilerEvent &message, m_client->jsHeapMessages) { + for (const QQmlProfilerEvent &message : std::as_const(m_client->jsHeapMessages)) { const auto amount = message.number<qint64>(0); const QQmlProfilerEventType &type = m_client->types.at(message.typeIndex()); switch (type.detailType()) { @@ -440,7 +442,7 @@ bool tst_QQmlProfilerService::verify(tst_QQmlProfilerService::MessageListType ty return true; } while (++position < target->size() && target->at(position).timestamp() == timestamp); - foreach (const QString &message, warnings) + for (const QString &message : std::as_const(warnings)) qWarning() << message.toLocal8Bit().constData(); return false; @@ -580,7 +582,7 @@ void tst_QQmlProfilerService::scenegraphData() QCOMPARE(connectTo(true, "scenegraphTest.qml"), ConnectSuccess); while (!m_process->output().contains(QLatin1String("tick"))) - QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput()))); + QVERIFY(QQmlDebugTest::waitForSignal(m_process, SIGNAL(readyReadStandardOutput()), 30000)); m_client->client->setRecording(false); checkTraceReceived(); @@ -594,7 +596,7 @@ void tst_QQmlProfilerService::scenegraphData() // interleaved. Also, events could carry the same time stamps and be sorted in an unexpected way // if the clocks are acting up. qint64 renderFrameTime = -1; - foreach (const QQmlProfilerEvent &msg, m_client->asynchronousMessages) { + for (const QQmlProfilerEvent &msg : std::as_const(m_client->asynchronousMessages)) { const QQmlProfilerEventType &type = m_client->types.at(msg.typeIndex()); if (type.detailType() == SceneGraphRendererFrame) { renderFrameTime = msg.timestamp(); diff --git a/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt b/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt index 0b60a0092b..42f6cf931a 100644 --- a/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt +++ b/tests/auto/qml/debugger/qv4debugger/CMakeLists.txt @@ -7,6 +7,12 @@ ## tst_qv4debugger Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qv4debugger LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} @@ -17,11 +23,12 @@ qt_add_library(testCppTypes STATIC) qt_autogen_tools_initial_setup(testCppTypes) target_link_libraries(testCppTypes PRIVATE Qt::Qml Qt::QmlPrivate Qt::Quick) +qt_policy(SET QTP0001 NEW) + qt6_add_qml_module(testCppTypes URI TestTypes SOURCES commontypes.h - AUTO_RESOURCE_PREFIX OUTPUT_DIRECTORY TestTypes ) qt_autogen_tools_initial_setup(testCppTypesplugin) diff --git a/tests/auto/qml/debugger/qv4debugger/commontypes.h b/tests/auto/qml/debugger/qv4debugger/commontypes.h index 01b2125ae3..b63059b0e6 100644 --- a/tests/auto/qml/debugger/qv4debugger/commontypes.h +++ b/tests/auto/qml/debugger/qv4debugger/commontypes.h @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef COMMONTYPES_H #define COMMONTYPES_H @@ -14,7 +14,7 @@ class MyType : public QQuickItem QML_ELEMENT public: MyType(QQuickItem *parent = nullptr) : QQuickItem(parent) {} - Q_INVOKABLE void name(QQmlV4Function*) const {} + Q_INVOKABLE void name(QQmlV4FunctionPtr) const {} }; #endif // COMMONTYPES_H diff --git a/tests/auto/qml/debugger/qv4debugger/data/breakPointInJSModule.qml b/tests/auto/qml/debugger/qv4debugger/data/breakPointInJSModule.qml new file mode 100644 index 0000000000..2582a23ec5 --- /dev/null +++ b/tests/auto/qml/debugger/qv4debugger/data/breakPointInJSModule.qml @@ -0,0 +1,4 @@ +import QtQml 2.15 +import "module1.js" as Module1 + +QtObject {} diff --git a/tests/auto/qml/debugger/qv4debugger/data/module1.js b/tests/auto/qml/debugger/qv4debugger/data/module1.js new file mode 100644 index 0000000000..9ce1f1e6b1 --- /dev/null +++ b/tests/auto/qml/debugger/qv4debugger/data/module1.js @@ -0,0 +1,5 @@ +.pragma library + +.import "module2.mjs" as Module2 + +Module2.crashMe(); diff --git a/tests/auto/qml/debugger/qv4debugger/data/module2.mjs b/tests/auto/qml/debugger/qv4debugger/data/module2.mjs new file mode 100644 index 0000000000..80f82af953 --- /dev/null +++ b/tests/auto/qml/debugger/qv4debugger/data/module2.mjs @@ -0,0 +1,7 @@ +import * as Module3 from "module3.mjs" +import * as Module4 from "module4.mjs" + +export function crashMe() +{ + console.log("Hello world!"); +} diff --git a/tests/auto/qml/debugger/qv4debugger/data/module3.mjs b/tests/auto/qml/debugger/qv4debugger/data/module3.mjs new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qml/debugger/qv4debugger/data/module3.mjs diff --git a/tests/auto/qml/debugger/qv4debugger/data/module4.mjs b/tests/auto/qml/debugger/qv4debugger/data/module4.mjs new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/auto/qml/debugger/qv4debugger/data/module4.mjs diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp index 6f147446f0..3da401b5bb 100644 --- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + #include <QtQuickTestUtils/private/qmlutils_p.h> #include <QtTest/QtTest> @@ -167,7 +168,7 @@ public slots: m_thrownValue = job.exceptionValue(); } - foreach (const TestBreakPoint &bp, m_breakPointsToAddWhenPaused) + for (const TestBreakPoint &bp : std::as_const(m_breakPointsToAddWhenPaused)) debugger->addBreakPoint(bp.fileName, bp.lineNumber); m_breakPointsToAddWhenPaused.clear(); @@ -216,10 +217,14 @@ public: QJsonArray scopes = frameObj.value(QLatin1String("scopes")).toArray(); int nscopes = scopes.size(); int s = 0; - for (s = 0; s < nscopes; ++s) { - QJsonObject o = scopes.at(s).toObject(); - if (o.value(QLatin1String("type")).toInt(-2) == 1) // CallContext - break; + if (m_targetScope != -1) { + s = m_targetScope; + } else { + for (s = 0; s < nscopes; ++s) { + QJsonObject o = scopes.at(s).toObject(); + if (o.value(QLatin1String("type")).toInt(-2) == 1) // CallContext + break; + } } if (s == nscopes) return; @@ -249,6 +254,7 @@ public: bool m_wasPaused; QV4Debugger::PauseReason m_pauseReason; bool m_captureContextInfo; + int m_targetScope = -1; QList<QV4Debugger::ExecutionState> m_statesWhenPaused; QList<TestBreakPoint> m_breakPointsToAddWhenPaused; QVector<QV4::StackFrame> m_stackTrace; @@ -274,9 +280,10 @@ public: void dumpStackTrace() const { qDebug() << "Stack depth:" << m_stackTrace.size(); - foreach (const QV4::StackFrame &frame, m_stackTrace) + for (const QV4::StackFrame &frame : m_stackTrace) { qDebug("\t%s (%s:%d:%d)", qPrintable(frame.function), qPrintable(frame.source), - frame.line, frame.column); + qAbs(frame.line), frame.column); + } } }; @@ -322,6 +329,9 @@ private slots: void readThis(); void signalParameters(); void debuggerNoCrash(); + + void breakPointInJSModule(); + private: QV4Debugger *debugger() const { @@ -329,27 +339,27 @@ private: } void evaluateJavaScript(const QString &script, const QString &fileName, int lineNumber = 1) { - QMetaObject::invokeMethod(m_engine, "evaluate", Qt::QueuedConnection, + QMetaObject::invokeMethod(m_engine.get(), "evaluate", Qt::QueuedConnection, Q_ARG(QString, script), Q_ARG(QString, fileName), Q_ARG(int, lineNumber)); - waitForSignal(m_engine, SIGNAL(evaluateFinished()), /*timeout*/0); + waitForSignal(m_engine.get(), SIGNAL(evaluateFinished()), /*timeout*/0); } - TestEngine *m_engine; + std::unique_ptr<TestEngine> m_engine; QV4::ExecutionEngine *m_v4; - TestAgent *m_debuggerAgent; - QThread *m_javaScriptThread; + std::unique_ptr<TestAgent> m_debuggerAgent; + std::unique_ptr<QThread> m_javaScriptThread; }; void tst_qv4debugger::init() { - m_javaScriptThread = new QThread; - m_engine = new TestEngine; + m_javaScriptThread = std::make_unique<QThread>(); + m_engine = std::make_unique<TestEngine>(); m_v4 = m_engine->v4Engine(); m_v4->setDebugger(new QV4Debugger(m_v4)); - m_engine->moveToThread(m_javaScriptThread); + m_engine->moveToThread(m_javaScriptThread.get()); m_javaScriptThread->start(); - m_debuggerAgent = new TestAgent(m_v4); + m_debuggerAgent = std::make_unique<TestAgent>(m_v4); m_debuggerAgent->addDebugger(debugger()); } @@ -357,11 +367,11 @@ void tst_qv4debugger::cleanup() { m_javaScriptThread->exit(); m_javaScriptThread->wait(); - delete m_engine; - delete m_javaScriptThread; + m_engine.reset(); + m_javaScriptThread.reset(); m_engine = nullptr; m_v4 = nullptr; - delete m_debuggerAgent; + m_debuggerAgent.reset(); m_debuggerAgent = nullptr; } @@ -453,7 +463,7 @@ void tst_qv4debugger::removeBreakPointForNextInstruction() "someCall();\n" "var i = 42;"; - QMetaObject::invokeMethod(m_engine, "injectFunction", Qt::BlockingQueuedConnection, + QMetaObject::invokeMethod(m_engine.get(), "injectFunction", Qt::BlockingQueuedConnection, Q_ARG(QString, "someCall"), Q_ARG(InjectedFunction, someCall)); debugger()->addBreakPoint("removeBreakPointForNextInstruction", 2); @@ -967,6 +977,35 @@ void tst_qv4debugger::debuggerNoCrash() debugThread->wait(); } +void tst_qv4debugger::breakPointInJSModule() +{ + QQmlEngine engine; + QV4::ExecutionEngine *v4 = engine.handle(); + QPointer<QV4Debugger> v4Debugger = new QV4Debugger(v4); + v4->setDebugger(v4Debugger.data()); + + QScopedPointer<QThread> debugThread(new QThread); + debugThread->start(); + QScopedPointer<TestAgent> debuggerAgent(new TestAgent(v4)); + debuggerAgent->addDebugger(v4Debugger); + debuggerAgent->moveToThread(debugThread.data()); + + QQmlComponent component(&engine, testFileUrl("breakPointInJSModule.qml")); + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + + debuggerAgent->m_captureContextInfo = true; + debuggerAgent->m_targetScope = 1; + v4Debugger->addBreakPoint("module2.mjs", 6); + + QScopedPointer<QObject> obj(component.create()); + QVERIFY(!obj.isNull()); + + QVERIFY(!debuggerAgent->m_capturedScope.isEmpty()); + + debugThread->quit(); + debugThread->wait(); +} + tst_qv4debugger::tst_qv4debugger() : QQmlDataTest(QT_QMLTEST_DATADIR) { } QTEST_MAIN(tst_qv4debugger) diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index bce2c28378..28d40d768d 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "debugutil_p.h" #include "qqmldebugprocess_p.h" diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h index 0303aa2da9..188cc14c32 100644 --- a/tests/auto/qml/debugger/shared/debugutil_p.h +++ b/tests/auto/qml/debugger/shared/debugutil_p.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef DEBUGUTIL_P_H #define DEBUGUTIL_P_H diff --git a/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp b/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp index 4944ba2e15..97477370c8 100644 --- a/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp +++ b/tests/auto/qml/debugger/shared/qqmldebugprocess.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qqmldebugprocess_p.h" @@ -56,7 +56,7 @@ QString QQmlDebugProcess::stateString() const void QQmlDebugProcess::start(const QStringList &arguments) { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // make sure m_executable points to the actual binary even if it's inside an app bundle QFileInfo binFile(m_executable); if (!binFile.isExecutable()) { diff --git a/tests/auto/qml/debugger/shared/qqmldebugprocess_p.h b/tests/auto/qml/debugger/shared/qqmldebugprocess_p.h index 56ed9b9830..94554928a5 100644 --- a/tests/auto/qml/debugger/shared/qqmldebugprocess_p.h +++ b/tests/auto/qml/debugger/shared/qqmldebugprocess_p.h @@ -1,5 +1,5 @@ // Copyright (C) 2017 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef QQMLDEBUGPROCESS_P_H #define QQMLDEBUGPROCESS_P_H diff --git a/tests/auto/qml/debugger/shared/qqmldebugtestservice.cpp b/tests/auto/qml/debugger/shared/qqmldebugtestservice.cpp index daafa8c26e..4884c9d400 100644 --- a/tests/auto/qml/debugger/shared/qqmldebugtestservice.cpp +++ b/tests/auto/qml/debugger/shared/qqmldebugtestservice.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "qqmldebugtestservice.h" #include <QThread> diff --git a/tests/auto/qml/debugger/shared/qqmldebugtestservice.h b/tests/auto/qml/debugger/shared/qqmldebugtestservice.h index 150ded9b1b..a2a3ce6161 100644 --- a/tests/auto/qml/debugger/shared/qqmldebugtestservice.h +++ b/tests/auto/qml/debugger/shared/qqmldebugtestservice.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef QQMLDEBUGTESTSERVICE_H #define QQMLDEBUGTESTSERVICE_H |