summaryrefslogtreecommitdiff
path: root/src/plugins/autotest/quick/quicktestparser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | Use const iterator with std::find_if where possibleJarek Kobus2020-11-191-3/+3
| | | | | | | | | | | | | | Make the resulting interator const. Change-Id: I4aadcfff35f6b1015e506bc75bcfc2a1f1be4d65 Reviewed-by: hjk <hjk@qt.io>
* | Don't access static functions/fields via instanceAlessandro Portale2020-11-191-2/+3
| | | | | | | | | | | | | | Courtesy of readability-static-accessed-through-instance Change-Id: I71f54244f1e091315dac2943d9e1bfad6efa56a9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | AutoTest: Clean up header messChristian Stenger2020-11-091-0/+1
| | | | | | | | | | | | | | | | Better decoupling and reduced binary size. Change-Id: I4f6239979d9d7dae4ad92f19ec8420be38372c07 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | AutoTest: Use base of framework inside TestTreeItemChristian Stenger2020-11-091-1/+2
|/ | | | | | | | ...and respectively inside the parse results which hold the information that are used to create the items. Change-Id: I78f7b5632df5d449d39fa03ffbf48036a138e337 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: performance-for-range-copyAlessandro Portale2020-06-121-1/+1
| | | | | Change-Id: I60e79aec1fe2813867d8ff46cec7d39b848d0020 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Use QMap::keys() return type directlyhjk2020-04-291-1/+1
| | | | | | | Instead of a derived one. Change-Id: Ibe6261b94d8158b8678bd2523144fd806a71914f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Autotest: Keep track of generating framework in TestTreeItemhjk2020-03-271-1/+1
| | | | | | | | ... and TestConfiguration. This allows dropping code that reconstruct framework ids and framework lookup by id. Change-Id: I0bb1e6e135376e21f96b9fab7971aa097787e483 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Use ITestFramework * instead of its id in some caseshjk2020-03-161-10/+10
| | | | | Change-Id: Ic327e31185247b6479c78af8bf8156f44bb4bdfb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: De-noise code a bitChristian Stenger2019-09-021-24/+26
| | | | | Change-Id: I4585ebfb53623221c713ab0e8e254ba59a4e5920 Reviewed-by: hjk <hjk@qt.io>
* AutoTest: fine tune quick test case specsDavid Schulz2019-07-301-18/+18
| | | | | | | and fix multiple inheritance Change-Id: I031c8518437b7b396f5b17a51d2067e4b3661530 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Fix parsing of multiple test cases in single qml fileChristian Stenger2019-07-301-20/+21
| | | | | | | | | Quick tests allow definition of more than one TestCase inside a qml file and even nesting is possible, so support this correctly. Fixes: QTCREATORBUG-22761 Change-Id: I65fcc7cd6063d976d798c3e900d3299a12e2d73f Reviewed-by: David Schulz <david.schulz@qt.io>
* Utils: Rename FileName to FilePathhjk2019-05-281-2/+2
| | | | | | | | More in line with QFileInfo terminonlogy which appears to be best-of-breed within Qt. Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* AutoTest: Code cosmeticsChristian Stenger2018-07-201-5/+1
| | | | | | | | | | | * use nullptr * override * remove old style casts * fix most of the code model warnings Change-Id: Ia08e846f9326ae28ca7e7d66748e25a8b817b9b1 Reviewed-by: Xing Xiong Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Handle direct usage of quick_test_mainChristian Stenger2018-07-121-3/+15
| | | | | | | | | | | | If users need to register additional QML types before Qt5.12 they need to bend the Quick tests magic a bit and use quick_test_main or quick_test_main_with_setup directly. The plugin supports something similar for QTest::qExec, so allow this for Quick tests as well. Task-number: QTCREATORBUG-20746 Change-Id: I672f8410914c6cc77abc901998f419dda35755ae Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* AutoTest: Fix handling of cpp files for Quick testsChristian Stenger2018-07-111-3/+21
| | | | | | | | | | | | | | | | Modifying C++ files of Quick tests had been ignored as they normally have little impact. But nevertheless this behavior is wrong and could lead to unexpected behavior later on if no complete rescan had been done and even with a rescan there could have been some cached artifacts. Fix this by tracking the paths of the C++ files that hold the main() or the respective macro to be able to handle changes of these files correctly as well. Task-number: QTCREATORBUG-20746 Change-Id: Iec860aa63ffd167511efdbf63a6ffa369f094edf Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Fix wrong behavior when rescan is triggeredChristian Stenger2018-01-161-3/+4
| | | | | | | | If the code parsers perform a full scan then do not use cached information. Change-Id: Ib9635c9715841ab71b97edfe42c4fe9d9d20c23a Reviewed-by: David Schulz <david.schulz@qt.io>
* Convert macros from plain QByteArray to a vector of structsMarco Bubke2017-09-141-12/+13
| | | | | | | | | | | The old code model expected the macros as C++ formatted text ("#define Foo 42) but newer targets like the Clang codemodel expect key value arguments like "-DFoo=42". So instead of parsing the text again and again we use an abstract data description. Task-number: QTCREATORBUG-17915 Change-Id: I0179fd13c48a581e91ee79bba9d42d501c26f19f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>