diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-01 11:04:39 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-07-01 11:54:23 +0200 |
commit | 659b575d19f318bb4d0248236ea16a9cd0a573ed (patch) | |
tree | ea931bb553aa4b4504b242b3f66dbc416fcf4018 /tests/auto/qml/qmlplugindump | |
parent | 692b2da77427259a3589cf8a1311075863f2f5ec (diff) |
qmlplugindump: dump enums also for composite types
Change-Id: I2745d3df4fca77483313c70e5433339c444c7fd4
Fixes: QTBUG-76627
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlplugindump')
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlplugindump/data/dumper/CompositeWithEnum/Animal.qml b/tests/auto/qml/qmlplugindump/data/dumper/CompositeWithEnum/Animal.qml new file mode 100644 index 0000000000..5bd7788a8c --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/CompositeWithEnum/Animal.qml @@ -0,0 +1,15 @@ +pragma Singleton +import QtQml 2.0 + +QtObject { + property string name + property string category + property string sound + property int size: Animal.SizeSmall + + enum SizeType { + SizeSmall, + SizeMedium, + SizeLarge + } +} diff --git a/tests/auto/qml/qmlplugindump/data/dumper/CompositeWithEnum/qmldir b/tests/auto/qml/qmlplugindump/data/dumper/CompositeWithEnum/qmldir new file mode 100644 index 0000000000..f08b348efa --- /dev/null +++ b/tests/auto/qml/qmlplugindump/data/dumper/CompositeWithEnum/qmldir @@ -0,0 +1,3 @@ +module dumper.CompositeWithEnum +singleton Animal 1.0 Animal.qml +depends QtQml 2.0 diff --git a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp index 17766a89b5..72356a4d84 100644 --- a/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp +++ b/tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp @@ -46,6 +46,7 @@ private slots: void builtins(); void singleton(); void compositeWithinSingleton(); + void compositeWithEnum(); void plugin_data(); void plugin(); @@ -135,6 +136,21 @@ void tst_qmlplugindump::compositeWithinSingleton() QVERIFY2(result.contains(QLatin1String("exportMetaObjectRevisions: [0]")), qPrintable(result)); } +void tst_qmlplugindump::compositeWithEnum() +{ + QProcess dumper; + QStringList args; + args << QLatin1String("dumper.CompositeWithEnum") << QLatin1String("1.0") + << QLatin1String(QT_QMLTEST_DIR "/data"); + dumper.start(qmlplugindumpPath, args); + QVERIFY2(dumper.waitForStarted(), qPrintable(dumper.errorString())); + QVERIFY2(dumper.waitForFinished(), qPrintable(dumper.errorString())); + + const QString &result = dumper.readAllStandardOutput(); + QVERIFY2(result.contains(QLatin1String("exports: [\"Animal 1.0\"]")), qPrintable(result)); + QVERIFY2(result.contains(QLatin1String("Enum {")), qPrintable(result)); +} + void tst_qmlplugindump::plugin_data() { QTest::addColumn<QString>("import"); |