diff options
Diffstat (limited to 'tests/auto/qml/debugger')
8 files changed, 64 insertions, 10 deletions
diff --git a/tests/auto/qml/debugger/CMakeLists.txt b/tests/auto/qml/debugger/CMakeLists.txt index edd268cb94..a8bb089e15 100644 --- a/tests/auto/qml/debugger/CMakeLists.txt +++ b/tests/auto/qml/debugger/CMakeLists.txt @@ -5,7 +5,7 @@ add_subdirectory(qqmldebugtranslationservice) add_subdirectory(qpacketprotocol) add_subdirectory(qqmlnativeconnector) -if(NOT CMAKE_CROSSCOMPILING) +if(NOT (CMAKE_CROSSCOMPILING OR (MACOS AND TEST_architecture_arch STREQUAL "x86_64"))) add_subdirectory(qdebugmessageservice) add_subdirectory(qqmldebugtranslationclient) add_subdirectory(qqmlenginedebugservice) @@ -23,7 +23,7 @@ if(QT_FEATURE_private_tests) add_subdirectory(qqmldebugclient) add_subdirectory(qqmldebuglocal) add_subdirectory(qv4debugger) - if(NOT CMAKE_CROSSCOMPILING) + if(NOT (CMAKE_CROSSCOMPILING OR (MACOS AND TEST_architecture_arch STREQUAL "x86_64"))) add_subdirectory(qqmldebugservice) endif() endif() diff --git a/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp b/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp index 2cdf0a5029..28dad81be6 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp +++ b/tests/auto/qml/debugger/qqmldebugtranslationclient/tst_qqmldebugtranslationclient.cpp @@ -60,9 +60,10 @@ public: } private slots: - void init() + void init() override { QQmlDebugTest::initTestCase(); + QQmlDebugTest::init(); initDebugTranslationConnection(); QVersionedPacket<QQmlDebugConnector> packet; diff --git a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp index 7519dd3043..85d4c77dd6 100644 --- a/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp +++ b/tests/auto/qml/debugger/qqmldebugtranslationservice/tst_qqmldebugtranslationservice.cpp @@ -76,8 +76,9 @@ private slots: QVERIFY(hooks->qt_qmlDebugEnableService(qPrintable(QQmlDebugTranslationServiceImpl::s_key))); } - void init() + void init() override { + QQmlDebugTest::init(); hooks->qt_qmlDebugClearBuffer(); QVERIFY(currentDebugServiceMessage().isEmpty()); } diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/data/debuggerCrashOnAttach.qml b/tests/auto/qml/debugger/qqmlenginedebugservice/data/debuggerCrashOnAttach.qml new file mode 100644 index 0000000000..ea99518425 --- /dev/null +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/data/debuggerCrashOnAttach.qml @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 2.5 + +Text { + id:text + font.weight: Font.Bold +} + diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp index bed8cb9c46..e33b9fd0e8 100644 --- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp +++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp @@ -160,6 +160,7 @@ private slots: void watch_expression_data(); void watch_context(); void watch_file(); + void debuggerCrashOnAttach(); void queryAvailableEngines(); void queryRootContexts(); @@ -355,7 +356,8 @@ void tst_QQmlEngineDebugService::initTestCase() "itemWithFunctions.qml", "rectangleWithTransitions.qml", "customTypes.qml", - "jsonTest.qml" + "jsonTest.qml", + "debuggerCrashOnAttach.qml" }; for (auto file : fileNames) { @@ -503,6 +505,7 @@ void tst_QQmlEngineDebugService::watch_object() int origWidth = m_rootItem->property("width").toInt(); int origHeight = m_rootItem->property("height").toInt(); + m_rootItem->setProperty("width", origWidth*2); QVERIFY(QQmlDebugTest::waitForSignal(m_dbg, SIGNAL(valueChanged(QByteArray,QVariant)))); m_rootItem->setProperty("height", origHeight*2); @@ -670,7 +673,7 @@ void tst_QQmlEngineDebugService::queryRootContexts() // root context query sends only root object data - it doesn't fill in // the children or property info QCOMPARE(context.objects.count(), 0); - QCOMPARE(context.contexts.count(), 7); + QCOMPARE(context.contexts.count(), 8); QVERIFY(context.contexts[0].debugId >= 0); QCOMPARE(context.contexts[0].name, QString("tst_QQmlDebug_childContext")); } @@ -1380,6 +1383,18 @@ void tst_QQmlEngineDebugService::createObjectOnDestruction() QCOMPARE(spy.count(), 2); } +void tst_QQmlEngineDebugService::debuggerCrashOnAttach() { + QQmlEngineDebugObjectReference obj = findRootObject(6); + QVERIFY(!obj.className.isEmpty()); + + bool success; + + m_dbg->addWatch(obj, &success); + QVERIFY(success); + QVERIFY(QQmlDebugTest::waitForSignal(m_dbg, SIGNAL(result()))); + QCOMPARE(m_dbg->valid(), true); +} + int main(int argc, char *argv[]) { int _argc = argc + 1; diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp index beaee6c61a..d4f205ea18 100644 --- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp +++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp @@ -298,7 +298,7 @@ public: tst_qv4debugger(); private slots: - void init(); + void init() override; void cleanup(); // breakpoints: diff --git a/tests/auto/qml/debugger/shared/debugutil.cpp b/tests/auto/qml/debugger/shared/debugutil.cpp index 4598e288c7..a4a7c2168b 100644 --- a/tests/auto/qml/debugger/shared/debugutil.cpp +++ b/tests/auto/qml/debugger/shared/debugutil.cpp @@ -34,8 +34,8 @@ #include <QtCore/qeventloop.h> #include <QtCore/qtimer.h> -QQmlDebugTest::QQmlDebugTest(const char *qmlTestDataDir) - : QQmlDataTest(qmlTestDataDir) +QQmlDebugTest::QQmlDebugTest(const char *qmlTestDataDir, FailOnWarningsPolicy failOnWarningsPolicy) + : QQmlDataTest(qmlTestDataDir, failOnWarningsPolicy) { } diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h index 3ef2c56414..e3d46135f3 100644 --- a/tests/auto/qml/debugger/shared/debugutil_p.h +++ b/tests/auto/qml/debugger/shared/debugutil_p.h @@ -48,7 +48,8 @@ class QQmlDebugTest : public QQmlDataTest { Q_OBJECT public: - QQmlDebugTest(const char *qmlTestDataDir); + QQmlDebugTest(const char *qmlTestDataDir, + FailOnWarningsPolicy failOnWarningsPolicy = FailOnWarningsPolicy::DoNotFailOnWarnings); public: static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000); |