aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotest/quick/quicktestparser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use QStringList instead of QList<QString>Alessandro Portale2025-10-021-1/+1
| | | | | Change-Id: I56fabbfe32ab579ef5e9f7c8cc5fde220b99769a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* AutoTest: Silence warning of file system watcherChristian Stenger2025-05-221-1/+2
| | | | | | | | Do not try to add an already watched directory to the file system watcher. Change-Id: Ibe53445325b0a259221a8ecef49699a4e307793c Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Avoid hard freezeChristian Stenger2025-05-121-0/+19
| | | | | | | | | | | If one uses the default build properties of having the build inside / below the sources the quick test parser may end up in an endless loop of changed files and retriggering them to get updates from the code model. Change-Id: I60fed909018108dfce21e4283c62fab40d1f9c74 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTests: Some code cosmeticshjk2025-04-101-1/+1
| | | | | | | QVector->QList, typedef->using... Change-Id: I563759015f146b6a32d664a8bcc5690e5bbe81f6 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Use Utils::FileSystemWatcherhjk2025-03-141-18/+14
| | | | | | | | This is remote-capable. Task-number: QTCREATORBUG-26870 Change-Id: I8d625640126b4933f91db74eb8b6599367a88746 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* Change RawProjectPart::projectFile to FilePathAndrii Semkiv2024-09-161-1/+1
| | | | | | | | | Changed the type of PawProjectPart::projectFile from QString to FilePath. Rest of the changes are a direct byproduct. Change-Id: I00ed5e948af3fd1660ebf2c4bbcfae21f8facf28 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Autotest: Replace occurrences of FilePath::toStringAndrii Semkiv2024-09-061-10/+10
| | | | | | | | Use more sensible alternatives instead of FilePath::toString Use FilePath capabilities instead of QDir/QFile. Change-Id: I47d3a2c4c5197074e6bcbeb20383a26d6cda120c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Guard against concurrent accessChristian Stenger2023-09-271-5/+10
| | | | | | | | | While parsing for Qt Quick Tests it may happen that an internal map is accessed concurrently by different threads. Guard against this. Minor drive-by optimizations. Change-Id: Ic3b62c27feddb9a5ac5588a6c9643fc0e623ce19 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Speed up scanning for testsChristian Stenger2023-09-081-4/+11
| | | | | | | | | | | | | | Especially Qt and Quick tests scanning takes some time, so do some additional pre-filtering of files before parsing them to reduce the number of files to process. Depending on the structure of the project this can significantly reduce the scan time. Task-number: QTCREATORBUG-29301 Change-Id: I629beedcc02502d98d84e29282e1cd7b265cfcf0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* AutoTest: Use new approach for settingsChristian Stenger2023-07-131-2/+1
| | | | | | | Avoids a couple of unneeded casts. Change-Id: Ib3361d4ad2c69e4f0e4a44c5e9b3f385cefb6084 Reviewed-by: hjk <hjk@qt.io>
* AutoTest: Remove unused memberChristian Stenger2023-07-131-1/+1
| | | | | Change-Id: I1a3a157893a8311db48f6e41c8848720845d07ab Reviewed-by: hjk <hjk@qt.io>
* AutoTest: Merge settings and tools hierarchies [2/2]hjk2023-07-121-1/+1
| | | | | | | Renaming files to match class names. Change-Id: I3d75a79a5ad8e9d1c132530cbcc6973efc6dbadf Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Make a few CppModelManager functions statichjk2023-07-121-5/+6
| | | | | | | ... to simplify code using it. Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* AutoTest: Merge settings and tools hierarchies [1/2]hjk2023-07-121-2/+2
| | | | | | | | | | | Currently living in the settings files to keep changes small, will be renamed in a second step. This allows the settings aspects to be used in their short form and overall removes some indirections. Change-Id: I099369b62239aed8192613a04bca958a660c36c7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Fix scan for Quick TestsChristian Stenger2023-07-071-1/+2
| | | | | | | Partially reverts a85d7ef5389d504c924206951dd11d5e4c986f4a. Change-Id: Ib928ba2aee8b82d8204939b16070dbf806cafaf9 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Improve QRegularExpression usagesChristian Stenger2023-07-041-1/+1
| | | | | | | Use static const if possible to avoid re-initializations. Change-Id: Ibee9e320dccb90cd928737b809db3b56369961ec Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Avoid some unneeded fetching of snapshotChristian Stenger2023-07-041-3/+1
| | | | | Change-Id: I002b3537c2f1b468c52b08017e30efd4c969aeb2 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Further optimize TestCodeParser::scanForTests()Jarek Kobus2023-04-251-1/+1
| | | | | | | | | | | | | | | When loading a Qt project, after the Scanning For Tests finished, the scanForTests() blocks the main thread for about 3.5 seconds on the calls to parser->init(). Refactor the code so that it operates on QSet<FilePath> instead of QList<FilePaths>. This patch constraints the freeze to about 40 ms. Change-Id: I219b3e2abf2b7e5166eec08d83f4cdcb8e4a8098 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlJS: Use QtConcurrent invocation for async runJarek Kobus2023-03-141-4/+2
| | | | | | | | | | Add ModelManagerInterface::importScan() overload to avoid instantiating dummy QPromise arg on caller side. Change-Id: Idf836d30b2167d8840cc4e7ac6f95377c9d5622a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* AutoTest: Fix missing includesChristian Stenger2023-03-021-0/+2
| | | | | Change-Id: Ieb34092c8c78068ae1630cfaa0f18a45f7d43c0c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-3/+6
| | | | | | | | | | | | | | | ... out of SessionManager. The idea is to later move SessionManager into the Core plugin, which both is sensible conceptually and also prerequisite to merge the Bookmark plugin into TextEditor plugin. Currently, only the interface is split, as the load/save implemetations are non-mechanical to disentangle. Change-Id: I31631db3094ea192825a2ccaa6add6188662940b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Autotest: Use QPromise for async callsJarek Kobus2023-02-271-12/+9
| | | | | | | Change-Id: I57d2feed36eeb1871b2b00cf7720c48f6a0e81b5 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* AutoTest: Use using namespace Utils more oftenJarek Kobus2023-01-271-23/+19
| | | | | | | Change-Id: I9d20cd3496c4719d58a977f8fd53253c86d55463 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* AutoTest: Use TestResult as value typeJarek Kobus2023-01-271-2/+2
| | | | | | | | Don't construct it on heap and don't use shared pointer for it. Change-Id: I51c9da405ed14d24b5f20242b4d049f9e2958f09 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* AutoTest: Add option to disable derived checksMarcus Tillmanns2023-01-231-4/+18
| | | | | | | | | | | | | | Previously the quick test parser would always check each symbol its interested in to see if it might be derived from "TestCase". This is very expensive. This patch adds an option allowing the user to enable or disable the check. By default the check is disabled. Change-Id: Ia6b230b344add672e53ad7fb52845c78a2914b99 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* AutoTest: Pass context object to lambda connectionsJarek Kobus2022-12-081-14/+14
| | | | | | | | | Remove some unneeded lambda () brackets. Glue lambda brackets with parameters brackets. Change-Id: I414f7dbbaf60b452cb71f77d53d972937f121a47 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Return FilePaths from Document::includedFilehjk2022-11-251-2/+2
| | | | | | | | ... and fix fallout. Change-Id: Ieaad57700fa48d0c4a0dd9bf2c284315579b9473 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CPlusPlus: Proliferate FilePath usehjk2022-11-221-6/+7
| | | | | | | | | | | | | | | | | | | The starts with CppDocument::filePath(), plus a bit of the fallout This is one patch of potentially many. It is hard to draw the line where to stop this kind of chunk, this here converts a few additional functions for which including it in the patch looked like less churn than without. Converting is mostly fromString/toString, with a few exceptions for "already seem" like caches, that use cheaper "path()" to avoid likely performance regressions (on Windows FilePath comparison is currently case-insenstive, and more expensive). There should be no difference for local operation with this patch. Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* Autotest: Save a lookup in quicktestparser.cpphjk2022-08-291-6/+6
| | | | | | Change-Id: Id240d1dec133fd39e1d3fd5202b2087d84783406 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Merge remote-tracking branch 'origin/8.0'hjk2022-08-031-2/+2
|\ | | | | | | Change-Id: Iea4fd2949f5d5345802e2e7d9283d72c6c55f69f
| * AutoTest: Do not use reference for file contentChristian Stenger2022-08-021-1/+1
| | | | | | | | | | Change-Id: Iadad6c84e148604fa04d491f59be2d3a0987517b Reviewed-by: hjk <hjk@qt.io>
| * AutoTest: Prevent possible crashChristian Stenger2022-08-021-1/+1
| | | | | | | | | | Change-Id: Ic27a9623ea910b21ccb99c7cd603cfa3d1369d12 Reviewed-by: David Schulz <david.schulz@qt.io>
* | Autotest: Convert to Tr::trhjk2022-08-011-1/+1
| | | | | | | | | | | | Change-Id: Ifd4b6ace78d02804ec3b3c1d60c5418081cad6c4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | qmljs: (QString -> Utils::FilePath)++Fawzi Mohamed2022-07-131-13/+22
|/ | | | | | | | | convert more QString containing paths to Utils::FilePath Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Merge remote-tracking branch 'origin/5.0'Eike Ziller2021-09-071-0/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/processreaper.cpp src/plugins/clangcodemodel/clangmodelmanagersupport.cpp src/plugins/cmakeprojectmanager/cmakeprocess.cpp Change-Id: Ie248bcb02a80f3e02ab19d73033ce2ba31e7fd83
| * AutoTest: Do not unnecessarily update QmlJS code modelChristian Stenger2021-09-021-0/+1
| | | | | | | | | | | | | | | | | | | | We forgot to update the timestamp indicators which lead to several triggered updates e.g. when modifying and storing a qml file inside a watched directory. Change-Id: I30858ea9e8073d648a84c7f188dff18ddef5b1c1 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* | Merge CppTools into CppEditorChristian Kandeler2021-09-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Pass QFutureInterface by referenceJarek Kobus2021-08-301-3/+3
| | | | | | | | | | | | | | | | No need for a copy. Change-Id: I0308da77199942ef49e36fb04e81713cb9d9a901 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | CppTools: Use only const pointers for ProjectInfo and ProjectPartChristian Kandeler2021-08-271-2/+2
|/ | | | | | | | All members were already const, but this makes it clear at all points of use that these data structures are immutable. Change-Id: Iea615c090bde462c445d15223caccc561b0c713d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* AutoTest: More filepathificationChristian Stenger2021-06-171-7/+7
| | | | | Change-Id: Ibb76f4332fa2e682709520cebe5e243dc3b70bb2 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Take precompiled headers into accountChristian Stenger2021-06-071-5/+37
| | | | | | | | | | | Test frameworks might be added to the precompiled headers. This in turn would make some pre-checks whether a file has to be processed or not fail. Fixes: QTCREATORBUG-25821 Change-Id: Iff69c1a83889cb6f79a3e3f9b2e59c5383989ccd Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Use Utils::FilePath for files and directoriesChristian Stenger2021-05-271-16/+16
| | | | | | | | Still some missing bits as some QString members had different meanings depending on their context. Change-Id: Ib48eab54498974a26bbd5123cbffeefee5f7e79c Reviewed-by: hjk <hjk@qt.io>
* Use qAsConst with non-const Qt containers in range-loopsAlessandro Portale2021-02-171-1/+1
| | | | | | | ... in various places Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* AutoTest: Improve type safety in TestParseResultBernhard Beschow2021-02-041-1/+1
| | | | | | | | | | | | | | | By having TestParseResults take ITestFramework rather than ITestBase as parameter, some base->asFramework() casts can be avoided today which could possibly fail in the future. Moreover, it allows TestTreeItem to take ITestFramework rather than ITestBase as parameter which improves type safety further. This shall be done in a separate commit though. Change-Id: I66594415d68c3423076a0830ecd11080d3b6c186 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Use working copy of own parserBernhard Beschow2021-01-221-7/+6
| | | | | | | | | | | In TestCodeParser::syncTestFrameworks(), a parser is created for every test framework. As a result, the last parser being created would "win" the global s_parserInstance variable, which is not predictable and probably not intended. So turn CppParser::getFileContent() into a non- static method, avoiding the global variable altogether. Change-Id: I9f7560f1185bc4a3bc7b2b36e89280351998465e Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge remote-tracking branch 'origin/4.14'Eike Ziller2020-11-191-4/+3
|\ | | | | | | Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
| * Fix a warning about const signalJarek Kobus2020-11-171-4/+3
| | | | | | | | | | | | | | | | | | | | Fix a [clazy-const-signal-or-slot] warning. Instead of defining a signal for internal usage, use directly QMetaObject::invokeMethod(). Don't declare scanDirectoryForQuickTestQmlFiles() a const method anymore. Change-Id: I036afc6124dfb877ced7d9e798920c8a8fde1892 Reviewed-by: hjk <hjk@qt.io>