diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp | 7 | ||||
-rw-r--r-- | tests/auto/extras/data/tst_piemenu.qml | 26 |
2 files changed, 32 insertions, 1 deletions
diff --git a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp index 8405c98b..67aeb586 100644 --- a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp +++ b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp @@ -110,7 +110,12 @@ void tst_customcontrolsstyle::style() void tst_customcontrolsstyle::changeStyle() { qputenv("QT_QUICK_CONTROLS_1_STYLE", "Base"); - qputenv("QML2_IMPORT_PATH", QFile::encodeName(directory())); + QByteArray importPath = qgetenv("QML2_IMPORT_PATH"); + if (importPath.isEmpty()) + importPath = QFile::encodeName(directory()); + else + importPath.prepend(QFile::encodeName(directory()) + QDir::listSeparator().toLatin1()); + qputenv("QML2_IMPORT_PATH", importPath); QQmlEngine engine; diff --git a/tests/auto/extras/data/tst_piemenu.qml b/tests/auto/extras/data/tst_piemenu.qml index dbb3db38..1e0e224e 100644 --- a/tests/auto/extras/data/tst_piemenu.qml +++ b/tests/auto/extras/data/tst_piemenu.qml @@ -256,6 +256,8 @@ Item { actionSignalSpy.clear(); } } + + pieMenuComponent.destroy() } function test_selectionAngle_data() { @@ -387,6 +389,8 @@ Item { mouseMove(root, data.mouseX, data.mouseY); compare(pieMenu.selectionAngle, data.expectedAngle); compare(pieMenu.currentIndex, data.expectedCurrentIndex); + + pieMenuComponent.destroy() } function test_sectionAngles_data() { @@ -430,6 +434,8 @@ Item { compare(pieMenu.__protectedScope.sectionStartAngle(data.section), data.expectedSectionStartAngle); compare(pieMenu.__protectedScope.sectionCenterAngle(data.section), data.expectedSectionCenterAngle); compare(pieMenu.__protectedScope.sectionEndAngle(data.section), data.expectedSectionEndAngle); + + pieMenuComponent.destroy() } function test_bounds_data() { @@ -507,6 +513,8 @@ Item { // Angles shouldn't change. compare(pieMenu.__style.startAngle, originalStartAngle); compare(pieMenu.__style.endAngle, originalEndAngle); + + pieMenuComponent.destroy() } function test_hideItem_data() { @@ -571,6 +579,8 @@ Item { actionSignalSpy.clear(); } + + pieMenuComponent.destroy() } function test_addItem() { @@ -606,6 +616,8 @@ Item { pieMenu.removeItem(pieMenu.menuItems[pieMenu.menuItems.length - 1]); compare(pieMenu.menuItems.length, originalLength - (i + 1)); } + + pieMenuComponent.destroy() } function debugMousePosition(pieMenu, mouseX, mouseY, positionText) { @@ -688,6 +700,8 @@ Item { compare(pieMenu.currentIndex, expectedCurrentIndex, data[i].name + ": current index should be " + expectedCurrentIndex + " when mouse is at " + mouseX + ", " + mouseY); } + + pieMenuComponent.destroy() } function test_QTRD3027() { @@ -718,6 +732,8 @@ Item { mouseMove(root, 100, 98) compare(pieMenu.currentIndex, -1) compare(selectedAngleChangedSpy.count, 0) + + pieMenuComponent.destroy() } function test_rotatedBoundingItem() { @@ -742,6 +758,8 @@ Item { mouseClick(root, 230, 145); compare(actionSignalSpy.count, 1); compare(actionSignalSpy.signalArguments[0][0], 0); + + pieMenuComponent.destroy() } function test_boundingItem() { @@ -773,6 +791,8 @@ Item { container.width = oldContainerWidth; container.height = oldContainerHeight; + + pieMenuComponent.destroy() } function test_longPressTriggerOnClick() { @@ -803,6 +823,8 @@ Item { compare(pieMenu.visible, false); compare(pieMenu.__mouseThief.receivedPressEvent, false); compare(pieMenu.__protectedScope.pressedIndex, -1); + + pieMenuComponent.destroy() } function test_keepMenuOpenWhenTriggered() { @@ -833,6 +855,8 @@ Item { tryCompare(pieMenu, "visible", true); compare(actionSignalSpy.count, 1); compare(actionSignalSpy.signalArguments[0][0], 2); + + pieMenuComponent.destroy() } function test_pressedIndex() { @@ -856,6 +880,8 @@ Item { compare(actionSignalSpy.count, 1); compare(actionSignalSpy.signalArguments[0][0], 0); compare(pieMenu.__protectedScope.pressedIndex, -1); + + pieMenuComponent.destroy() } } } |