aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/snippets/tst_snippets.cpp
Commit message (Collapse)AuthorAgeFilesLines
* tst_snippets: inject the style name to image file namesJ-P Nurmi2017-05-121-3/+15
| | | | | | | | | | | | | | For example, qtquickcontrols2-label.qml outputs: - qtquickcontrols2-label.png (Default) - qtquickcontrols2-material-label.png (Material) - qtquickcontrols2-universal-label.png (Universal) This allows us to take screenshots with different styles without overlapping names and error-prone manual renaming. Change-Id: Ic475ee0d95539a1122e37780f8cec038e2fc9446 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_snippets: skip style-specific screenshots when appropriatev5.9.0-beta4J-P Nurmi2017-05-041-0/+9
| | | | | | | | For example, don't take screenshots of qtquickcontrols2-material-*.qml snippets when running with another style than the Material style. Change-Id: Ifef5b841d16314ba5d131a7d56f57251d6780ae7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_snippets: take screenshots only when requestedJ-P Nurmi2017-05-031-61/+43
| | | | | | | | | | | | The component loading code has been adjusted so that it can load snippets that use either a Window root element too. This speeds up the test a lot in the CI, and allows us to flatten the snippet-structure. Set SCREENSHOTS=1 environment variable to take screenshots. Change-Id: Ibd9e76befe62044dd1374899f18ea3d8c7ad454b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Another attempt to fix tst_snippets on OS X 10.10J-P Nurmi2017-04-071-1/+1
| | | | | | | | | | | | | | | | | | | The test is sharing (and showing, and resizing) the same view for every snippet. In the CI system we keep having issues that sometimes, after running the test for a while, the window content stops being resized as appropriate. Considering that QQuickWindow resizes its content item in resizeEvent(), this probably means that in the CI the window does sometimes not receive the resize event as appropriate. Before, the window was left hanging there after taking the very first screenshot. Now we try to close the window so that each and every screenshot snippet gets loaded while the window is hidden, shows it, and waits for it to become visible/active. This will hopefully ensure that the window will always receive an "initial" resize event. Task-number: QTBUG-58606 Change-Id: If4b38443cfdc9175f313bf8e70c7daf42d34f687 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Attempt to fix tst_snippets on OS X 10.10J-P Nurmi2017-03-291-8/+7
| | | | | | | | | | Don't show the window until we start taking the screenshots and actually need a visible window. Task-number: QTBUG-58606 Change-Id: I2fcab3b54f0faf67588a21e0732d2e6dbcee9194 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* tst_snippets: share a single QQuickView instance for all data rowsJ-P Nurmi2017-01-251-3/+10
| | | | | | | | | | | | This test contains a lot of data rows. Re-creating a QQuickView for every data row puts a lot of stress on the system. In the new Open Nebula -based CI, things start consistently exploding after a random amount of tst_snippets data rows. This change fixes that. Task-number: QTBUG-58196 Change-Id: I6549944a6d7b2bd384d09ee974bee6423ffe625c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Refactor tst_snippets to make it easier to add non-screenshot snippetsMitch Curtis2016-09-261-45/+70
| | | | | | | | Add a separate test for non-screenshot snippets and move the screenshot snippets to their own folder. Change-Id: Ic3e7370321e346b83f7df42205e204d1265ce5b0 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Replace 'foreach' with 'range for'Anton Kudryavtsev2016-09-021-1/+1
| | | | | | | | And add QT_NO_FOREACH define to .qmake.conf. Now QuickControls2 is 'foreach' free. Change-Id: I98695258859decadae6fd2f23f5f6f5ef2b0550f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Don't limit snippet screenshots to *-custom.qml filesMitch Curtis2016-05-111-1/+1
| | | | | | | e4a7b9e8e changed this when it shouldn't have. Change-Id: I75d1283f9fab74e137d2fc35654eaa909c1c819d Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* customize.qdoc: Use standalone snippetsMitch Curtis2016-05-101-6/+21
| | | | | | | | So that we don't refer to internal types, as these make copying and pasting snippets difficult. Change-Id: I6f3b943d2eed48beb7a64690c707924e2c5a8078 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Introduce ToolTipJ-P Nurmi2016-03-221-2/+2
| | | | | | Change-Id: I917f7e83219788fc63389773eb07ee39757bed7f Task-number: QTBUG-51003 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* tst_Snippets: add missing "qtquick*.qml" filterJ-P Nurmi2016-03-181-1/+1
| | | | | | | | Most doc example snippet files were renamed in ca8f57f, the test needs to be updated accordingly. Change-Id: I633ace53b7aaf8853b6eae5c8c60a90c2ae38dc2 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* tests: fix license headersJ-P Nurmi2015-11-081-1/+1
| | | | | Change-Id: Id3be5a62dec38d610695d71ad792016fabdc922d Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Move the code snippets to a more logical placeJ-P Nurmi2015-10-301-2/+2
| | | | | | | | | | They are part of the documentation, but just auto-tested to ensure that they are actually creatable and don't throw warnings. Therefore the logical place is in the doc/snippets folder instead of somewhere in the tests/ tree. Change-Id: Id79a19890f7457ef277e7434a3fc6b6fb20eaa25 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Make tst_snippets fail if there are QML warningsJ-P Nurmi2015-10-161-0/+11
| | | | | Change-Id: I6680d891bd9a1c54746cc97c5eae742c1cca4e62 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Docs: SwipeViewJ-P Nurmi2015-10-141-0/+2
| | | | | | Change-Id: Iabeb3ebc54f64d2f3d0b008a5f5a16a89f701f85 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Use constBegin/End with const_iteratorFrederik Gladhorn2015-07-241-1/+1
| | | | | | | Change-Id: I9c4801ac91c52d487e98a99ff4d38e133f0679a3 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Add tst_snippetsJ-P Nurmi2015-06-271-0/+106
This is going to include all snippets used in the documentation, which will be then automatically tested for vality, and at the same time the respective screenshots are automatically generated. Notice that copying the screenshots over to src/doc/images is still a manual step. This is fully intentional because the screenshot results may vary quite a bit across different platforms due to different fonts and so on. FWIW, my personal favorite for generating the screenshots is OS X. Change-Id: I72b299f15b498abc1afd0a686c56d43159bee775 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>