summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* qdoc: Sort the members of shared comment node collectiveTopi Reinio2020-01-242-7/+7
| | | | | | | | | Nodes sharing a comment will be listed together as a group, so sort them alphabetically. Fixes: QTBUG-81265 Change-Id: Ia8dcba92d74116bf6757bfc9aaded1c65d7271fd Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Fix regression in QML types inheriting property groupsTopi Reinio2020-01-244-0/+91
| | | | | | | | | | | | | | | | | | Property groups from base types were not listed on 'All Members' pages of a QML type. This was because we skipped all shared comment nodes for base types; property group is a special type of SCN. Remove duplication in the code that distributes the nodes; this ensures that there is no difference in output between members of a type and members inherited from its base types. Use logging category to display debug warnings instead of qDebug(). Add a test to cover this. Fixes: QTBUG-81262 Change-Id: I46c3e6afa87c510a7929088acbd1fb354f6733af Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Change test function positions to match their declaration orderLevon Sargsyan2020-01-061-24/+23
| | | | | Change-Id: I82bd549f93ce19b029c0e3c7220652e569ee07dc Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Use html5 charset declarationPaul Wicking2020-01-0525-25/+25
| | | | | | | | | | | | As we claim the html is html5 compliant (<!doctype html>), use the html5 charset declaration instead of html 4.01 style. Also, drop the trailing '/' (no need to close meta element). Update all test content to match the new output. Task-number: QTBUG-73026 Change-Id: I4cf58a342a2bfb9e76245bd3fb91525e6e59f622 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Drop xml prolog from html outputPaul Wicking2020-01-0525-25/+0
| | | | | | | | | | The html output is not well-formed xml, so let's not claim that it is. Update expected output in tests to reflect the change in output. Task-number: QTBUG-73026 Change-Id: I0e6646eb33cafad7be543869585609d6f4cb0fdb Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Fix regression in C++ functions sharing a documentation commentTopi Reinio2020-01-056-2/+35
| | | | | | | | | | | | | After a recent refactoring, the function that distributes c++ documentation nodes failed to do anything with a function node that was sharing a comment with other nodes. Fix the issue and add a testcase for shared c++ \fn documentation comments. Fixes: QTBUG-81005 Change-Id: I6320bab232671f8cd969a37136708fc172de8409 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add an autotest for QDoc's example manifest fileTopi Reinio2019-12-203-0/+35
| | | | | | | | Add a test that verifies the content of the examples-manifest.xml, with some metadata, and a QHP namespace defined. Change-Id: I91bc25ee10e1054c823ec1d14cccb6d9c6ca36d9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Fix regression in output for QML properties with shared commentsTopi Reinio2019-12-1610-89/+157
| | | | | | | | | | | | | | | | | | QDoc was incorrectly assuming that QML properties that share a comment must belong to a property group. Fix the issue, reduce duplication of code with functions that output properties and methods, fix the 'id' attributes that were left empty, and remove the <a name="..."> elements that are obsolete and unnecessary now that 'id' has correct content. Add a test for both properties and methods that share a comment, and fix the expected output data for above changes. Fixes: QTBUG-80768 Change-Id: Iddfca8214b6058987c76cd8f8dd6a842ce7cea89 Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add binary compatibility files for qttools 5.14 branchMilla Pohjanheimo2019-12-163-0/+62061
| | | | | | | BC files built against 5.14.0 added. Change-Id: I460c304049a7794083f6b516530c0faf0b6fa2e8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Factor out the formatting of the "since" textThibaut Cuvelier2019-12-132-3/+3
| | | | | | Change-Id: I3ec3342eb3362664c605c4120238566d87c8b176 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Add tests to cover webXML generationPaul Wicking2019-12-1318-0/+384
| | | | | | | | | | This patch adds new tests and test data for covering webxml generation from plain qdoc, as well as from cpp and qml projects. Fixes: QTBUG-79003 Change-Id: I416e88cb4d0ee5c9a27c5096f4fd0d534a4ba50c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc tests: add convenience functionLevon Sargsyan2019-12-131-0/+8
| | | | | | | | Allow tests to remove full paths from strings to circumvent hard-coded paths in output. Change-Id: I4270f201649e9e5145b1ce75d2d372605a95579d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Make testAndCompare() take an output directory as parameterLevon Sargsyan2019-12-111-4/+16
| | | | | | | | | | | | | This patch introduces an extra parameter to testAndCompare(), that allows comparing expected vs actual in the provided output directory. This is necessary for further refactoring of the test, so each test point will use its own directory for its expected output. This will help to avoid name collisions. Change-Id: I6c539ac7e2ec9dae06d8f03ef30f1c218de50ac9 Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Improve QDoc autotest for QML documentationTopi Reinio2019-12-0622-5/+945
| | | | | | | | | | | | Fix the previous test that never generated any QML type documentation, and add new test types, documented in .cpp, .qdoc, and inline in .qml. Use all available \qml-specific QDoc commands. Fixes: QTBUG-80154 Change-Id: I60d9762836b986ca534c664517274517b73c085d Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add regression test for class name sortingLevon Sargsyan2019-12-0412-0/+219
| | | | | | | | | | | | This patch adds a regression test to cover QTBUG-80259 by adding new test data to the existing end-2-end qdoc test suite. The test is covering class name sorting functionality during documentation generation. Change-Id: I6421981596f4d72e8b0ce8351e85a8e5b3856b45 Fixes: QTBUG-80456 Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qtdiag: Disable autotest for all cross-built platformsFriedemann Kleint2019-10-281-2/+1
| | | | | | | | | | Timeouts have been observed on arm-little_endian-ilp32-eabi-hardfloat shared (dynamic). Change-Id: I6e6525c961e8b2611a8f5485175a42a83facd723 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QDoc: Remove QDocGlobalsPaul Wicking2019-10-143-216/+1
| | | | | | | | | | | | | | | | | | This change moves the setting of configuration options from QDocGlobals to Config. This allows for the removal of the entire QDocGlobals class. Some methods (getters/setters) are part of the move, others were used exclusively by Config:: and are therefore dropped entirely. Also, move the ownership of QDocCommandLineParser from main() to Config - this makes Config the authoritative source of all settings, whether from the command line or .qdocconf variables, and makes it possible to reset() the full state of the Config. Finally, remove the QDocGlobals auto-test, as it is no longer needed. Change-Id: I8e39931c828c763cb0462cbbdf3fe1a39b2ad70b Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add new input data to test \reimp commandLevon Sargsyan2019-10-148-1/+112
| | | | | | | | | | | | The purpose of this change is to test the documentation that is generated for comments that use QDoc's \reimp command. This is done by adding a new virtual method to the Test class, and a new inherited class that implements it. Change-Id: If2367362475cc3daf31004dec43e8e15076acfb5 Reviewed-by: Levon Sargsyan <levon.sargsyan@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add new test data for htmlFromCpp test-pointLevon Sargsyan2019-10-036-2/+89
| | | | | | | | | | | | | This change introduces several data updates for the test htmlFromCpp, that will help us prevent possible regressions in the future. Enhancements include: 1. CPP function with default arguments. 2. Usage of \qtvariable to produce appropriate qmake instructions. 3. Obsolete and deprecated members. Change-Id: I9e1d346b43f515f649004d180d1ddead67df97b4 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: generatedoutput autotest: Test more C++ -related commandsTopi Reinio2019-09-304-1/+24
| | | | | | | | | | | | | | | Improve the coverage of C++ test with the following cases: * \macro taking an argument * A non-related member (above macro) associated with a class * \inheaderfile command * \since command Fix incorrect expected output since fixing the bug mentioned in the task number. Task-number: QTBUG-77960 Change-Id: I6010cab9ab0a86a1897a38a397b8d7ba8155f95a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add a test case for QDoc's link commandTopi Reinio2019-09-276-3/+67
| | | | | | | | | Validate different ways of linking to other documentation topics. Fix the incorrect expected output in the existing tests. Task-number: QTBUG-78040 Change-Id: Idb6bf9c79ec99894e2fe0ddb7e65150204c96627 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: generatedoutput autotest: Display filename on test failureTopi Reinio2019-09-231-1/+2
| | | | | | | | In addition to line number, display also the name of the tested file on failure. Change-Id: Icea00c94e176265bd3d91b6e7301b514bea88048 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add an initial test case for C++ documentation generated by QDocTopi Reinio2019-09-059-0/+306
| | | | | | | | | This will be expanded later on. The minimal C++ project tests QDoc's HTML output for a module page, namespace and class reference, and some class members. Change-Id: Ifabc394116b675152d3ac95dc96a46e6e9c768ec Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Improve QDoc's generatedOutput autotestTopi Reinio2019-09-051-56/+50
| | | | | | | | | | | Streamline the process of adding new tests/files, by adding a helper function to both run QDoc and compare the generated output with expected data. Add a way to pass extra command line parameters to QDoc. Change-Id: I04870c18ae3d31ae07115d3d8f5d3c77d090418a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-173-0/+61899
|\ | | | | | | Change-Id: Ic45d5c30f6bf9972dee4112f8feeac3b717576aa
| * Binary compatibility file against Qt5.13.0 for QtToolsMilla Pohjanheimo2019-08-143-0/+61899
| | | | | | | | | | | | | | BC files added. Change-Id: I5ff442b4d389bc03ed829b9a896194025fff114c Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | Use correct name in test functionPaul Wicking2019-08-151-2/+2
| | | | | | | | | | | | | | | | The test actually tests content from a .qdoc-file, not from .cpp. Use correct name in test to avoid future confusion. Change-Id: Iffd21a927f3b17b0df94c14c71bd84a9e21cd7dd Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | QDoc: Set default Config options in Config's constructorPaul Wicking2019-08-141-28/+0
| | | | | | | | | | | | | | | | | | | | | | Move the setting of configuration defaults from QDocCommandLineParser::process() to Config::Config(). In the process, eliminate QDocGlobals::defaults() and its test. Task-number: QTBUG-71176 Change-Id: I97adbfd93b0c31130aab6cfcb10dfe7ffa458b9d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QDoc: Add smoke test for QML component outputPaul Wicking2019-07-2611-4/+106
| | | | | | | | | | | | | | | | | | This change adds a simple smoke test using the QML component documentation example as test data. Task-number: QTBUG-71168 Change-Id: Ieb4af0ff69e044cf3eed10297db62edaf066d933 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QDoc: Refactor testPaul Wicking2019-07-257-115/+133
| | | | | | | | | | | | | | | | | | Refactor test to make it easier to extend. Task-number: QTBUG-71168 Change-Id: Ic5a011b1b15cb3576e4101fb4875abde757dc986 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-162-0/+13
|\| | | | | | | Change-Id: I51fa8c90923e9730d7787e763fad996db51d350e
| * lrelease: Fix crash on projects without TRANSLATIONS assignmentJoerg Bornemann2019-07-102-0/+13
| | | | | | | | | | | | | | | | Add missing nullptr check. Fixes: QTBUG-76930 Change-Id: I2dc99db43b12cebc6fbe9024057ba963e0ae470f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-111-1/+4
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: If0d8f3f1dc3be742bb2fadb7873eabdd6f46d3d1
| * Disable tests not working for Android and WinRTKai Koehne2019-07-051-1/+4
| | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-73626 Fixes: QTBUG-73627 Fixes: QTBUG-73628 Fixes: QTBUG-73629 Fixes: QTBUG-73630 Change-Id: I14b5521ed28e8352e3bcef82103243159ff36073 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-06-031-0/+2
|\| | | | | | | Change-Id: If3e9d398478be4b2dda863061454e75842d349bf
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-021-0/+2
| |\ | | | | | | | | | Change-Id: I5eb7c358e80cbd25b5bbab1ef03f781c16367b63
| | * Test that extraction of translations works from .qrc files with QtQuickCompilerSimon Hausmann2019-05-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | After commit f01e72a82b59c214ce4b0a6ecefb604bc66ddd3e in qtdeclarative, we can test this scenario now. Task-number: QTBUG-75501 Change-Id: I64baa98da6b17c24b1e309c4dc93525a4fa8d057 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | tests: remove uses of Q_FOREACHMarc Mutz2019-05-235-29/+38
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All pretty straight-forward, except two: - in tst_QHelpPrjectData::filterSections(), use QCOMPARE() on two lists instead of running it by hand. To allow for variation in order, sort the list under test, and make sure the reference list is sorted, too. - in tst_QHelpEngineCore::files(), the trailing printing of 'lst' was dead code: either the QCOMPARE succeeded, then 'lst' was empty, or it failed, in which case QCOMPARE exits the function. The loop was obviously meant to show the remaining items in case the test fails, so stuff the loop (w/o Q_FOREACH) into a scope guard. QtC tricked me into believing that these were the only occurrences in this module. Alas, it just failed to parse large parts of the module's pro-files. The module continues to be one of the worst offenders w.r.t. Q_FOREACH with qdoc and linguist each containing ~150 instances, as well as macdeploy with a another dozen or two. The rest is clean now. Change-Id: I89f37ef07ab284da7881d624d9111e89cd2b2cbc Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* | qdoc: Avoid generating invalid htmlMartin Smith2019-04-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test qdoc file and qdocconf file provided with QTBUG-74903 gets qdoc to generate the html file shown below. The line "<li>Test Guide</li>" is invalid html. It is meant to be part of the navigation bar. This update prevents the generation of that line, when the navigationbar Text object is empty when the invalid line is about to be added. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- test.qdoc --> <title>Test Guide | Testing</title> </head> <body> <li>Test Guide</li> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <much of html file deleted> </body> </html> The test input html file actually contained an invalid line that qdoc generated erroneously. This update just removes that invalid line. Task-number: QTBUG-74903 Change-Id: I9e8d742676ac8c7c536c73c8f5b98d27aafbd3c7 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-04-2425-17/+136
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qdoc/qmlmarkupvisitor.h src/qdoc/qmlvisitor.h tests/auto/qtattributionsscanner/testdata/good/expected.json Done-With: Kai Koehne <kai.koehne@qt.io> Change-Id: I180ee214d1e5999fc1279b092bd9214b6bf8f858
| * Convert \r into a numerical entityLucie Gerard2019-04-021-2/+2
| | | | | | | | | | | | Task-number: QTBUG-41562 Change-Id: If03df28095212f2ee9f74eeaf03c50a6f1203415 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * lupdate: Do not touch a translated file without target languageLucie Gerard2019-04-0218-14/+89
| | | | | | | | | | | | | | | | | | | | [ChangeLog][lupdate] lupdate will now generate an error if it is asked to update a .ts file with translations, but without a target language. This is to ensure that plural translations are not destroyed. Fixes: QTBUG-53775 Change-Id: I646c1f2ec42a32dbc1a4676ad784887613607b78 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * Add forward looking after ColonLucie Gerard2019-04-012-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Colons seen are remembered in order to identify a member or base class identifier. In case of declaration of a bit field, the colon should be ignored. If it is not, unexpected behaviors compromise the resolution of the context, when the context is not explicit in the tr() function. To differentiate between colons in a member or base class identifier, and colons in a bit field, this patch implements a heuristic: We parse forward to either a '{', or a ';'. If it is a semicolon we assume it's a bit field, if it is a curved open bracket we assume the colon is for a member or base class identifier. Related auto test in case of bitfields declaration added. Task-number: QTBUG-55479 Change-Id: I2ca1124c192e4ab16fd449afc634a5de5023f481 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * qtattributionsscanner: Add "PackageComment" fieldKai Koehne2019-03-255-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new field that can be used for general purpose comments about the package, not to be included in the generated qdoc documentation. JSON does not support comments as a first-class concept. A common workaround is to use duplicated key entries, so that the first one can be used as a comment field. Anyhow, this is arguably a hack and not common knowledge. The name is inspired by the "PackageComment" field in SPDX. The new feature should already be made part of 5.12 so we can clean up version information that recently became more prominently visible as part of the qdoc title - see https://doc.qt.io/qt-5/licenses-used-in-qt.html Change-Id: Icfe843d1d725618114442687222c24122d0dd6b9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | QtTools: replace deprecated QLayout::margin() with contentsMargins()Christian Ehrlicher2019-02-113-3/+3
| | | | | | | | | | | | | | | | QLayout::margin()/setMargin() is deprecated - replace it with it's successors contentsMargins()/setContentsMargins() Change-Id: I8b6a36f3e0d0e00186a7d9cdf4827cf06f302235 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-189-0/+61379
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/assistant/help/qhelpcollectionhandler.cpp Change-Id: If1408a5893bc9ade9088e01c00aab695eff131aa
| * Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-01-189-0/+61379
| |\ | | | | | | | | | Change-Id: I8ea54fdacbda23e07d79a543e3c70c0a02cf5092
| | * Move QML documentation example to QDoc testsPaul Wicking2018-12-236-0/+630
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The import and types contained in the example ends up in reference overviews. This causes confusion among users. The example serves its purpose better as a QML project to generate documentation from as tests for QDoc. Moving the example to tests/auto/qdoc will exclude it from ending up in the online docs. This will also keep the git history cleaner than readding the same files as a separate commit later on. Task-number: QTBUG-43904 Change-Id: I6e080d50319f235916cbd8e1dda3da7dba1dccd1 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| | * Add binary compatibility files for QtTools for Qt 5.12Milla Pohjanheimo2018-12-183-0/+60749
| | | | | | | | | | | | | | | | | | | | | Binary compatibility files added. Change-Id: I62bc7eb3f791ceab63b492dcf62d1111653ebb1c Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
* | | Add simple smoke test for QDocPaul Wicking2019-01-156-0/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a simple QDoc project that makes use of a subset of QDoc's commands in a .qdoc file, and a data set containing the expected output when qdoc runs on this project. The idea is to generate output that can be compared across versions of QDoc itself. Task-number: QTBUG-71168 Change-Id: Idaba28d3fdfd5dbedfcd2ce4cc4d8e9361bd2008 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>