summaryrefslogtreecommitdiff
path: root/src/plugins/autotest/quick
Commit message (Collapse)AuthorAgeFilesLines
* AutoTests: Aspectify parts of main settingshjk2023-05-121-2/+1
| | | | | Change-Id: I407b5102e1f2a6647f6fdca01a61dfa422c5d3ee Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Rename QtcProcess -> ProcessJarek Kobus2023-05-042-2/+2
| | | | | | | | Task-number: QTCREATORBUG-29102 Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* AutoTest: Further optimize TestCodeParser::scanForTests()Jarek Kobus2023-04-254-4/+5
| | | | | | | | | | | | | | | 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>
* AutoTest: Optimize TestCodeParser::scanForTestsJarek Kobus2023-04-242-10/+12
| | | | | | | | | | | | | | | | | | | | 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 <christian.stenger@qt.io>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-04-241-1/+7
|\ | | | | | | Change-Id: I8b36c1812b61dbe08fe3e7930f950e6b8e8a7079
| * AutoTest: Improve handling of Qt Quick TestsChristian Stenger2023-04-181-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qml files must not get declared inside the project files which makes it hard to correctly determine the correct project part they might belong to. The recommended and correct way of using Quick Tests is to have QUICK_TEST_SOURCE_DIR defined which is used internally anyhow to find the respective qml files. Make use of this fact also when determining the correct project part. Fixes: QTCREATORBUG-28716 Change-Id: I45371242ce931ee83b7bfbdd07a0848c7fd86abb Reviewed-by: David Schulz <david.schulz@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-012-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... 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-272-14/+11
| | | | | | | | | | | | | | 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>
* | TestRunner: Reuse TaskTreeJarek Kobus2023-02-032-11/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of QFutureInterface argument from ITestConfiguration::createOutputReader() and from TestOutputReader c'tor. The fine-grained progress reporting was broken anyway: 1. The assumption was that testCaseCount was meant to be the total number of test functions executed. It didn't include the initTestCase() and cleanupTestCase(), while those were reported on runtime apparently (and exceeding the max progress by 2). 2. In case of tst_qtcprocess, when the whole test was run, the testCaseCount reported 41, while the real number of functions was 26 (+2 = 28 for init/cleanup). 3. While the max progress was set to testCaseCount initially, the corresponding FutureProgress rendered the progress always in 0-100 range, what didn't match the reality. Instead, rely on TaskTree progress, which resolution is per test as a whole. So, when executing a series of tests this should scale fine. In addition, the progress advances fluently according to the expected run time - with 10 seconds hardcoded. The original code locations, where progress was bumped, are left with a TODO comment for any possible future tweaks. Like in case of result reporting, fine-grained progress reporting may be implemented by providing additional signal, so there is no need for QFutureInterface inside TestOutputReader. Change-Id: Idc11d55e3a49dac8d1788948b9a82f68199203c6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Use using namespace Utils more oftenJarek Kobus2023-01-274-45/+46
| | | | | | | 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-275-10/+7
| | | | | | | | 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-234-8/+32
| | | | | | | | | | | | | | 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>
* Autotest: Add ITestParser::supportedExtensionsMarcus Tillmanns2023-01-231-0/+2
| | | | | Change-Id: I3bb0f9b2a989cc4c9b4f6ae95d36308bc192158d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* AutoTest: Rename outputReader() into createOutputReader()Jarek Kobus2023-01-182-4/+4
| | | | | | | | Make it clear it's a factory method that creates new instances of objects, not a simple getter. Change-Id: I0b44506a27a0353bc524831c305f947510f59e98 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-0612-12/+12
| | | | | | | | | | | | | | | 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-082-15/+15
| | | | | | | | | 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-2612-288/+24
| | | | | | | | | 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-032-5/+4
|\ | | | | | | Change-Id: Iea4fd2949f5d5345802e2e7d9283d72c6c55f69f
| * Autotest: move global static into functionDavid Schulz2022-08-021-3/+2
| | | | | | | | | | Change-Id: I31dcbbba430ce7856e3dd8d7b907d01cd09112e8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * 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-013-10/+12
| | | | | | | | | | | | 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-133-16/+25
|/ | | | | | | | | 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>
* AutoTest: Use QtcProcess for test runnerChristian Stenger2022-06-142-2/+2
| | | | | Change-Id: I29b15a08a260aaf8d2c4071d5ea71d49902d8ef6 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Unify framework and tool namingChristian Stenger2022-06-102-1/+7
| | | | | | | | Use the same name for the test framework or tool across Qt Creator. Change-Id: I3116644ab03cc46c2e9d7e8aa3b8af8a5386dba4 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Allow handling of maximum warnings for QtTestChristian Stenger2021-12-101-0/+4
| | | | | | | | | | If the maximum number of warnings is reached the test will be canceled automatically. Allow to handle this from the user side in case it might be needed. Fixes: QTCREATORBUG-26637 Change-Id: I239eca280cdc2ce46f6d64cd53b8f3ad0205f7f2 Reviewed-by: David Schulz <david.schulz@qt.io>
* 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-012-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-302-5/+5
| | | | | | | | | | | | | | | | 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-272-3/+3
| | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.0'Eike Ziller2021-08-181-1/+1
|\ \ | |/ | | | | | | | | | | Conflicts: src/libs/utils/qtcprocess.cpp Change-Id: I1f7419d927e8534dfdcd10db998f97a6efd4d3e4
| * AutoTest: Fix gathering failed Qt based testsChristian Stenger2021-08-171-1/+1
| | | | | | | | | | | | | | | | Omit special and test data functions while collecting as these cannot be addressed at all. Change-Id: I3d79192cd07b4e7e2e76f04dfad36ef033593e71 Reviewed-by: David Schulz <david.schulz@qt.io>
* | ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnablehjk2021-08-131-1/+1
| | | | | | | | | | | | Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-131-1/+3
|/ | | | | | | | | | | | | ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers to Project and/or Toolchain, even though they were used in contexts where these pointers were either unsafe to access or not guaranteed to be valid anymore, which made their use difficult and error-prone. We turn these classes into pure value types by copying in all relevant information before the first async operation takes place. Fixes: QTCREATORBUG-25678 Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* AutoTest: More filepathificationChristian Stenger2021-06-173-25/+17
| | | | | Change-Id: Ibb76f4332fa2e682709520cebe5e243dc3b70bb2 Reviewed-by: David Schulz <david.schulz@qt.io>
* Autotest: some FilePath::toFileInfo cleanupDavid Schulz2021-06-101-2/+2
| | | | | Change-Id: I45395c5e83bc01d98d0bec20c992424d4150c844 Reviewed-by: Christian Stenger <christian.stenger@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: Silence coverity warningChristian Stenger2021-05-311-1/+1
| | | | | Change-Id: I8195e9d17a7dfa90724e062c0974e98b74ae2548 Reviewed-by: David Schulz <david.schulz@qt.io>
* AutoTest: Use Utils::FilePath for files and directoriesChristian Stenger2021-05-277-50/+53
| | | | | | | | Still some missing bits as some QString members had different meanings depending on their context. Change-Id: Ib48eab54498974a26bbd5123cbffeefee5f7e79c Reviewed-by: hjk <hjk@qt.io>
* AutoTest: Free TestTreeItem from CppTools dependencyBernhard Beschow2021-04-122-7/+8
| | | | | | | | | | | | | Makes TestTreeItem programming language agnostic. By moving the "query" methods to CppTools, the cohesion within these methods is improved, i.e. information crosses the AutoTest <-> CppTools border fewer times. Furthermore, it allows the CppTools plugin to see how its data is being used, allowing it to optimize its queries behind the scenes. Change-Id: I0a60140abaca1193d500605dfa2812b4d937d94c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Autotest: Partially aspectify autotest settingshjk2021-03-311-6/+6
| | | | | | | | This only handles the storage side, all gui/layouting is left for follow-up changes. Change-Id: I0f2b6dc82e5d4374528c8a72610a5afe264a72b1 Reviewed-by: Christian Stenger <christian.stenger@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 TestTreeItemBernhard Beschow2021-02-041-2/+2
| | | | | | | Ensures that the static_cast<>() in framework() always succeeds. Change-Id: I6aff0cf12a565bd6f9791c67979698729d7143e5 Reviewed-by: Christian Stenger <christian.stenger@qt.io>