The ClangTools and the AutoTest plugins use an internal
mechanism to load and configure a project when performing
their integrated unit tests.
Both assumed to have exactly one kit present for these
tests.
Make it possible to have more kits present when starting
with existing settings or if more kits get automatically
generated when starting with clean settings.
Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The ClangTools plugin tests open a project and immediately trigger a
build afterwards. We checked whether CppModelManager got already data
from the project manager, but this alone was racy for the mentioned use
case as e.g. the QbsProjectManager might still be in parsing mode and
thus the build was not triggerable. Check for the parsing state, too.
While at it, simplify the code by using QTest::qWaitFor(), which also
takes care of posted events.
Change-Id: Id298695b2e67578def42275bac4ea31f4a39edf2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... to the bits that are actually used.
Change-Id: I39a6ed1f4136d75b776bb89eec6165479097a4ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
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>
This reverts commit 05942b63f8 because it
breaks refactoring, e.g. Q_PROPERTY generators.
Change-Id: I9a14b912ba72663f08ea99e7e066d824b18da4b0
Reviewed-by: David Schulz <david.schulz@qt.io>
Both wrap the corresponding Qt class, but make sure all temporary files
or directories are created inside a "master temporary directory".
Change-Id: I55461be507c828c965224c02863ea5ed9bbf9498
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
These are remnants of the time when we had only one snapshot.
Change-Id: I6ff4db645d1065a0ef195834890e0774e2e2c60e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Fix fallout of this in KitInformation/Kit/KitManager and the wizards.
Change-Id: I5cb88cc381dc04409401909b810940ab6dccf86a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Instead, switch to edit mode, show sidebar, scroll to project,
and show a tooltip next to the project.
The tooltip is somewhat easy to miss, but this is a clear improvement
in most cases.
Change-Id: Icd27f76e7d434f33e731b6fd56473ff913986a89
Task-number: QTCREATORBUG-8422
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Among others, BaseEditorDocumentParser::projectPart() was a blocking
operation in case the parser was running. This led to noticeable GUI
freezes for the ClangCodeModel since the function was called from the
main thread.
Rework *EditorDocumentParser to clearly separate the configuration data
(input) from the actual object state. Querying/setting configuration or
(last) state does not block anymore. update() is supposed to get the
necessary configuration and the last state at the beginning and to set
the new state at end.
Change-Id: Ib4b534fa6ff373c3059826726b3f10ece95acc21
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
...coming from TemporaryCopiedDir.
The warning was:
QTemporaryDir: Unable to remove <some path> most likely due to the presence
of read-only files.
It occurred for plugin tests (e.g ClangCodeModel) that used a Qt resource path
as source for TemporaryCopiedDir. Copying a qrc file makes it read-only, see
also QTBUG-17163. Therefore, explicitly add the write permission.
Change-Id: Idc04acd4844c5bc20e9b3de1efc78da3b06ac97c
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Needed for ClangCodeModel.
If editors are open, the global snapshot and working copy will not be
empty.
Change-Id: I0d1bab8e082a7f41630c7b1b78febe2da009298b
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Temporary directory is created in a folder having a symbolic link,
verification was done with the unresolved path and failed.
Change-Id: I40c943a307fe136a0f3f6fdbea5145296a63a19e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Instead, always write into a unique temporary directory in
QDir::tempPath().
Where applicable, read the test source from files instead of first
writing the file.
Some clean ups in test_codegen*.
Change-Id: Id48dc50c6ca16252edfd9fc8a86ba0de9f9be486
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
The test was broken since the QmakeProject was changed to work
asynchronously.
FAIL! : CppTools::Internal::CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles() Compared values are not the same
Actual (workingCopy.size()): 1
Expected (2) : 2
Change-Id: I6f7d05fb70af3def5fc371a9783b606309686e32
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* Get rid of CppModelManagerHelper.
Now we simply use CppModelManager::projectInfo(someProject).isValid() to
test whether a project is loaded.
* Copy project data to temporary dir before opening the projects.
This avoids creating *.user files in the Qt Creator source tree and
annoying pop ups on test start.
Change-Id: I1a57441ca2099beb6bb96cf620390d669fb47601
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Replace the CppModelManagerInterface/derived CppModelManager
combo by a more common CppModelManager/CppModelManagerPrivate
pimpl pattern.
Change-Id: Ia4582845ed94d5ef60b8571bab9b2260c6290287
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This eliminates a bunch of list->set->list conversions. Especially the
ProjectInfo::appendProjectPart takes lots of time converting for every
part added.
Change-Id: Ib3c8cd4b0ad6c012ccbeed12ebedd46b9b6cca95
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
In test_includeGroups_detectIncludeGroupsByIncludeType the test file was
not removed and thus subsequent and isolated executions of this test
failed.
Change-Id: I5eeb4f004f5b146ac794ca913b4092629131fca3
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This is necessary in order to add tests with multi-byte UTF-8 code
points. Otherwise the initial and target source code marker positions
will be calculated on the QByteArray (test code) but used with a QString
(editor document).
Change-Id: I108961b13d32912a4d3193cf26eb59f65d296f57
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Closing an editor might trigger a timer which leads to the invocation of
the garbage collector. This is unfavourable for the plugin tests since a
test function closing an editor might influence a subsequent test
function (e.g. files get removed from the global snapshot although they
were added shortly before).
Change-Id: Ia80c11f99e2437fe145dc2d983b21962539b5181
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
QVERIFY/QCOMPARE are meant to be called in the test function so that on
failure they just can "return" and thus skip subsequent code. Since we
use reusable test code in the test functions (the *TestCase classes), we
need to ensure that on failure no further test code is executed.
This mostly inlines the run function of the test classes into the
constructor.
Change-Id: I320ee032bdde0174ddfe3fdf3f9e18e19abf1d7f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Move common functionality of the 12 test classes into base classes.
Change-Id: If64d3cec876807ac6f991151189860a99b8ff4ca
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>