aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/autotest/testcodeparser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* TaskTree: Switch to qt-ified QtTaskTreeJarek Kobus2025-10-311-5/+5
| | | | | | | Remove the old Tasking lib. Change-Id: Iacb4939cc873e25d6039efae7dd23510a7baa5f9 Reviewed-by: hjk <[email protected]>
* TaskTree: Rename TaskTreeRunner into SingleTaskTreeRunnerJarek Kobus2025-08-121-2/+2
| | | | | | | | Introduce AbstractTaskTreeRunner base class. Add a test for SingleTaskTreeRunner. Change-Id: I344aa8545f62f9e2e8fbbb741205d61ebbfe2d35 Reviewed-by: Marcus Tillmanns <[email protected]>
* TaskTree: Rename CallDoneIf and its valuesJarek Kobus2025-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | In fact, CallDoneIf::Error was called also in case of DoneWith::Cancel. and CallDoneIf::SuccessOrError was called also in case of DoneWith::Cancel. Rename CallDoneIf into CallDone. Api: CallDoneIf::Success -> CallDone::OnSuccess. Api: CallDoneIf::Error -> CallDone::OnErrorOrCancel. Api: CallDoneIf::SuccessOrError -> CallDone::Always. Prepare to make it a flag type. This is a preparation for fixing the 33th point of the bugreport below. Task-number: QTCREATORBUG-28741 Change-Id: I18ef1a66593e01052e1668bd585bb8402f705455 Reviewed-by: hjk <[email protected]>
* ProjectExplorer: Add convenience accessors to some classesChristian Kandeler2025-01-231-1/+1
| | | | | | | | | | | | Namely, Kit, BuildConfiguration, BuildSystem and RunConfiguration get functions to retrieve the active instance for a given project as well as the one for the current and active projects, respectively. This saves a ton of annoying null pointer checks. Some of these functions replace existing ones with the same purpose that were scattered around the code base. Change-Id: I18247061229bbeb8b8ad1e15a2bd7a6626438bc0 Reviewed-by: hjk <[email protected]>
* TaskTree: Refactor For loopsJarek Kobus2024-09-161-2/+1
| | | | | | | Make the syntax more consistent with conditional API. Change-Id: I52353d0a0044252e1e3bac0b424ac7c22d927262 Reviewed-by: Marcus Tillmanns <[email protected]>
* TaskTree: Introduce For elementJarek Kobus2024-07-101-3/+3
| | | | | | | | | | | | | | Improve code readability by requiring iteratable Group to be named For. The For's c'tor requires an iterator element as a first arg. The For's c'tor allows for passing exactly one iterator element. It's not possible to place iterators inside Group element anymore. Change-Id: I9dfe2c0da058abac161f66c4e336da2417c383f1 Reviewed-by: hjk <[email protected]>
* AutoTest: Allow limiting scan inside project settingsChristian Stenger2024-04-301-0/+34
| | | | | | | | | | | | Enables to limit the scanning for tests and respectively any further action to a list of user defined patterns. If limitation is enabled and any of the filter patterns does match the file will be processed. If no filter pattern matches the file will be ignored. Change-Id: I6a6de8f4137485e83b750997fb3c948dc6e79c68 Reviewed-by: Leena Miettinen <[email protected]> Reviewed-by: David Schulz <[email protected]>
* AutoTest: Suppress progress bar more aggressivelyChristian Stenger2024-02-281-1/+1
| | | | | | | Task-number: QTCREATORBUG-30447 Change-Id: I4386d522819b9f361f179ccda6a0fd3c759c389d Reviewed-by: David Schulz <[email protected]> Reviewed-by: Christian Kandeler <[email protected]>
* AutoTest: Delay reparsing of postponed filesChristian Stenger2024-02-281-21/+5
| | | | | | | Task-number: QTCREATORBUG-30447 Change-Id: Ica1dba358e05edfe2ad7ed6fd92fc8afde291718 Reviewed-by: Christian Kandeler <[email protected]> Reviewed-by: David Schulz <[email protected]>
* AutoTest: Reuse TaskTreeRunner for test scannerJarek Kobus2024-01-171-15/+15
| | | | | | Change-Id: I19db6d28c9d68e1394f089b7a58640db153cd7e9 Reviewed-by: <[email protected]> Reviewed-by: Christian Stenger <[email protected]>
* AutoTest: Pass a list of results inside testParseResultsReady()Jarek Kobus2024-01-151-3/+3
| | | | | | | This limits the number of signals being sent. Change-Id: Ie4b0661571a9d1bbd5708e33e21e0911e7a9fcbd Reviewed-by: Christian Stenger <[email protected]>
* AutoTest: Use LoopRepeat for test scannerJarek Kobus2024-01-151-15/+21
| | | | | | | | | In this way we don't construct a giant recipe (~7000 tasks for Creator project) but simply repeat the task execution many times. Change-Id: I06758e2afa721f73e28adb42e6fccee0f955e01f Reviewed-by: Christian Stenger <[email protected]>
* TaskTree: Unify done / errorOccurred signalsJarek Kobus2023-11-071-4/+4
| | | | | | | | | | Get rid of TaskTree::errorOccurred signal. Provide additional DoneResult arg for done signal. Task-number: QTCREATORBUG-29834 Change-Id: I31a3a0701a14246b01f65303a1295f014c855ecf Reviewed-by: hjk <[email protected]> Reviewed-by: <[email protected]>
* TaskTree: Introduce CallDoneIf enumJarek Kobus2023-11-071-2/+2
| | | | | | | | | | | Get rid of CustomTask c'tor taking 3 handlers. If the done handler needs to be called only on success or an error, add explicit 3rd arg of CallDoneIf type. Task-number: QTCREATORBUG-29834 Change-Id: I10e55415587e6cac46620dd5177ad8269584583c Reviewed-by: hjk <[email protected]> Reviewed-by: <[email protected]>
* AutoTest: Add report helper functionChristian Stenger2023-09-071-0/+13
| | | | | | | | | | Adds a report() function which generates a simple string holding the number of items per framework root node and uses it inside the logging after a full parse. Change-Id: Ib4be89de778aeab7e9c80b5c0522ee7f3f1bb587 Reviewed-by: Marcus Tillmanns <[email protected]> Reviewed-by: David Schulz <[email protected]>
* AutoTest: Allow temporarily disabling of functionalityChristian Stenger2023-08-301-5/+20
| | | | | | | | | | | | Especially when touching headers included centrally while refactoring bigger projects the retriggered parsing of large (depending) parts of the project can become rather annoying. Adds an action for immediate disabling parsing and respectively other test related functions. Change-Id: I553615cce90bc88d636a4519718887306ee5215b Reviewed-by: David Schulz <[email protected]>
* Merge remote-tracking branch 'origin/11.0'Eike Ziller2023-07-131-1/+1
|\ | | | | | | Change-Id: I2e0e8dd5f9b42533c665255f8539e837938846de
| * AutoTest: Retrigger scan if active frameworks changeChristian Stenger2023-07-111-1/+1
| | | | | | | | | | | | | | | | ...if the code parser is scanning for tests. Otherwise we have the canceled state of the running scan. Change-Id: Ief493c0bf66825e57c44c79193d5e8085ee98acd Reviewed-by: Marcus Tillmanns <[email protected]>
* | CppEditor: Make a few CppModelManager functions statichjk2023-07-121-1/+1
| | | | | | | | | | | | | | ... to simplify code using it. Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4 Reviewed-by: Christian Kandeler <[email protected]>
* | Autotest: Adapt to changed settings access pattern againhjk2023-07-101-1/+1
| | | | | | | | | | | | | | | | | | Settings are created on first access now, even though this doesn't matter much here as this happens unconditionally in AutotestPluginPrivate ctor via m_frameworkManager.synchronizeSettings() Change-Id: I340927cf107d7e4b2268e842d23f1a89898e8a92 Reviewed-by: Christian Stenger <[email protected]>
* | AutoTest: Make scan thread limit customizableChristian Stenger2023-07-041-1/+6
|/ | | | | | | | | | | | Allow users to specify the tread limit used when scanning for tests. By default we continue to use a fourth of the available logical CPUs. Task-number: QTCREATORBUG-29301 Change-Id: Ic92a4d0908093c0664aa1ba924e0c17dfd0082f9 Reviewed-by: David Schulz <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* TaskTree: Rename TaskItem into GroupItemJarek Kobus2023-06-061-1/+1
| | | | | | | | | | | | | | | Not all classes derived from TaskItem are tasks, but the common denominator is that all may be placed inside a group: thus GroupItem sounds more appropriate. Addresses the 10th point in the bugreport below. Task-number: QTCREATORBUG-28741 Change-Id: I94d728a8e39ec732810f2e5bbe6b9a76f3bc387c Reviewed-by: Qt CI Patch Build Bot <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: hjk <[email protected]>
* AutoTest: Tweak postponing parse once moreChristian Stenger2023-06-051-1/+1
| | | | | | | | Postpone the parsing also if the build system is waiting for a parse. Change-Id: I56aaecfca05ea28a21c13747847b518d1eb8732f Reviewed-by: David Schulz <[email protected]>
* TaskTree: Refactor Group internal dataJarek Kobus2023-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | Introduce the GroupData structure. In this way it's easily possible to add extra properties of already used types, e.g. int. It's also possible to easily create elements with multiple properties. Simplify internal TaskItem::Type enum. Get rid of special ParallelLimit and Workflow elements. Provide global parallelLimit() and workflowPolicy() functions. Make global items (e.g. parallel, stopOnDone, etc...) const. Change-Id: Ic5628255b542fd6c5a5565b055ff11804c8d7b68 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: <[email protected]> Reviewed-by: hjk <[email protected]>
* AutoTest: Output time taken when parsing testsMarcus Tillmanns2023-05-121-0/+2
| | | | | | | | Makes debugging easier as you don't have to calculate end - start yourself. Change-Id: Ib75a36bbf52633e188a6c4bbd488eb439cb52984 Reviewed-by: Christian Stenger <[email protected]>
* Utils: Rename asynctask.{cpp,h} -> async.{cpp,h}Jarek Kobus2023-05-031-1/+1
| | | | | | | Follows AsyncTask -> Async rename. Change-Id: I37f18368ab826c9960a24087b52f6691bb33f225 Reviewed-by: hjk <[email protected]>
* Tasking::Async: Rename Async into AsyncTaskJarek Kobus2023-05-031-3/+3
| | | | | | | | | Rename Utils::AsyncTask into Utils::Async. Rename AsyncTaskBase into AsyncTask. Task-number: QTCREATORBUG-29102 Change-Id: I3aa24d84138c19922d4f61b1c9cf15bc8989f60e Reviewed-by: hjk <[email protected]>
* FutureSynchronizer: Change the default value of cancelOnWait to trueJarek Kobus2023-04-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "false" default wasn't really useful. This changes the default value to the following usages: 1. AndroidDeployQtStep Introduced in 91f136ef3ab75471cabcaed9dc16dad9f504add8 The synchronizer was used to cancel the running tasks inside the doCancel(), so the similar behavior should be expected when destructing the AndroidDeployQtStep. 2. GitClient Introduced in f3106ebafe9a02904e822e9698c8b4cbb6c7e0f5 Is used only inside the last line of GitSubmitEditor::updateFileModel(). The running function (CommitDataFetchResult::fetch) doesn't take QPromise<>, so it can't detect if the future was canceled or not. In this case this change is no-op. 3. ExtraCompiler Introduced in c99ce1f455189864de9a2043730f704d7b024abf The intention was to make it cancellable and finish early on cancel. 4. PluginManager global future synchronizer Introduced in 72bddf9f51fedd064f551bcb4ced5feeb46fdfc1 The intention was to make it cancellable and finish early on cancel. The relevant places in code are marked explicitly for points: 1, 2 and 3. Change-Id: I1a52deb8d1f81d355950c8772bbaa6d0a202fd7e Reviewed-by: Eike Ziller <[email protected]>
* AutoTest: Optimize starting task tree in TestCodeParser::scanForTests()Jarek Kobus2023-04-251-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When loading a Qt project, after the Scanning For Tests finished, the scanForTests() blocks the main thread for about 2.5 seconds on the call to m_taskTree->start(). The reason is that created task tree contains about 8000 asynchronous tasks. If all they run in parallel it means that we start them all synchronously. Don't use internal QThreadPool, as it doesn't prevent the freeze when more than maxTreadCount() threads are started. Instead, use the parallel limit with the same constraint that was used for thread pool. It means that only constrained number of tasks are being run in parallel and the rest is being postponed until some of the running tasks finished. In this way starting the constrained number of tasks reduces the GUI freeze to ~0 ms on task tree start(). In general: this patch divides the overall freeze of 2.5 seconds evenly into many very small pieces and distributes them evenly in time, so the GUI stays responsive. This patch, when applied together with 2 bottom patches, reduces the GUI freeze spent inside scanForTests() after loading a Qt project and after Scanning For Tests finished from about 23 seconds into 160 ms. Change-Id: If33076d4f042c3d96434b9f3cc305776fb30906d Reviewed-by: Christian Stenger <[email protected]>
* AutoTest: Further optimize TestCodeParser::scanForTests()Jarek Kobus2023-04-251-30/+29
| | | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Christian Stenger <[email protected]>
* AutoTest: Only handle document updates if necessaryChristian Stenger2023-04-251-2/+13
| | | | | | | | | Do not send qml document updated unnecessarily in case we know that nothing had changed at all. Change-Id: I1d6b94dcd68753e0f451a2812a752ff92f4860af Reviewed-by: David Schulz <[email protected]> Reviewed-by: Jarek Kobus <[email protected]>
* AutoTest: Optimize TestCodeParser::scanForTestsJarek Kobus2023-04-241-9/+5
| | | | | | | | | | | | | | | | | | | | In case of loading a Creator project, after the Scanning For Tests finished, the scanForTests() called by TestCodeParser::onFinished() freezed the main thread for about 1 second. In this case requestRemoval() signal was emitted nearly 1000 times. Optimize the internals: 1. Don't emit requestRemoval() for every single file but emit it just once passing a QSet<FilePath> instead. 2. Adapt some other callees and callers to work on QSet<FilePath> instead on a single FilePath. This change constraints the freeze to about 2 ms. Change-Id: If23b85b495c125d82eb3c8b5a6912349df122745 Reviewed-by: Christian Stenger <[email protected]>
* TestCodeParser: Apply priority to thead poolJarek Kobus2023-03-101-1/+1
| | | | | | | | Rather to async task. Change-Id: I253de9f04e655e394027d15273a86049f5b61f5b Reviewed-by: Christian Stenger <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-7/+7
| | | | | | | | | | | | | | | ... 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 <[email protected]> Reviewed-by: <[email protected]>
* Autotest: Use QPromise for async callsJarek Kobus2023-02-271-4/+4
| | | | | | | Change-Id: I57d2feed36eeb1871b2b00cf7720c48f6a0e81b5 Reviewed-by: Christian Stenger <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: <[email protected]>
* TestCodeParser: Reuse TaskTreeJarek Kobus2023-02-061-44/+47
| | | | | | Change-Id: Idf42f2c732151d32d70db9d2344bb18664119857 Reviewed-by: <[email protected]> Reviewed-by: Christian Stenger <[email protected]>
* AutoTest: Use using namespace Utils more oftenJarek Kobus2023-01-271-21/+21
| | | | | | | Change-Id: I9d20cd3496c4719d58a977f8fd53253c86d55463 Reviewed-by: Christian Stenger <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: <[email protected]>
* AutoTest: Reduce parsing attemptsChristian Stenger2023-01-231-5/+13
| | | | | | | | | | | Do not check for code model parsing only, but take project parsing as well into account. Explicitly ignore more qml code model related files supposed to hold no functional code. Change-Id: I2dc8a6331ea508cbb287ea5000f5abe302069060 Reviewed-by: David Schulz <[email protected]> Reviewed-by: Marcus Tillmanns <[email protected]>
* AutoTest: Only scan necessary files for testsMarcus Tillmanns2023-01-231-4/+25
| | | | | Change-Id: Idafd064694a7dfdd0fbca66bca1b9f848acb9b3f Reviewed-by: Christian Stenger <[email protected]>
* Autotest: Add ITestParser::supportedExtensionsMarcus Tillmanns2023-01-231-2/+2
| | | | | Change-Id: I3bb0f9b2a989cc4c9b4f6ae95d36308bc192158d Reviewed-by: Christian Stenger <[email protected]>
* 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 <[email protected]>
* AutoTest: Pass context object to lambda connectionsJarek Kobus2022-12-081-3/+3
| | | | | | | | | Remove some unneeded lambda () brackets. Glue lambda brackets with parameters brackets. Change-Id: I414f7dbbaf60b452cb71f77d53d972937f121a47 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Christian Stenger <[email protected]>
* CPlusPlus: Proliferate FilePath usehjk2022-11-221-1/+1
| | | | | | | | | | | | | | | | | | | 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 <[email protected]>
* Merge remote-tracking branch 'origin/9.0'Eike Ziller2022-11-031-0/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp Change-Id: I154a9ababa9e166cb06e98652d481fe6234f6399
| * Autotest: Don't parse tests without filesMarcus Tillmanns2022-10-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | Previously the "Scan for tests" dialog would pop up momentarily during project loading, even though no files were loaded yet. Partial fix for: QTCREATORBUG-27785 Change-Id: I4087ba23d00a628465dd1532a725d9bcc37dec30 Reviewed-by: Christian Stenger <[email protected]>
* | Utils: Add sorted() functionChristian Kandeler2022-10-251-2/+2
|/ | | | | | | | | For simpler calling code. Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Christian Stenger <[email protected]> Reviewed-by: <[email protected]>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-3/+3
| | | | | | | | | | | | | | 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 <[email protected]>
* 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 <[email protected]>
* Autotest: Convert to Tr::trhjk2022-08-011-3/+2
| | | | | | Change-Id: Ifd4b6ace78d02804ec3b3c1d60c5418081cad6c4 Reviewed-by: <[email protected]> Reviewed-by: Christian Stenger <[email protected]>
* qmljs: (QString -> Utils::FilePath)++Fawzi Mohamed2022-07-131-2/+2
| | | | | | | | | convert more QString containing paths to Utils::FilePath Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51 Reviewed-by: Tim Jenssen <[email protected]> Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: <[email protected]>