diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-01-25 14:30:30 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-01-25 14:31:06 +0100 |
commit | 00d3f3e9da071efce92d320884b331ea559fb292 (patch) | |
tree | 0649bd5c1be5a8ca01617655ac54c6373322f14a /tests | |
parent | 5c2ba6db53b2190160081695faff521bc367e33d (diff) | |
parent | b07a6cf8c5788b7e4ca722c9aa8c06e76e688c5d (diff) |
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Change-Id: I7b6437740077a4e2c9b2c36ee1cd4eb472f1f49f
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/qqmldirparser/data/classname/qmldir | 5 | ||||
-rw-r--r-- | tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp | 9 | ||||
-rw-r--r-- | tests/auto/qmltest/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/benchmarks/qml/compilation/tst_compilation.cpp | 71 |
4 files changed, 87 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmldirparser/data/classname/qmldir b/tests/auto/qml/qqmldirparser/data/classname/qmldir new file mode 100644 index 0000000000..8167e813df --- /dev/null +++ b/tests/auto/qml/qqmldirparser/data/classname/qmldir @@ -0,0 +1,5 @@ +module QtQuick +plugin qtquick2plugin +classname QtQuick2Plugin +typeinfo plugins.qmltypes +designersupported diff --git a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp index 7d154d0ea6..3643ca65c6 100644 --- a/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp +++ b/tests/auto/qml/qqmldirparser/tst_qqmldirparser.cpp @@ -325,6 +325,15 @@ void tst_qqmldirparser::parse_data() << QStringList() << (QStringList() << "bar||1|0|true") << false; + + QTest::newRow("classname") + << "classname/qmldir" + << QStringList() + << (QStringList() << "qtquick2plugin|") + << QStringList() + << QStringList() + << QStringList() + << true; } void tst_qqmldirparser::parse() diff --git a/tests/auto/qmltest/BLACKLIST b/tests/auto/qmltest/BLACKLIST index c38347b42a..fd796fcdb4 100644 --- a/tests/auto/qmltest/BLACKLIST +++ b/tests/auto/qmltest/BLACKLIST @@ -9,3 +9,5 @@ linux linux [ListView::test_listInteractiveCurrentIndexEnforce] linux +[mouserelease::test_mouseDrag] +rhel-7.2 diff --git a/tests/benchmarks/qml/compilation/tst_compilation.cpp b/tests/benchmarks/qml/compilation/tst_compilation.cpp index 61339c6f60..b28d69332c 100644 --- a/tests/benchmarks/qml/compilation/tst_compilation.cpp +++ b/tests/benchmarks/qml/compilation/tst_compilation.cpp @@ -51,6 +51,9 @@ private slots: void jsparser_data(); void jsparser(); + void bigimport_data(); + void bigimport(); + private: QQmlEngine engine; }; @@ -115,6 +118,74 @@ void tst_compilation::jsparser() } } +void tst_compilation::bigimport_data() +{ + QTest::addColumn<int>("filesToCreate"); + QTest::addColumn<bool>("writeQmldir"); + + QTest::newRow("10, qmldir") + << 10 << true; + QTest::newRow("100, qmldir") + << 100 << true; + QTest::newRow("1000, qmldir") + << 1000 << true; + + QTest::newRow("10, noqmldir") + << 10 << false; + QTest::newRow("100, noqmldir") + << 100 << false; + QTest::newRow("1000, noqmldir") + << 1000 << false; +} + +void tst_compilation::bigimport() +{ + QFETCH(int, filesToCreate); + QFETCH(bool, writeQmldir); + QTemporaryDir d; + //d.setAutoRemove(false); // for debugging + + QString p; + { + for (int i = 0; i < filesToCreate; ++i) { + QFile f(d.path() + QDir::separator() + QString::fromLatin1("Type%1.qml").arg(i)); + QVERIFY(f.open(QIODevice::WriteOnly)); + f.write("import QtQuick 2.0\n"); + f.write("import \".\"\n"); + f.write("Item {}\n"); + } + + QFile qmldir(d.path() + QDir::separator() + "qmldir"); + if (writeQmldir) + QVERIFY(qmldir.open(QIODevice::WriteOnly)); + QFile main(d.path() + QDir::separator() + "main.qml"); + QVERIFY(main.open(QIODevice::WriteOnly)); + p = QFileInfo(main).absoluteFilePath(); + //qDebug() << p; // for debugging + + main.write("import QtQuick 2.0\n"); + main.write("import \".\"\n"); + main.write("\n"); + main.write("Item {\n"); + + for (int i = 0; i < filesToCreate; ++i) { + main.write(qPrintable(QString::fromLatin1("Type%1 {}\n").arg(i))); + if (writeQmldir) + qmldir.write(qPrintable(QString::fromLatin1("Type%1 1.0 Type%1.qml\n").arg(i))); + } + + main.write("}"); + } + + QBENCHMARK { + QQmlEngine e; + QQmlComponent c(&e, p); + QCOMPARE(c.status(), QQmlComponent::Ready); + QScopedPointer<QObject> o(c.create()); + QVERIFY(o->children().count() == filesToCreate); + } +} + QTEST_MAIN(tst_compilation) #include "tst_compilation.moc" |