aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-08-10 14:23:50 +0200
committerEike Ziller <eike.ziller@qt.io>2020-08-10 15:56:54 +0200
commit3944162039d9cea30384a0d867afab35cc3bfabf (patch)
treeec07f797055a69823f47edff588f5dc82a1dfeca /tests/auto
parent84e4b3af31364973c44ad52c8c01430d42f996a4 (diff)
parentacadee710e00cca55736db864263bdcdcbac31a6 (diff)
Merge remote-tracking branch 'origin/4.13' into master
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/cmakeprojectmanager/cmakebuildstep.cpp src/plugins/cmakeprojectmanager/cmakebuildstep.h tests/auto/debugger/tst_namedemangler.cpp tests/auto/qml/codemodel/check/tst_check.cpp Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/debugger/CMakeLists.txt9
-rw-r--r--tests/auto/debugger/debugger.pro2
-rw-r--r--tests/auto/debugger/debugger.qbs1
-rw-r--r--tests/auto/debugger/namedemangler.pro10
-rw-r--r--tests/auto/debugger/namedemangler.qbs18
-rw-r--r--tests/auto/debugger/tst_namedemangler.cpp616
-rw-r--r--tests/auto/extensionsystem/pluginmanager/tst_pluginmanager.cpp1
-rw-r--r--tests/auto/qml/codemodel/check/RequiredListProperties.qml6
-rw-r--r--tests/auto/qml/codemodel/check/RequiredListPropertiesUser.qml7
-rw-r--r--tests/auto/qml/codemodel/check/case-fallthrough.qml4
-rw-r--r--tests/auto/qml/codemodel/check/equality-checks.qml54
-rw-r--r--tests/auto/qml/codemodel/check/tst_check.cpp14
12 files changed, 55 insertions, 687 deletions
diff --git a/tests/auto/debugger/CMakeLists.txt b/tests/auto/debugger/CMakeLists.txt
index 794c43bdc6..66900623c3 100644
--- a/tests/auto/debugger/CMakeLists.txt
+++ b/tests/auto/debugger/CMakeLists.txt
@@ -32,15 +32,6 @@ add_qtc_test(tst_debugger_gdb
"${DEBUGGERDIR}/debuggerprotocol.cpp" "${DEBUGGERDIR}/debuggerprotocol.h"
)
-add_qtc_test(tst_debugger_namedemangler
- INCLUDES "${DEBUGGERDIR}"
- SOURCES
- tst_namedemangler.cpp
- "${DEBUGGERDIR}/namedemangler/globalparsestate.cpp" "${DEBUGGERDIR}/namedemangler/globalparsestate.h"
- "${DEBUGGERDIR}/namedemangler/namedemangler.cpp" "${DEBUGGERDIR}/namedemangler/namedemangler.h"
- "${DEBUGGERDIR}/namedemangler/parsetreenodes.cpp" "${DEBUGGERDIR}/namedemangler/parsetreenodes.h"
-)
-
add_qtc_test(tst_debugger_offsets
DEPENDS Qt5::CorePrivate
INCLUDES "${DEBUGGERDIR}"
diff --git a/tests/auto/debugger/debugger.pro b/tests/auto/debugger/debugger.pro
index 12a115c919..284db38b0c 100644
--- a/tests/auto/debugger/debugger.pro
+++ b/tests/auto/debugger/debugger.pro
@@ -10,7 +10,5 @@ CONFIG += ordered
SUBDIRS += gdb.pro
SUBDIRS += simplifytypes.pro
SUBDIRS += dumpers.pro
-SUBDIRS += namedemangler.pro
SUBDIRS += disassembler.pro
SUBDIRS += offsets.pro
-
diff --git a/tests/auto/debugger/debugger.qbs b/tests/auto/debugger/debugger.qbs
index 5f3fffecaf..456c604b26 100644
--- a/tests/auto/debugger/debugger.qbs
+++ b/tests/auto/debugger/debugger.qbs
@@ -7,7 +7,6 @@ Project {
"disassembler.qbs",
"dumpers.qbs",
"gdb.qbs",
- "namedemangler.qbs",
"offsets.qbs",
"simplifytypes.qbs",
]
diff --git a/tests/auto/debugger/namedemangler.pro b/tests/auto/debugger/namedemangler.pro
deleted file mode 100644
index 241e1e2759..0000000000
--- a/tests/auto/debugger/namedemangler.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-QT -= gui
-
-include(../qttest.pri)
-
-DEBUGGERDIR = $$IDE_SOURCE_TREE/src/plugins/debugger
-INCLUDEPATH += $$DEBUGGERDIR
-
-SOURCES = tst_namedemangler.cpp
-include($$DEBUGGERDIR/namedemangler/namedemangler.pri)
-
diff --git a/tests/auto/debugger/namedemangler.qbs b/tests/auto/debugger/namedemangler.qbs
deleted file mode 100644
index d6356728d6..0000000000
--- a/tests/auto/debugger/namedemangler.qbs
+++ /dev/null
@@ -1,18 +0,0 @@
-import qbs
-
-QtcAutotest {
- name: "Name demangler autotest"
-
- cpp.enableExceptions: true
-
- Group {
- name: "Sources from Debugger plugin"
- prefix: project.debuggerDir + "namedemangler/"
- files: ["*.h", "*.cpp"]
- }
- Group {
- name: "Test sources"
- files: "tst_namedemangler.cpp"
- }
- cpp.includePaths: base.concat([project.debuggerDir])
-}
diff --git a/tests/auto/debugger/tst_namedemangler.cpp b/tests/auto/debugger/tst_namedemangler.cpp
deleted file mode 100644
index 187d0312e2..0000000000
--- a/tests/auto/debugger/tst_namedemangler.cpp
+++ /dev/null
@@ -1,616 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of Qt Creator.
-**
-** 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.
-**
-****************************************************************************/
-
-#include <namedemangler/namedemangler.h>
-#include <namedemangler/parsetreenodes.h>
-
-#include <QObject>
-#include <QDebug>
-#include <QTest>
-
-#include <cctype>
-
-const QByteArray toString(char c) { return QByteArray("'") + c + "'"; }
-
-using namespace Debugger::Internal;
-using namespace QTest;
-
-class NameDemanglerAutoTest : public QObject
-{
- Q_OBJECT
-private slots:
- void testUnmangledName();
- void testDisjunctFirstSets();
- void testCorrectlyMangledNames();
- void testCorrectlyMangledNames_data();
- void testIncorrectlyMangledNames();
-
-private:
- void testIncorrectlyMangledName(const QString &mangledName);
- NameDemangler demangler;
-};
-
-void NameDemanglerAutoTest::testUnmangledName()
-{
- QVERIFY(demangler.demangle(QLatin1String("f"))
- && demangler.demangledName() == QLatin1String("f"));
-}
-
-void NameDemanglerAutoTest::testCorrectlyMangledNames()
-{
- QFETCH(QString, demangled);
- QString mangled = QString::fromLatin1(currentDataTag());
-
- QVERIFY2(demangler.demangle(mangled), qPrintable(demangler.errorString()));
- QCOMPARE(demangler.demangledName(), demangled);
-}
-
-void NameDemanglerAutoTest::testCorrectlyMangledNames_data()
-{
- addColumn<QString>("demangled");
-
- newRow("_Z1fv")
- << "f()";
- newRow("_Z1fi")
- << "f(int)";
-#ifdef Q_OS_LINUX
- newRow("_Z3foo3bar")
- << "foo(bar)";
- newRow("_Zrm1XS_")
- << "operator%(X, X)";
- newRow("_ZplR1XS0_")
- << "operator+(X &, X &)";
- newRow("_ZlsRK1XS1_")
- << "operator<<(X const &, X const &)";
- newRow("_ZN3FooIA4_iE3barE")
- << "Foo<int[4]>::bar";
- newRow("_Z5firstI3DuoEvS0_")
- << "void first<Duo>(Duo)";
- newRow("_Z5firstI3DuoEvT_")
- << "void first<Duo>(Duo)";
- newRow("_Z3fooIiPFidEiEvv")
- << "void foo<int, int (*)(double), int>()";
- newRow("_ZN1N1fE")
- << "N::f";
- newRow("_ZN6System5Sound4beepEv")
- << "System::Sound::beep()";
- newRow("_ZN5Arena5levelE")
- << "Arena::level";
- newRow("_ZN5StackIiiE5levelE")
- << "Stack<int, int>::level";
- newRow("_Z1fI1XEvPVN1AIT_E1TE")
- << "void f<X>(A<X>::T volatile *)";
- newRow("_ZngILi42EEvN1AIXplT_Li2EEE1TE")
- << "void operator-<42>(A<42 + 2>::T)";
- newRow("_Z4makeI7FactoryiET_IT0_Ev")
- << "Factory<int> make<Factory, int>()";
- newRow("_Z3foo5Hello5WorldS0_S_")
- << "foo(Hello, World, World, Hello)";
- newRow("_Z3fooPM2ABi")
- << "foo(int AB::**)";
- newRow("_ZlsRSoRKSs")
- << "operator<<(std::basic_ostream<char, std::char_traits<char> > &, "
- "std::basic_string<char, std::char_traits<char>, "
- "std::allocator<char> > const &)";
- newRow("_ZTI7a_class")
- << "typeid(a_class)";
- newRow("_ZZN1A3fooEiE1B")
- << "A::foo(int)::B";
- newRow("_ZZ3foovEN1C1DE")
- << "foo()::C::D";
- newRow("_ZZZ3foovEN1C3barEvEN1E3bazEv")
- << "foo()::C::bar()::E::baz()";
- newRow("_ZZN1N1fEiE1p")
- << "N::f(int)::p";
- newRow("_ZZN1N1fEiEs")
- << "N::f(int)::{string literal}";
- newRow("_Z41__static_initialization_and_destruction_0ii")
- << "__static_initialization_and_destruction_0(int, int)";
- newRow("_ZN20NameDemanglerPrivate3eoiE")
- << "NameDemanglerPrivate::eoi";
- newRow("_ZZN20NameDemanglerPrivate15parseIdentifierEiE8__func__")
- << "NameDemanglerPrivate::parseIdentifier(int)::__func__";
- newRow("_ZN4QSetI5QCharED1Ev")
- << "QSet<QChar>::~QSet()";
- newRow("_Zne5QCharS_")
- << "operator!=(QChar, QChar)";
- newRow("_ZN20NameDemanglerPrivate17parseFunctionTypeEv")
- << "NameDemanglerPrivate::parseFunctionType()";
- newRow("_ZNK20NameDemanglerPrivate16ArrayNewOperator8makeExprERK11QStringList")
- << "NameDemanglerPrivate::ArrayNewOperator::makeExpr(QStringList const &) const";
- newRow("_ZN13QLatin1StringC1EPKc")
- << "QLatin1String::QLatin1String(char const *)";
- newRow("_ZN15QtSharedPointer16ExternalRefCountIN20NameDemanglerPrivate8OperatorEE12internalCopyIS2_EEvRKNS0_IT_EE")
- << "void QtSharedPointer::ExternalRefCount<NameDemanglerPrivate::Operator>"
- "::internalCopy<NameDemanglerPrivate::Operator>(QtSharedPointer"
- "::ExternalRefCount<NameDemanglerPrivate::Operator> const &)";
- newRow("_ZN15QtSharedPointer16ExternalRefCountIN20NameDemanglerPrivate8OperatorEE11internalSetEPNS_20ExternalRefCountDataEPS2_")
- << "QtSharedPointer::ExternalRefCount<NameDemanglerPrivate::Operator>"
- "::internalSet(QtSharedPointer::ExternalRefCountData *, NameDemanglerPrivate::Operator *)";
- newRow("_ZN20NameDemanglerPrivate17parseUnscopedNameEv")
- << "NameDemanglerPrivate::parseUnscopedName()";
- newRow("_ZNK7QString3argExiiRK5QChar")
- << "QString::arg(long long, int, int, QChar const &) const";
- newRow("_ZN20NameDemanglerPrivate8OperatorC2ERK7QStringS3_")
- << "NameDemanglerPrivate::Operator::Operator(QString const &, QString const &)";
- newRow("_ZN15QtSharedPointer16ExternalRefCountIN20NameDemanglerPrivate8OperatorEEC2EN2Qt14InitializationE")
- << "QtSharedPointer::ExternalRefCount<NameDemanglerPrivate::Operator>::ExternalRefCount(Qt::Initialization)";
- newRow("_ZN7QString5clearEv")
- << "QString::clear()";
- newRow("_ZNK5QListI7QStringE2atEi")
- << "QList<QString>::at(int) const";
- newRow("_ZNK7QString10startsWithERKS_N2Qt15CaseSensitivityE")
- << "QString::startsWith(QString const &, Qt::CaseSensitivity) const";
- newRow("_ZNK4QSetI5QCharE8constEndEv")
- << "QSet<QChar>::constEnd() const";
- newRow("_Z11qt_assert_xPKcS0_S0_i")
- << "qt_assert_x(char const *, char const *, char const *, int)";
- newRow("_ZN9QHashData8willGrowEv")
- << "QHashData::willGrow()";
- newRow("_ZNK5QHashI5QChar15QHashDummyValueE14const_iteratorneERKS3_")
- << "QHash<QChar, QHashDummyValue>::const_iterator::operator!="
- "(QHash<QChar, QHashDummyValue>::const_iterator const &) const";
- newRow("_ZNK13NameDemangler11errorStringEv")
- << "NameDemangler::errorString() const";
- newRow("_ZN7QString7replaceERK7QRegExpRKS_")
- << "QString::replace(QRegExp const &, QString const &)";
- newRow("_ZN7QString4freeEPNS_4DataE")
- << "QString::free(QString::Data *)";
- newRow("_ZTSN20NameDemanglerPrivate19ArrayAccessOperatorE")
- << "typeid(NameDemanglerPrivate::ArrayAccessOperator).name()";
- newRow("_ZN3ns11fERKPFPKiS1_RKhE")
- << "ns1::f(int const * (* const &)(int const *, unsigned char const &))";
- newRow("_Z9test_funcMN3ns11cImEEKFPKvPiRlmE")
- << "test_func(void const * (ns1::c<unsigned long>::*)(int *, long &, unsigned long) const)";
- newRow("_ZN3ns11fEPKPFPKiS1_RKhE")
- << "ns1::f(int const * (* const *)(int const *, unsigned char const &))";
- newRow("_ZNK1CcviEv")
- << "C::operator int() const";
- newRow("_ZN1CppEv")
- << "C::operator++()";
- newRow("_ZN1CmmEv")
- << "C::operator--()";
- newRow("_ZN1CppEi")
- << "C::operator++(int)";
- newRow("_ZN1CmmEi")
- << "C::operator--(int)";
- newRow("_ZNK1CcvT_IPKcEEv")
- << "C::operator char const *<char const *>() const";
- newRow("_Z9weirdfuncIiEvT_KPFS0_S0_E")
- << "void weirdfunc<int>(int, int (* const)(int))";
- newRow("_Z9weirdfuncIiEvT_PFS0_DtfL1p_EE")
- << "void weirdfunc<int>(int, int (*)(decltype({param#1})))";
- newRow("_Z9weirdfuncIiEvT_S0_")
- << "void weirdfunc<int>(int, int)";
- newRow("_Z9weirdfuncIiEvT_DtfL0p_E")
- << "void weirdfunc<int>(int, decltype({param#1}))";
- newRow("_Z9weirdfuncIiEvT_S0_S0_")
- << "void weirdfunc<int>(int, int, int)";
- newRow("_Z9weirdfuncIiEvT_S0_DtfL0p0_E")
- << "void weirdfunc<int>(int, int, decltype({param#2}))";
- newRow("_Z8toStringIiESsT_")
- << "std::basic_string<char, std::char_traits<char>, std::allocator<char> > toString<int>(int)";
-
- newRow("_Z4funcIRA5_iEvOT_")
- << "void func<int (&)[5]>(int (&)[5])";
- newRow("_ZSt9make_pairIiRA5_KcESt4pairINSt17__decay_and_stripIT_E6__typeENS4_IT0_E6__typeEEOS5_OS8_")
- << "std::pair<std::__decay_and_strip<int>::__type, "
- "std::__decay_and_strip<char const (&)[5]>::__type> "
- "std::make_pair<int, char const (&)[5]>(int &&, char const (&)[5])";
-
- // All examples from the ABI spec.
- newRow("_ZN1S1xE")
- << "S::x";
- newRow("_Z1fM1AKFvvE")
- << "f(void (A::*)() const)";
- newRow("_Z1fIiEvT_")
- << "void f<int>(int)";
- newRow("_Z3fooc")
- << "foo(char)";
- newRow("_Z2CBIL_Z3foocEE")
- << "CB<foo(char)>";
- newRow("_Z2CBIL_Z7IsEmptyEE")
- << "CB<IsEmpty>";
- newRow("_ZZ1giEN1S1fE_2i")
- << "g(int)::S::f(int)";
- newRow("_ZZ1gvEN1SC1Ev")
- << "g()::S::S()";
- newRow("_ZZZ1gvEN1SC1EvEs")
- << "g()::S::S()::{string literal}";
- newRow("_ZZ1gvE5str4a")
- << "g()::str4a";
- newRow("_ZZ1gvEs_1")
- << "g()::{string literal}";
- newRow("_ZZ1gvE5str4b")
- << "g()::str4b";
- newRow("_Z1fPFvvEM1SFvvE")
- << "f(void (*)(), void (S::*)())";
- newRow("_ZN1N1TIiiE2mfES0_IddE")
- << "N::T<int, int>::mf(N::T<double, double>)";
- newRow("_ZSt5state")
- << "std::state";
- newRow("_ZNSt3_In4wardE")
- << "std::_In::ward";
- newRow("_Z1fN1SUt_E")
- << "f(S::{unnamed type#1})";
- newRow("_ZZZ1giEN1S1fE_2iEUt1_")
- << "g(int)::S::f(int)::{unnamed type#3}";
- newRow("_ZZZ1giEN1S1fE_2iENUt1_2fxEv")
- << "g(int)::S::f(int)::{unnamed type#3}::fx()";
- newRow("_Z1AIcfE")
- << "A<char, float>";
- newRow("_Z1fIiEvT_PDtfL0pK_E")
- << "void f<int>(int, decltype({param#1 const}) *)";
- newRow("_Z1AILln42EE")
- << "A<-42L>";
- newRow("_Z2f1I1QEDTpldtfp_1xdtL_Z1qE1xET_")
- << "decltype({param#1}.x + q.x) f1<Q>(Q)";
- newRow("_Z2f2I1QEDTpldtfp_1xsrS0_1xET_")
- << "decltype({param#1}.x + Q::x) f2<Q>(Q)";
- newRow("_Z2f3IiEDTplfp_dtL_Z1dEsr1B1XIT_EE1xES1_")
- << "decltype({param#1} + d.B::X<int>::x) f3<int>(int)";
- newRow("_Z3fooILi2EEvRAplT_Li1E_i")
- << "void foo<2>(int (&)[2 + 1])";
- newRow("_ZZ1giENKUlvE_clEv")
- << "g(int)::{lambda()#1}::operator()() const";
- newRow("_ZZ1giENKUlvE0_clEv")
- << "g(int)::{lambda()#2}::operator()() const";
- newRow("_ZNK1SIiE1xMUlvE_clEv")
- << "S<int>::x::{lambda()#1}::operator()() const";
- newRow("_ZN1S4funcEii")
- << "S::func(int, int)";
-
- // Note: c++filt from binutils 2.22 demangles these wrong (counts default arguments from first instead of from last)
- newRow("_ZZN1S1fEiiEd0_NKUlvE_clEv")
- << "S::f(int, int)::{default arg#1}::{lambda()#1}::operator()() const";
- newRow("_ZZN1S1fEiiEd0_NKUlvE0_clEv")
- << "S::f(int, int)::{default arg#1}::{lambda()#2}::operator()() const";
- newRow("_ZZN1S1fEiiEd_NKUlvE_clEv")
- << "S::f(int, int)::{default arg#2}::{lambda()#1}::operator()() const";
-
- // Note: gcc 4.6.3 encodes this as "_Z2f4I7OpClassEDTadsrT_miES1_".
- newRow("_Z2f4I7OpClassEDTadsrT_onmiES0_")
- << "decltype(&OpClass::operator-) f4<OpClass>(OpClass)";
-#else
- qDebug("Most tests disabled outside Linux");
-#endif
-}
-
-void NameDemanglerAutoTest::testIncorrectlyMangledNames()
-{
-}
-
-void NameDemanglerAutoTest::testDisjunctFirstSets()
-{
- for (char c = 0x20; c < 0x7e; ++c) {
-
- // <encoding>
- QVERIFY(!NameNode::mangledRepresentationStartsWith(c)
- || !SpecialNameNode::mangledRepresentationStartsWith(c));
-
- // <name>
- QVERIFY(!NestedNameNode::mangledRepresentationStartsWith(c)
- || !UnscopedNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!NestedNameNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!NestedNameNode::mangledRepresentationStartsWith(c)
- || !LocalNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!UnscopedNameNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c) || c == 'S');
- QVERIFY(!UnscopedNameNode::mangledRepresentationStartsWith(c)
- || !LocalNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!SubstitutionNode::mangledRepresentationStartsWith(c)
- || !LocalNameNode::mangledRepresentationStartsWith(c));
-
- // <nested-name>
- QVERIFY(!CvQualifiersNode::mangledRepresentationStartsWith(c)
- || !PrefixNode::mangledRepresentationStartsWith(c) || c == 'r');
-
- // <prefix>
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateArgsNode::mangledRepresentationStartsWith(c)
- || !UnqualifiedNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !UnqualifiedNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!SubstitutionNode::mangledRepresentationStartsWith(c)
- || !UnqualifiedNameNode::mangledRepresentationStartsWith(c));
-
- // <template-arg>
- QVERIFY(!TypeNode::mangledRepresentationStartsWith(c)
- || !ExprPrimaryNode::mangledRepresentationStartsWith(c));
-
- // <expression>
- QVERIFY(!OperatorNameNode::mangledRepresentationStartsWith(c)
- || !TemplateParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!OperatorNameNode::mangledRepresentationStartsWith(c)
- || !FunctionParamNode::mangledRepresentationStartsWith(c));
- QVERIFY2(!OperatorNameNode::mangledRepresentationStartsWith(c)
- || !UnresolvedNameNode::mangledRepresentationStartsWith(c)
- || c == 'd' || c == 'g' || c == 'o' || c == 's', toString(c).constData());
- QVERIFY(!OperatorNameNode::mangledRepresentationStartsWith(c)
- || !ExprPrimaryNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !FunctionParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !ExprPrimaryNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !FunctionParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !UnresolvedNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionParamNode::mangledRepresentationStartsWith(c)
- || !UnresolvedNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionParamNode::mangledRepresentationStartsWith(c)
- || !ExprPrimaryNode::mangledRepresentationStartsWith(c));
-
- // <expr-primary>
- QVERIFY(!TypeNode::mangledRepresentationStartsWith(c)
- || !MangledNameRule::mangledRepresentationStartsWith(c));
-
- // <type>
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !FunctionTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY2(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !ClassEnumTypeRule::mangledRepresentationStartsWith(c) || c == 'D', toString(c).constData());
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !ArrayTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !PointerToMemberTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !TemplateParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !CvQualifiersNode::mangledRepresentationStartsWith(c));
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c) || c == 'D');
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith(c)
- || !ClassEnumTypeRule::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith(c)
- || !ArrayTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith(c)
- || !PointerToMemberTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith(c)
- || !TemplateParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith(c)
- || !CvQualifiersNode::mangledRepresentationStartsWith(c));
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ClassEnumTypeRule::mangledRepresentationStartsWith(c)
- || !ArrayTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ClassEnumTypeRule::mangledRepresentationStartsWith(c)
- || !PointerToMemberTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ClassEnumTypeRule::mangledRepresentationStartsWith(c)
- || !TemplateParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ClassEnumTypeRule::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ClassEnumTypeRule::mangledRepresentationStartsWith(c)
- || !CvQualifiersNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ClassEnumTypeRule::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c) || c == 'D');
- QVERIFY(!ArrayTypeNode::mangledRepresentationStartsWith(c)
- || !PointerToMemberTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ArrayTypeNode::mangledRepresentationStartsWith(c)
- || !TemplateParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ArrayTypeNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ArrayTypeNode::mangledRepresentationStartsWith(c)
- || !CvQualifiersNode::mangledRepresentationStartsWith(c));
- QVERIFY(!ArrayTypeNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!PointerToMemberTypeNode::mangledRepresentationStartsWith(c)
- || !TemplateParamNode::mangledRepresentationStartsWith(c));
- QVERIFY(!PointerToMemberTypeNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!PointerToMemberTypeNode::mangledRepresentationStartsWith(c)
- || !CvQualifiersNode::mangledRepresentationStartsWith(c));
- QVERIFY(!PointerToMemberTypeNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !CvQualifiersNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!SubstitutionNode::mangledRepresentationStartsWith(c)
- || !CvQualifiersNode::mangledRepresentationStartsWith(c));
- QVERIFY(!SubstitutionNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!CvQualifiersNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c));
-
- // <unqualified-name>
- QVERIFY(!OperatorNameNode::mangledRepresentationStartsWith(c)
- || !CtorDtorNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!OperatorNameNode::mangledRepresentationStartsWith(c)
- || !SourceNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!OperatorNameNode::mangledRepresentationStartsWith(c)
- || !UnnamedTypeNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!CtorDtorNameNode::mangledRepresentationStartsWith(c)
- || !SourceNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!CtorDtorNameNode::mangledRepresentationStartsWith(c)
- || !UnnamedTypeNameNode::mangledRepresentationStartsWith(c));
- QVERIFY(!SourceNameNode::mangledRepresentationStartsWith(c)
- || !UnnamedTypeNameNode::mangledRepresentationStartsWith(c));
-
- // <array-type>
- QVERIFY(!NonNegativeNumberNode<10>::mangledRepresentationStartsWith(c)
- || !ExpressionNode::mangledRepresentationStartsWith(c) || std::isdigit(c));
-
- // <unresolved-type>
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !DeclTypeNode::mangledRepresentationStartsWith(c));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
- QVERIFY(!DeclTypeNode::mangledRepresentationStartsWith(c)
- || !SubstitutionNode::mangledRepresentationStartsWith(c));
-
- // <desctructor-name>
- QVERIFY(!UnresolvedTypeRule::mangledRepresentationStartsWith(c)
- || !SimpleIdNode::mangledRepresentationStartsWith(c));
- }
-
- // <template-args>, <template-arg>
- QVERIFY(!TemplateArgNode::mangledRepresentationStartsWith('E'));
-
- // <template-arg>
- QVERIFY(!TypeNode::mangledRepresentationStartsWith('X')
- && !TypeNode::mangledRepresentationStartsWith('J')
- /* && !TypeNode::mangledRepresentationStartsWith('s') */);
- QVERIFY(!ExprPrimaryNode::mangledRepresentationStartsWith('X')
- && !ExprPrimaryNode::mangledRepresentationStartsWith('J')
- && !ExprPrimaryNode::mangledRepresentationStartsWith('s'));
-
- // <expression>
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith('c')
- && !TemplateParamNode::mangledRepresentationStartsWith('s')
- && !TemplateParamNode::mangledRepresentationStartsWith('a'));
- QVERIFY(!FunctionParamNode::mangledRepresentationStartsWith('c')
- && !FunctionParamNode::mangledRepresentationStartsWith('c')
- && !FunctionParamNode::mangledRepresentationStartsWith('c'));
- QVERIFY(!ExprPrimaryNode::mangledRepresentationStartsWith('c')
- && !ExprPrimaryNode::mangledRepresentationStartsWith('s')
- && !ExprPrimaryNode::mangledRepresentationStartsWith('a'));
- QVERIFY(!ExpressionNode::mangledRepresentationStartsWith('E'));
- QVERIFY(!ExpressionNode::mangledRepresentationStartsWith('_'));
- QVERIFY(!InitializerNode::mangledRepresentationStartsWith('E'));
-
- // <type>
- QVERIFY(!BuiltinTypeNode::mangledRepresentationStartsWith('P')
- && !BuiltinTypeNode::mangledRepresentationStartsWith('R')
- && !BuiltinTypeNode::mangledRepresentationStartsWith('O')
- && !BuiltinTypeNode::mangledRepresentationStartsWith('C')
- && !BuiltinTypeNode::mangledRepresentationStartsWith('G')
- && !BuiltinTypeNode::mangledRepresentationStartsWith('U'));
- QVERIFY(!FunctionTypeNode::mangledRepresentationStartsWith('P')
- && !FunctionTypeNode::mangledRepresentationStartsWith('R')
- && !FunctionTypeNode::mangledRepresentationStartsWith('O')
- && !FunctionTypeNode::mangledRepresentationStartsWith('C')
- && !FunctionTypeNode::mangledRepresentationStartsWith('G')
- && !FunctionTypeNode::mangledRepresentationStartsWith('U')
- && !FunctionTypeNode::mangledRepresentationStartsWith('D'));
- QVERIFY(!ClassEnumTypeRule::mangledRepresentationStartsWith('P')
- && !ClassEnumTypeRule::mangledRepresentationStartsWith('R')
- && !ClassEnumTypeRule::mangledRepresentationStartsWith('O')
- && !ClassEnumTypeRule::mangledRepresentationStartsWith('C')
- && !ClassEnumTypeRule::mangledRepresentationStartsWith('G')
- && !ClassEnumTypeRule::mangledRepresentationStartsWith('U')
- /* && !firstSetClassEnumType.contains('D') */);
- QVERIFY(!ArrayTypeNode::mangledRepresentationStartsWith('P')
- && !ArrayTypeNode::mangledRepresentationStartsWith('R')
- && !ArrayTypeNode::mangledRepresentationStartsWith('O')
- && !ArrayTypeNode::mangledRepresentationStartsWith('C')
- && !ArrayTypeNode::mangledRepresentationStartsWith('G')
- && !ArrayTypeNode::mangledRepresentationStartsWith('U')
- && !ArrayTypeNode::mangledRepresentationStartsWith('D'));
- QVERIFY(!PointerToMemberTypeNode::mangledRepresentationStartsWith('P')
- && !PointerToMemberTypeNode::mangledRepresentationStartsWith('R')
- && !PointerToMemberTypeNode::mangledRepresentationStartsWith('O')
- && !PointerToMemberTypeNode::mangledRepresentationStartsWith('C')
- && !PointerToMemberTypeNode::mangledRepresentationStartsWith('G')
- && !PointerToMemberTypeNode::mangledRepresentationStartsWith('U')
- && !PointerToMemberTypeNode::mangledRepresentationStartsWith('D'));
- QVERIFY(!TemplateParamNode::mangledRepresentationStartsWith('P')
- && !TemplateParamNode::mangledRepresentationStartsWith('R')
- && !TemplateParamNode::mangledRepresentationStartsWith('O')
- && !TemplateParamNode::mangledRepresentationStartsWith('C')
- && !TemplateParamNode::mangledRepresentationStartsWith('G')
- && !TemplateParamNode::mangledRepresentationStartsWith('U')
- && !TemplateParamNode::mangledRepresentationStartsWith('D'));
- QVERIFY(!SubstitutionNode::mangledRepresentationStartsWith('P')
- && !SubstitutionNode::mangledRepresentationStartsWith('R')
- && !SubstitutionNode::mangledRepresentationStartsWith('O')
- && !SubstitutionNode::mangledRepresentationStartsWith('C')
- && !SubstitutionNode::mangledRepresentationStartsWith('G')
- && !SubstitutionNode::mangledRepresentationStartsWith('U')
- && !SubstitutionNode::mangledRepresentationStartsWith('D'));
- QVERIFY(!CvQualifiersNode::mangledRepresentationStartsWith('P')
- && !CvQualifiersNode::mangledRepresentationStartsWith('R')
- && !CvQualifiersNode::mangledRepresentationStartsWith('O')
- && !CvQualifiersNode::mangledRepresentationStartsWith('C')
- && !CvQualifiersNode::mangledRepresentationStartsWith('G')
- && !CvQualifiersNode::mangledRepresentationStartsWith('U')
- && !CvQualifiersNode::mangledRepresentationStartsWith('D'));
- QVERIFY(!DeclTypeNode::mangledRepresentationStartsWith('P')
- && !DeclTypeNode::mangledRepresentationStartsWith('R')
- && !DeclTypeNode::mangledRepresentationStartsWith('O')
- && !DeclTypeNode::mangledRepresentationStartsWith('C')
- && !DeclTypeNode::mangledRepresentationStartsWith('G')
- && !DeclTypeNode::mangledRepresentationStartsWith('U'));
-
- // <array-type>
- QVERIFY(!NonNegativeNumberNode<10>::mangledRepresentationStartsWith('_'));
- QVERIFY(!ExpressionNode::mangledRepresentationStartsWith('_'));
-
- // <substitution>
- QVERIFY(!NonNegativeNumberNode<36>::mangledRepresentationStartsWith('_')
- && !NonNegativeNumberNode<36>::mangledRepresentationStartsWith('t')
- && !NonNegativeNumberNode<36>::mangledRepresentationStartsWith('a')
- && !NonNegativeNumberNode<36>::mangledRepresentationStartsWith('b')
- && !NonNegativeNumberNode<36>::mangledRepresentationStartsWith('s')
- && !NonNegativeNumberNode<36>::mangledRepresentationStartsWith('i')
- && !NonNegativeNumberNode<36>::mangledRepresentationStartsWith('o')
- && !NonNegativeNumberNode<36>::mangledRepresentationStartsWith('d'));
-
- // <special-name>
- QVERIFY(!CallOffsetRule::mangledRepresentationStartsWith('V')
- && !CallOffsetRule::mangledRepresentationStartsWith('T')
- && !CallOffsetRule::mangledRepresentationStartsWith('I')
- && !CallOffsetRule::mangledRepresentationStartsWith('S')
- && !CallOffsetRule::mangledRepresentationStartsWith('c'));
-
- // <unscoped-name>
- QVERIFY(!UnqualifiedNameNode::mangledRepresentationStartsWith('S'));
-
- // <prefix>
- QVERIFY(!TemplateArgsNode::mangledRepresentationStartsWith('M'));
- QVERIFY(!UnqualifiedNameNode::mangledRepresentationStartsWith('M'));
-
- // <base-unresolved-name>
- QVERIFY(!SimpleIdNode::mangledRepresentationStartsWith('o'));
- QVERIFY(!SimpleIdNode::mangledRepresentationStartsWith('d'));
-
- // <initializer>
- QVERIFY(!ExpressionNode::mangledRepresentationStartsWith('E'));
-
- // <unresolved-name-node>
- QVERIFY(!BaseUnresolvedNameNode::mangledRepresentationStartsWith('g'));
- QVERIFY(!BaseUnresolvedNameNode::mangledRepresentationStartsWith('s'));
- QVERIFY(!UnresolvedTypeRule::mangledRepresentationStartsWith('N'));
- QVERIFY(!UnresolvedQualifierLevelRule::mangledRepresentationStartsWith('N'));
- QVERIFY(!UnresolvedQualifierLevelRule::mangledRepresentationStartsWith('E'));
-}
-
-void NameDemanglerAutoTest::testIncorrectlyMangledName(
- const QString &mangledName)
-{
- QVERIFY(!demangler.demangle(mangledName));
-}
-
-QTEST_MAIN(NameDemanglerAutoTest)
-
-#include "tst_namedemangler.moc"
diff --git a/tests/auto/extensionsystem/pluginmanager/tst_pluginmanager.cpp b/tests/auto/extensionsystem/pluginmanager/tst_pluginmanager.cpp
index c3c144a16c..7d47a6496a 100644
--- a/tests/auto/extensionsystem/pluginmanager/tst_pluginmanager.cpp
+++ b/tests/auto/extensionsystem/pluginmanager/tst_pluginmanager.cpp
@@ -77,6 +77,7 @@ static QString pluginFolder(const QLatin1String &folder)
void tst_PluginManager::init()
{
m_pm = new PluginManager;
+ m_pm->setSettings(new QSettings);
m_pm->setPluginIID(QLatin1String("plugin"));
m_objectAdded = new QSignalSpy(m_pm, SIGNAL(objectAdded(QObject*)));
m_aboutToRemoveObject = new QSignalSpy(m_pm, SIGNAL(aboutToRemoveObject(QObject*)));
diff --git a/tests/auto/qml/codemodel/check/RequiredListProperties.qml b/tests/auto/qml/codemodel/check/RequiredListProperties.qml
new file mode 100644
index 0000000000..38c604e463
--- /dev/null
+++ b/tests/auto/qml/codemodel/check/RequiredListProperties.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.15
+
+Item {
+ required property list<Item> listA
+ default required property list<Rectangle> listDefault
+}
diff --git a/tests/auto/qml/codemodel/check/RequiredListPropertiesUser.qml b/tests/auto/qml/codemodel/check/RequiredListPropertiesUser.qml
new file mode 100644
index 0000000000..d8ac85d27c
--- /dev/null
+++ b/tests/auto/qml/codemodel/check/RequiredListPropertiesUser.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.15
+
+RequiredListProperties {
+ Rectangle {}
+ Rectangle {}
+ listA: [Item {}, Item {}]
+}
diff --git a/tests/auto/qml/codemodel/check/case-fallthrough.qml b/tests/auto/qml/codemodel/check/case-fallthrough.qml
index a1851da564..186d58df4b 100644
--- a/tests/auto/qml/codemodel/check/case-fallthrough.qml
+++ b/tests/auto/qml/codemodel/check/case-fallthrough.qml
@@ -2,7 +2,7 @@ import QtQuick 2.0
Item {
x: {
- switch (a) {
+ switch (a) { // 108 17 17
case 1:
case 2:
x = 1
@@ -21,7 +21,7 @@ Item {
break
case 9:
}
- switch (a) {
+ switch (a) { // 108 17 17
case 1:
case 2: // 20 9 12
x = 1
diff --git a/tests/auto/qml/codemodel/check/equality-checks.qml b/tests/auto/qml/codemodel/check/equality-checks.qml
index e92b1c4cc1..1e815e7148 100644
--- a/tests/auto/qml/codemodel/check/equality-checks.qml
+++ b/tests/auto/qml/codemodel/check/equality-checks.qml
@@ -1,4 +1,4 @@
-import Qt 4.7
+import QtQuick 1.0
Rectangle {
function foo(k) {
@@ -10,54 +10,54 @@ Rectangle {
var b = true
var o = {}
- if (s == s) {}
+ if (s == s) {} // -1 15 16 # false positive
if (s == n) {} // 126 15 16
- if (s == N) {} // ### should warn: always false
- if (s == u) {} // ### should warn: always false
+ if (s == N) {} // -2 15 16 # wrong warning (always false)
+ if (s == u) {} // -2 15 16 # wrong warning (always false)
if (s == b) {} // 126 15 16
if (s == o) {} // 126 15 16
if (s == k) {} // 126 15 16
if (n == s) {} // 126 15 16
- if (n == n) {}
- if (n == N) {} // ### should warn: always false
- if (n == u) {} // ### should warn: always false
+ if (n == n) {} // -1 15 16 # false positive
+ if (n == N) {} // -2 15 16 # wrong warning (always false)
+ if (n == u) {} // -2 15 16 # wrong warning (always false)
if (n == b) {} // 126 15 16
if (n == o) {} // 126 15 16
if (n == k) {} // 126 15 16
- if (N == s) {} // ### should warn: always false
- if (N == n) {} // ### should warn: always false
- if (N == N) {}
- if (N == u) {} // ### should warn: always true
- // ### should warn: always false
- if (N == b) {} // 126 15 16
- if (N == o) {} // ### should warn: always false
+ if (N == s) {} // -2 15 16 # wrong warning (always false)
+ if (N == n) {} // -2 15 16 # wrong warning (always false)
+ if (N == N) {} // -1 15 16 # false positive
+ if (N == u) {} // -2 15 16 # wrong warning (always true)
+
+ if (N == b) {} // -2 15 16 # wrong warning (always false)
+ if (N == o) {} // -2 15 16 # wrong warning (always false)
if (N == k) {} // 126 15 16
- if (u == s) {} // ### should warn: always false
- if (u == n) {} // ### should warn: always false
- if (u == N) {} // ### should warn: always true
- if (u == u) {} // ### should warn: always true
- if (u == b) {} // ### should warn: always false
- if (u == o) {} // ### should warn: always false
+ if (u == s) {} // -2 15 16 # wrong warning (always false)
+ if (u == n) {} // -2 15 16 # wrong warning (always false)
+ if (u == N) {} // -2 15 16 # wrong warning (always true)
+ if (u == u) {} // -2 15 16 # wrong warning (always true)
+ if (u == b) {} // -2 15 16 # wrong warning (always false)
+ if (u == o) {} // -2 15 16 # wrong warning (always false)
if (u == k) {} // 126 15 16
if (b == s) {} // 126 15 16
if (b == n) {} // 126 15 16
- // ### should warn: always false
- if (b == N) {} // 126 15 16
- if (b == u) {} // ### should warn: always false
- if (b == b) {}
+
+ if (b == N) {} // -2 15 16 # wrong warning (always false)
+ if (b == u) {} // -2 15 16 # wrong warning (always false)
+ if (b == b) {} // -1 15 16 # false positive
if (b == o) {} // 126 15 16
if (b == k) {} // 126 15 16
if (o == s) {} // 126 15 16
if (o == n) {} // 126 15 16
- if (o == N) {} // ### should warn: always false
- if (o == u) {} // ### should warn: always false
+ if (o == N) {} // -2 15 16 # wrong warning (always false)
+ if (o == u) {} // -2 15 16 # wrong warning (always false)
if (o == b) {} // 126 15 16
- if (o == o) {}
+ if (o == o) {} // -1 15 16 # false positive
if (o == k) {} // 126 15 16
if (k == s) {} // 126 15 16
diff --git a/tests/auto/qml/codemodel/check/tst_check.cpp b/tests/auto/qml/codemodel/check/tst_check.cpp
index 38342f6267..ca5c6a5e86 100644
--- a/tests/auto/qml/codemodel/check/tst_check.cpp
+++ b/tests/auto/qml/codemodel/check/tst_check.cpp
@@ -131,9 +131,10 @@ void tst_Check::test()
QList<Message> messages = checker();
std::sort(messages.begin(), messages.end(), &offsetComparator);
- const QRegularExpression messagePattern(" (\\d+) (\\d+) (\\d+)");
+ const QRegularExpression messagePattern(" (-?\\d+) (\\d+) (\\d+)\\s*(# false positive|# wrong warning.*)?");
QList<Message> expectedMessages;
+ QHash<int, QString> xfails;
for (const SourceLocation &comment : doc->engine()->comments()) {
const QString text = doc->source().mid(comment.begin(), comment.end() - comment.begin());
const QRegularExpressionMatch match = messagePattern.match(text);
@@ -151,6 +152,9 @@ void tst_Check::test()
columnStart),
message.type = static_cast<QmlJS::StaticAnalysis::Type>(type);
expectedMessages += message;
+
+ if (messagePattern.captureCount() == 4 && !match.captured(4).isEmpty())
+ xfails.insert(expectedMessages.size() - 1, match.captured(4));
}
for (int i = 0; i < messages.size(); ++i) {
@@ -160,6 +164,9 @@ void tst_Check::test()
Message expected = expectedMessages.at(i);
bool fail = false;
fail |= !QCOMPARE_NOEXIT(actual.location.startLine, expected.location.startLine);
+ auto xFail = xfails.find(i);
+ if (xFail != xfails.end())
+ QEXPECT_FAIL(path.toUtf8(), xFail.value().toUtf8(), Continue);
fail |= !QCOMPARE_NOEXIT((int)actual.type, (int)expected.type);
if (fail)
return;
@@ -176,7 +183,10 @@ void tst_Check::test()
Message missingMessage = expectedMessages.at(i);
qDebug() << "expected message of type" << missingMessage.type << "on line" << missingMessage.location.startLine;
}
- QFAIL("more messages expected");
+ if (path.endsWith("avoid-var.qml"))
+ QEXPECT_FAIL(path.toUtf8(), "currently broken", Continue);
+
+ QVERIFY2(false, "more messages expected");
}
if (expectedMessages.size() < messages.size()) {
for (int i = expectedMessages.size(); i < messages.size(); ++i) {