summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-102-0/+57
|\| | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I1f4795e3aa7fa248ec304659fa5e00b71c82912a
| * | lupdate: Add support for parsing C++11 raw string literalsPalo Kisa2019-01-092-0/+57
| |/ | | | | | | | | | | | | | | | | | | | | [ChangeLog][lupdate] Added support for parsing C++11 raw string literals Task-number: QTBUG-42736 Change-Id: Ia246c7e7208580182a1e0413bb38bc2c8ff3f61e Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-032-0/+6
|\| | | | | | | Change-Id: Icff4035509596e277f4612cdfa9363cdaa5371bf
| * lupdate: don't abort on prf execution errorsv5.12.0-beta4Oswald Buddenhagen2018-10-291-0/+2
| | | | | | | | | | | | | | | | | | we report all messages with a "WARNING:" prefix specifically to indicate that the errors aren't supposed to be actually fatal in this context. Fixes: QTBUG-62478 Change-Id: I010abf34a216993af0d33d614345f6f562f0a10e Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| * lconvert test: Try to avoid QProcess::waitForFinished() timeoutsFriedemann Kleint2018-10-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | Add a test for QProcess::waitForStarted() to separate out the startup time and catch startup errors, trying to avoid errors like: FAIL! : tst_lconvert::readverifies(kde context) 'cvt->waitForFinished(3000)' returned FALSE. (Process 1 hung) tst_lconvert.cpp(81) : failure location Change-Id: I8c23eae7255b39b6a7a7dc77b520fcb6c7d5e642 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | QDoc: Add more unit tests for QDocGlobalsPaul Wicking2018-10-162-16/+195
| | | | | | | | | | | | | | | | | | | | | | This change adds a set of simple unittests for QDocGlobals, aiming for close to full coverage. It also cleans up the unittest project includes to avoid unnecessary overhead or unresolved includes in tests. Fixes: QTBUG-71166 Change-Id: Ia8c81ea3b598b4eaadc56c16e0f84416aca90d6b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QDoc: Move global variables out of main.cppPaul Wicking2018-10-114-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change moves most of the global variables out of main.cpp, and into the new qdocglobals class, with getter and setter functions for each variable. It also introduces the basic structure for autotests for QDoc. The motivation is to increase the testability of QDoc, as well as to simplify any future refactoring. Change-Id: If71ba9f1837e759aa75b1c9fec326d72c41c4fcf Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Ole-Morten Duesund <olemd@odinprosjekt.no> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Extend qtattributionscanner to handle Chromium third-party contentNicolas Ettlin2018-10-022-0/+28
|/ | | | | | | | | | | qtattributionscanner is a tool used to generate the documentation for third-party modules at https://doc.qt.io/qt-5/licenses-used-in-qt.html. This commit makes qtattributionscanner parse README.chromium files, in addition to the qt_attribution.json files. Task-number: QTBUG-69285 Change-Id: Ie0e92a788efe28175387a62550ae0f32f26979f5 Reviewed-by: hjk <hjk@qt.io>
* Fix -Wold-style-castJesus Fernandez2018-07-311-5/+5
| | | | | | | | It replaces QCOMPARE with QVERIFY when comparing to booleans. Change-Id: I419edf1da0c1b205f88e672de386d7b5f2ce0627 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Unexport HelpProjectData and move it to helpgenerator app treeJarek Kobus2018-07-264-6/+16
| | | | | Change-Id: I5af687d5f7dd3fc886a33453b5613df062a8f5a2 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devFriedemann Kleint2018-07-251-1/+0
|\ | | | | | | Change-Id: I08932d5a2599831a4cc53f5a70709d7c3a27a35b
| * Make the "Copyright" field in attribution files optionalNicolas Ettlin2018-07-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Currently, the "Copyright" field in copyright attribution files is mandatory. However, this obligation should be lifted so we could later use README.chromium files with the qtattributionscanner tool (these files do not contain a Copyright field ; in these cases, the copyright owners can be found in the license file's body). Change-Id: I569f8cd5d3f20fc85e5fcb873601053327841dda Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: hjk <hjk@qt.io>