summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Revert "qdoc: Prefer CMake example project files over qmake .pro files"Kai Koehne2020-10-291-1/+0
| | | | | | | | | | | | This reverts commit 687bf591414017644ead1923c5bcc2059a6a2e29. While we want to advocate using CMake, the support for iOS (and partially Android) is not completely there yet. To be able to offer the best cross-platform experience with examples we therefore should stay with .pro files as default. Fixes: QTCREATORBUG-24858 Change-Id: I5acc54a2435b6aef0d9a0193538aa335a606c302 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Fix issues in \include commandTopi Reinio2020-10-288-0/+21
| | | | | | | | | | | | | | - 'sources' configuration variable was not considered when searching for file to include. - An empty QString was pushed to the location stack in DocParser::include(), resulting in vague warning messages - The search algorithm chose the first path that ended in the filename to find, with the potential of incorrectly choosing 'foobar.cpp' over 'bar.cpp'. Fixes: QTBUG-86844 Change-Id: If180ffe0817b2e786356b49f7e679e158fbc407d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Fix handling of \fn signatures with unnamed parametersTopi Reinio2020-10-2716-45/+56
| | | | | | | | | | | | | | | | A misplaced 'i++' caused an error where names of documented parameters were shifted around if one or more of the parameters were unnamed. Fixing the above uncovered issues with handling of \fn commands with [tag] argument; improve and simplify related code. Finally, avoid redundant space characters when generating signatures with unnamed parameters or in 'All Members' page where parameter names are omitted. Fixes: QTBUG-87855 Change-Id: I526c89c10c66572b8c71106660f43346a4751e4e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add macdeployqt autotestMorten Johan Sørvig2020-10-237-2/+355
| | | | | | | | | | | | Add testing framework and test that builds, deploys, and verifies deployment of simple and complex app bundles. Based on the windeployqt autotest. Change-Id: If02321daa77bde3a787372656a5816df78f4b13e Pick-to: 5.15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix compiler warnings from deprecated QLibraryInfo::locationVolker Hilsheimer2020-10-235-5/+5
| | | | | Change-Id: I5ae779a77458ef92e1a8a134d1bf912e2d43185c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Re-enable tst_windeployqtFriedemann Kleint2020-10-211-2/+0
| | | | | | | | After qttools/b346eba0a1b73b9798f4ad66cc81d0bfca712bd6, it should pass. Change-Id: I7a2c97d5018bc779bd3a375fa8ea3d401d6e132b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* qdoc: Add 'private signal' attribute for private signalsTopi Reinio2020-10-202-2/+2
| | | | | Change-Id: Ifa2682c8bc3864dfd11abbb475b064e74c105a52 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Fix parsing of private signalsTopi Reinio2020-10-206-0/+35
| | | | | | | | | | | Parameters with a type QPrivateSignal were already removed when constructing a FunctionNode from header declaration. This was erraneously subtracted from the number of stored parameters when parsing an \fn command. Fixes: QTBUG-87731 Change-Id: I01409c0fcdab0dfbf8a0b9d22cded99618bdcc2d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Allow documenting implicitly generated special member functionsTopi Reinio2020-10-1617-1/+163
| | | | | | | | | | | | | | | | | Implicitly generated class members such as default constructor are not visible in the Clang AST, and QDoc failed to match \fn commands for such functions. Fix this by visiting the translation unit generated for the \fn command, and constructing a temporary FunctionNode. If this temporary node is of any of the special member types that can be implicit, add that function as a child to the class node. Add 'default' attribute for such functions in the generated docs. Fixes: QTBUG-86984 Change-Id: I6c662e4ca030d80b68dd22f3639526093c27c20b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Store group membership for all node types into index filesTopi Reinio2020-10-126-11/+30
| | | | | | | | | | | | | | | | | | | | | Up until now, only select node types (PageNodes) stored the information about \ingroup command argument(s) into the index file. This meant that generating lists that contain non-page nodes (e.g. functions) did not produce correct results, if group members included non-page nodes from other modules. Add a helper function QDocDatabase::groupNamesForNode() that returns a list of groups regardless of node type, and use that when generating the index file. [ChangeLog][qdoc] QDoc's \generatelist and \annotatedlist commands now produce correct output when listing functions from external documentation modules. Fixes: QTBUG-87161 Change-Id: Id3079729891ec22716e4b7606bec604a7ebff74a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Fix processing of related non-members read from indexTopi Reinio2020-10-123-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | QDoc writes a node using \relates twice into the index; once under the original (lexical) parent (typically, the global scope), and again under the adoptive parent specified with \relates. This is by design, as it allows searching for the node under both scopes. However, when the nodes are read back in, what was originally a single node was duplicated. This caused issues e.g. when that node is part of a group; when generating a list for a group, a line representing the node appeared twice. Use Aggregate::adoptChild() when reading nodes from index, instead of constructing multiple nodes. This is similar to what the code parser does when processing the \relates command. To identify an index entry appearing twice as a representation of a single node, repurpose the "related" attribute to track the index of each related node. Fixes: QTBUG-87311 Change-Id: I2aa8a97b9be26ee3945b3e4ce222b0f8dc4ca8b5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: generatedOutput autotest: Don't regenerate files twiceTopi Reinio2020-10-091-1/+4
| | | | | | | | | | | One of the steps (crossModuleLinking), calls another step to generate its .index file. This caused also those files to be copied twice when -regenerate option was set. Disable the regeneration flag for the step. Change-Id: Ia3ed90c014a8ec89db18a7e7168a4bc167d4b82b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Document friend functions as related non-membersTopi Reinio2020-10-0814-0/+134
| | | | | | | | | | | | | | | | | | When parsing a friend declaration in a class, QDoc associated the subsequent function declarations to the namespace scope. This was conceptually correct as friend functions are not class members, but made it impossible to match documentation to these functions using the \fn command; the functions are still found under the class scope in Clang AST, and this has to align with QDoc's node tree for the documentation to be matched correctly. Fix this by letting friend functions remain in the class, keeping track of the friend declarations, and marking friend functions automatically as related non-members. Fixes: QTBUG-86987 Change-Id: I0ad26eed1c72af9302c9e420f5db0ec98c40d86a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Fix regression in handling config variables defined as emptyTopi Reinio2020-10-051-0/+1
| | | | | | | | | | Config::getString() must return an empty but non-null QString for a variable that is defined as empty. Fixes: QTBUG-87127 Change-Id: Iaf8e92096f67a47c46a80736d04826b4242c6109 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Move separator into utilitiesPaul Wicking2020-10-051-0/+74
| | | | | | | | | Also remove some unused includes where I update includes in any case. Fixes: QTBUG-87081 Change-Id: Id63a3c58f9088a8f312468ff1ce0e8fd59f29de2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* lupdate: Make good:proparsing test compilableJoerg Bornemann2020-10-0110-18/+11
| | | | | | | | This is necessary to make this test pass with the clang-based lupdate. Task-number: QTBUG-87090 Change-Id: I1ea085c1d37375ffb161176f23fba51450986867 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-0120-22/+22
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I84f5fc4eb26f95d81ce5b5b8cc72706bb9185026 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* tst_lupdate: Print message where the sub-tests are runningJoerg Bornemann2020-09-301-1/+1
| | | | | | | | Removing the not particularly useful "Checking..." message, and print instead the working directory for lupdate. Change-Id: Iddd0107783152dba183908f88d4854e79bd9ec7e Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* QDoc: Turn QdocTagFiles into TagFileWriter to unify designPaul Wicking2020-09-283-2/+265
| | | | | | | | | | | | | | Remove the generateTagFile wrapper from QDocDatabase. Let the HtmlGenerator accesses the TagFileWriter directly. Drop being a singleton for the sake of being a singleton, as it is clearly not needed. Add test case to expected output test as part of refactoring. Task-number: QTBUG-71176 Fixes: QTBUG-86999 Change-Id: I0f7b3caa1249679c9676327417d675ca164e7a40 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: DocBook generator: Remove code for encoding special charactersTopi Reinio2020-09-272-2/+2
| | | | | | | | | QXmlStreamWriter already handles this for us. Pick-to: 5.15 Fixes: QTBUG-86988 Change-Id: I6aafbf880e79fc4e0a7600f272ae298929577da8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Test documentation for a macro parameter with a reference typeTopi Reinio2020-09-2610-29/+29
| | | | | | Task-number: QTBUG-86010 Change-Id: Ibc70cb2ecf4233b84c4043684e8487d9fe7a7f89 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: include QML import + major version number in keywordMarco Benelli2020-09-261-0/+8
| | | | | | | | | | | The QML import and major version number is needed to disambiguate components with the same name that belongs to distincts modules. The unqualified keyword is kept for retro-compatibility. Task-number: QTBUG-61876 Change-Id: Id886f8fb6ecbad7a9cccd05025709ba6eab13093 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc tests: Extend example manifest testPaul Wicking2020-09-267-1/+15
| | | | | | | | Add componentset.qml file. Add tag that can get stripped out by manifestwriter. Change-Id: Ie64fe0cdd29089a6b809fa7a9704f5c81edd1bdd Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Fix printing of generated output test failuresTor Arne Vestbø2020-09-241-2/+2
| | | | | | | Make it a lot easier to read the qdoc output when a failure occurs. Change-Id: I28477681926c7dbd5e5e1e019f173f41617ff56e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Manage logging category in utilities.h/cppTor Arne Vestbø2020-09-246-14/+5
| | | | | Change-Id: I39ec66fbe95edc42a3dac51e8bc718ee42cc4a2a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Test the C++ property macros in QDoc's generatedoutput autotestTopi Reinio2020-09-2310-0/+608
| | | | | | | | | | | | | | | In order to test the Q_PROPERTY macros, we need to provide include paths to QtCore for the test. Generate a list of include files when running qmake or CMake, stored in a file, and load that file as extra command line arguments when running QDoc. Skip the test if that file is not available at the time of test execution. Fixes: QTBUG-85565 Change-Id: Ibe7ec4a454441c15320b3a7e1ff8ebefb44c2f5e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate projects before API changeAlexandru Croitor2020-09-221-0/+10
| | | | | | | Task-number: QTBUG-86815 Change-Id: I5b7f85344ebe2bf4baf36c5e29975051ce1a72ff Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QDoc: Fix deprecation warning in testPaul Wicking2020-09-181-1/+1
| | | | | Change-Id: Id49e23c5711d1d03319e772f7942634765731116 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: ClangCodeParser: Improve function argument matchingTopi Reinio2020-09-187-0/+88
| | | | | | | | | | | | | | | | | | | | In certain cases, Clang returns a parameter type for a function argument that differs in the header declation and source definition. This can happen if the type has an alias in a different namespace, both namespaces are visible to the source file, and both the type and the alias are included in the pre-compiled header. Resolve these cases by recording the canonical spelling of the header type into Parameter, and comparing it to the canonical spelling from the source file. Remove findFunctionNodeForCursor() as redundant. This makes the fix apply both for /*! */ comments preceding function bodies, as well as separate \fn commands. Fixes: QTBUG-86665 Change-Id: I47566f90adb956095537115ff8e8fcd9c0adffbe Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: generatedOutput autotest: Use shared defaults for file extensionsTopi Reinio2020-09-183-6/+3
| | | | | Change-Id: I7bf3535bd37bc2e60f9131fe2cbedf798080db29 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QtHelp: Reverse the default state for readonly property for help engineJarek Kobus2020-09-163-0/+9
| | | | | | | | | | | | | | | | From now the read only property is true by default. The old workaround with setting the dynamic property '_q_readonly' to true for the help engine should still work, so the change shouldn't break the user code with the workaround. This fixes the most common usage of QtHelp, when help engine is used for read only help collection files. Task-number: QTBUG-83268 Task-number: QTBUG-82126 Task-number: QTBUG-84745 Change-Id: Iee6fd18269d68f43633a5fecbb65abc60c99091a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QDoc: Make Generator::fileBase staticPaul Wicking2020-09-041-1/+1
| | | | | | Task-number: QTBUG-86390 Change-Id: I8de913513c7ab8ed0e77984b6023ec62b0cebd15 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Warn about missing example propertiesPaul Wicking2020-09-0416-10/+20
| | | | | | | | [ChangeLog][qdoc] QDoc now warns about missing example properties. Fixes: QTBUG-37648 Change-Id: I0ab857e71ae3449ee976dc57e09b82d14d47fb0f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Add Config::showInternal()Paul Wicking2020-09-021-0/+1
| | | | | | | | | Add simple getter to avoid unnecessary calls to Config::getBool(CONFIG_SHOWINTERNAL). Task-number: QTBUG-71176 Change-Id: I56ce19437327f8ceb698f4754ea8814d7245a4a6 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Skip ignored entries in .qhpTopi Reinio2020-09-013-1/+72
| | | | | | | | | | Classes marked with \dontdocument do not generate a class reference page. Skip them when generating the Qt Help project file. Pick-to: 5.15 Fixes: QTBUG-86101 Change-Id: Ica80b505f1f23de0dd0ae59272903e1d19eadf93 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* CMake: Regenerate load(qt_app) projectsAlexandru Croitor2020-08-261-1/+1
| | | | | | | | | | These now use the new qt_internal_add_app function. Also the script will output necessary code to set the icons and resource files for each of the apps. Task-number: QTBUG-85757 Change-Id: I1a336243fc53a7f329ca17e6c1e40818dabeae30 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove deprecated functionalityLars Knoll2020-08-242-69/+0
| | | | | | | Required to get the module to compile against a new qtbase Change-Id: I4f7c6f10c94da640c1f1eec0bbbbc22bbd7cb2ea Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qdoc: Fix output of \footnote commandTopi Reinio2020-08-244-55/+35
| | | | | | | | | | | | | | | These small changes make the output of \footnote slightly more sane. The command is not fully implemented; for HTML generator it produces only <!-- --> comments, but the previous behavior was incorrect and affected formatting of the rest of the document. With WebXML output format, \footnote command together with \link (as in the generatedoutput test) seem to differ in linefeed placement on Windows as compared to other platforms. Remove these from the tested set for now. Change-Id: Id387aaeef1de1d1a859b5ec6e388394564cd0732 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Update expected output testPaul Wicking2020-08-195-3/+319
| | | | | | | | Add most of the commands that aren't tested. Task-number: QTBUG-71176 Change-Id: I748250ecfa390f8d71b702077e9cbce836dd964c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix qt_attribution.json fileSamuel Gaist2020-08-171-1/+1
| | | | | | | | The file contains invalid escape sequences which makes it an invalid json file. Change-Id: I03bebdfc84ce9b7cb3d7faf733683888df772153 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: Do not built qdoc/lupdate for MSVC NMC with CMake < 3.19Joerg Bornemann2020-08-172-0/+14
| | | | | | | | CMake 3.19 is required to build lupdate/qdoc with llvm support. Task-number: QTBUG-85411 Change-Id: Iabad73b753dc57bc36c826ecf318dea6498b5fb7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qdoc: generatedoutput autotest: Fix typo in documentation configTopi Reinio2020-08-131-1/+1
| | | | | | | | The shared documentation config did not enforce zero warnings because of a typo. Change-Id: I15dc19b2b10e7a6426446c56428cb64e227d9f10 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Prefer CMake example project files over qmake .pro filesTopi Reinio2020-08-101-0/+1
| | | | | | | | | | If an example has both a qmake .pro file and CMakeLists.txt in its project folder, select CMakeLists.txt to open. This file is listed also in the generated examples-manifest.xml. Fixes: QTBUG-85234 Change-Id: I0e32199f76f9cab7f5a459dec27a9356188b465f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Correctly handle default values for \qmlmethod parametersTopi Reinio2020-08-075-7/+7
| | | | | | | | | | | | The QML parser in QDoc was already able to parse default parameter values listed for \qmlmethod in a .qml file, but they were not handled when the command appeared in a .cpp or .qdoc file as a different code path is used for those. Pick-to: 5.15 Fixes: QTBUG-85756 Change-Id: I671a19b66f82e1a6cd81b8bb487dffa2133ee65d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Remove winrt specific codeOliver Wolff2020-08-063-3/+3
| | | | | | | | Task-number: QTBUG-84434 Change-Id: I9c3a661e490f3dccea893e213939953465d8970e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qtattributionsscanner: Add property CopyrightFileKai Koehne2020-07-246-11/+25
| | | | | | | | | | | | | JSON doesn't really support linebreaks in strings. So far we do allow them in qt_attribution.json files though because Qt's JSON parser does support them. One of the fields most often affected by this is "Copyright". Allowing users to store multiple copyright lines in a separate file is an easy way to deal with this. Change-Id: I9578906f0c1cac0cfca007813feb7e926e75c730 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qtattributionsscanner: Support multiple license filesKai Koehne2020-07-248-9/+76
| | | | | | | | | Accept a new LicenseFiles array that allows to list multiple license files. This avoids the need to artificially concatenate licenses in one file. Change-Id: Ia9db77b3bc0ea7fc6072d0296da5ea3cfce44b59 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Clean up list of testdata in tst_qtattributionsscannerKai Koehne2020-07-241-4/+8
| | | | | Change-Id: Ib81653b46dc168de5c106c9eef2ccd1a890d7205 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* qdoc: Introduce \required command and handle REQUIRED for QML propertiesTopi Reinio2020-07-156-5/+8
| | | | | | | | | | | | | | | | | | | Q_PROPERTY macro now supports the REQUIRED keyword. This is relevant for QML types, where the type cannot be instatiated without declaring all required properties. Make QDoc parse the REQUIRED keyword, set associated QML property as required, and introduce a new command, \required, to do this explicitly in the docs. Likewise in QML visitor, check for the 'required' keyword for properties. [ChangeLog][qdoc] Support marking QML properties as required in the generated documentation. Fixes: QTBUG-85597 Change-Id: Ib8a25c5ebc1183812aec6e672b557c8fb1196741 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Config: Allow in-place expansion of environment variablesTopi Reinio2020-07-152-0/+5
| | | | | | | | | | | | | | | With the new alternate syntax for referencing environment variables in .qdocconf files, change also the behavior to expand in-place and process the content as part of the qdocconf. This allows use cases where env. variables contain syntax recognized by QDoc, most notably lists with elements separated by whitespace. [ChangeLog][qdoc] Environment variables can now be expanded in-place when processing configuration files. Fixes: QTBUG-67362 Change-Id: I5dee84c1c42d76416f3dff6ccf0a9a1448709c6a Reviewed-by: Paul Wicking <paul.wicking@qt.io>