Commit Graph

4400 Commits

Author SHA1 Message Date
Nikolai Kosjar
7415964819 CppTools: Fix choosing project part after project open
As long as there are project parts for a source file, always determine
the best project part, instead of trying to stick to the previous one.
This ensures the best project part at all times and simplifies the code.

Change-Id: I25ea3eb43a5a3e6d93688d4b8965f596dc9ae22b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-26 07:52:54 +00:00
Nikolai Kosjar
bddfe21961 CppTools: Fix using updated project part
1. Open a project consisting of two subprojects referencing the same
   source file.
2. Open the source file.
3. Click '#' in the editor toolbar and select the second project (part).
4. Update the project file, e.g. add a define
   ==> Editor does not reflect the added define

This is due to comparing project part pointers. Fix by using the project
part id that remains stable across project manager updates.

Change-Id: Ifd1a113e55ebe2ecf036cd7caafdbfd6e4cdf415
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-26 07:50:11 +00:00
Nikolai Kosjar
07f32ef57a CppTools: Use fallback project part if project is closed
...instead of sticking to the old one.

If a project is closed, the editor should reflect that. It also simplifies the code.

Change-Id: I9b8a94513d3b06a238cfc4ee60c11c0d0da3d93f
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-26 07:50:05 +00:00
Nikolai Kosjar
0b8df41387 CppTools: Provide hints about chosen project part for editor document
Parse issues can have multiple reasons (invalid kit, not a project file,
actual parse issue) and we should be able to tell them apart. With this
change, we can distinguish between the fallback project part and a
ambiguous project part.

Follow up changes will use this to display more accurate diagnostics.

Change-Id: Icc8767607cc17dc14d6227b07f34e81ba5525a96
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-24 14:41:48 +00:00
hjk
ef80d060e7 FakeVim: Remove a few uses of QObject::sender()
Considered bad style...

Change-Id: Idc1d39bd55fa30dfa854bbc99094f5f6ec9afc4d
Reviewed-by: Lukas Holecek <hluk@email.cz>
Reviewed-by: hjk <hjk@qt.io>
2017-01-24 11:10:12 +00:00
Eike Ziller
b1e2d5b693 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ib3073a0a3d80c99cf97b9839480dbf9583fa10de
2017-01-23 13:13:14 +01:00
Filippo Cucchetto
4b1f8f3609 ProjectExplorer: Added support for registering custom languages
Change-Id: I728a2ed1ef7d9f44d7c2b59d27d6e23444cd3bb5
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-23 11:19:11 +00:00
Thomas Hartmann
f9f74566a7 QmlDesigner: Do not escape "\" for unicode chars
Task-number: QTCREATORBUG-12616
Change-Id: If8cac8d35cb97f59e12d1609f808dd639f93f315
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-20 13:12:07 +00:00
Robert Loehning
eeb0b8fd21 Revert "Revert "Utils: Remove old compiler support code""
Thomas provided a smaller fix.
This reverts commit 78fb7f44bf.

Change-Id: I1edff6477526fe4ce29df38852f47fe49117561e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-01-19 12:21:43 +00:00
Alessandro Portale
78fb7f44bf Revert "Utils: Remove old compiler support code"
This reverts commit 8a32bcc5e7.

Broke build with MSVC 2015, update 3

Change-Id: Icb59b70fb00ea2a2ecc8d26c8177d21d82aaccf2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-01-19 11:47:26 +00:00
Marco Bubke
8a32bcc5e7 Utils: Remove old compiler support code
We now support constexpr, noexcept and alignas on all compilers. Next will
be C++ 14 constexpr support.

Change-Id: I254049c60dcd82fc373ec907cbb5702a4b344978
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-19 10:59:40 +00:00
David Schulz
c8bd342597 Debugger: Adjust std map test to msvc iterator dumper
Change-Id: I3c9e4138d2e0a3ec4083f01d243eb707905e9f18
Reviewed-by: hjk <hjk@qt.io>
2017-01-19 07:11:20 +00:00
Christian Stenger
1e0b7e58b8 Tests: Avoid automatic masquerading of newline characters
Change-Id: Ic18083e9b21051a03a69c6c6e10a23e7144ad647
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-18 14:50:38 +00:00
Christian Stenger
bdd0c83751 Squish: Configure C-toolchains for macOS
Change-Id: I3d4fcc25ecca8a02e8dbbace4fc063a72cd85a40
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-01-18 14:50:26 +00:00
Thomas Hartmann
f446fdc077 Fixing capitalisation of titles
Change-Id: I6a915cc69fe1cf6630d1a9a0fdb6b7a8d39b306c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-01-18 13:41:38 +00:00
Robert Loehning
1a6e6ed553 Squish: Configure C-toolchains for Linux
Change-Id: Id2bd1768e2520bbcfdc918939722f7f5935b8fce
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-01-18 08:35:50 +00:00
Nikolai Kosjar
e4e6572661 CppTools: Allow interpreting ambiguous headers as C headers
...instead of C++ headers.

For the Clang Code Model this results in using "-x c-header" instead of
"-x c++-header".

This introduces a new option in Options > C++ > "Code Model" to
configure this.

Change-Id: I8a0ce8fa6155f5ef58743ebc7f1d0b500fbf6599
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-01-16 10:17:50 +00:00
Eike Ziller
b1f1ccb32e Merge remote-tracking branch 'origin/4.2'
Conflicts:
	src/plugins/android/androidbuildapkstep.cpp
	src/plugins/genericprojectmanager/genericproject.cpp

Change-Id: I3484b668f9323ed0c05de99f8dfed07c9e65ab98
2017-01-11 09:29:37 +01:00
Robert Loehning
4d79ffb8f3 Squish: Replace progressBarWait() in tst_debug_empty_main
The progress bar already disappears while we're still in Projects mode.

Change-Id: I7dcf24d1d423eba3057868c4323b2054c99d19f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-01-09 11:56:18 +00:00
Tim Jenssen
5ad0cbc070 QmlDesigner: remove unnecessary save method
Change-Id: Ia2a195c84ce83bc3a83155cc19b0585475a5547a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-06 11:26:27 +00:00
Robert Loehning
611a970819 Squish: Configure C-toolchains for Windows
Task-number: QTCREATORBUG-17406
Change-Id: Iafa1b38f75fa56691e646aaf2fad61504f0706e8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-01-06 10:23:12 +00:00
Nikolai Kosjar
85d8fbfdac UnitTests: Add rpath to $$LLVM_LIBDIR
Change-Id: I9be996e0639bacc1d09527e3fb2621311bb067f9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-01-06 09:39:22 +00:00
Christian Stenger
9d328ef1a9 Squish: Fix adding new kit
Projects view has changed and so has functionality of adding a new kit.

Change-Id: I44377822b8b850fd17be24e12f7e5d0104be568d
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-01-06 05:51:59 +00:00
Robert Loehning
7746c31774 Squish: Use different function name in tst_CSUP01
realloc is not being listed by Clang Code Model

Task-number: QTCREATORBUG-17490
Change-Id: I006fee04579706fbf5edf8b890bd7be8e090d01f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-01-04 14:43:32 +00:00
Robert Loehning
2a6c315fbb Squish: Workaround unexpected error message
Task-number: QTCREATORBUG-17492
Change-Id: Icda68a756b3420baa494e90c41dbefc656ae6327
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-01-04 14:42:18 +00:00
Robert Loehning
ae0ea76f07 Squish: Fix timing issue in tst_HELP06
Change-Id: Ic88207d86cf3f926fc4df681be4cfaa1a62ba763
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-01-04 14:41:54 +00:00
Marco Bubke
ada5ea1952 UnitTests: Fix names and disable slow tests by default
Slow and very slow tests have now their own test category. We add SlowTest
for tests which are slower than ~5ms and VerySlowTest if they are slower
than ~100ms. They are disabled them by "-*SlowTest.*". If you have a faster
machine than most developers simply try lower values. The aim is that most
developers can execute the tests in under ~2s.

In the long run we should use dependency breaking and data sharing to
reduce the count of the slow tests.

Change-Id: I8578071258d7f89b2052709f3dd526ced811483f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-04 12:35:52 +00:00
Tim Jenssen
7dc64a1c1d Clang: fix dependency for "nmake check"
Change-Id: I82bca786a39a091804f9f39b1c037483dd595f5f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-04 07:55:52 +00:00
Orgad Shaneh
c2d25982a1 UnitTest: Add a missing include
Compilation doesn't fail since compileroptionsbuilder.h is indirectly
included before cpptoolsreuse.h.

Change-Id: I1f1b543a71546268e44fc9ec6c4a4530854e4659
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-02 15:01:26 +00:00
Tim Jenssen
75f867b9bf QmlDesigner: Implementing changing the type of a node in the model
The type of a ModelNode can now be changed in the model.
The rewriter can already handle the case and the NodeInstanceView
does a reset.
We still have to expose this new feature in the UI.

Change-Id: I9bc405d40b123f257324ba582a4451fbd395f24f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-21 11:44:57 +00:00
Christian Stenger
3ffec118d0 Squish: Fix switchToBuildOrRunSettingsFor()
Properties of the model indices did change recently and so
checking for enabled does no more work - use its toolTip
content instead to check for the enabled state.

Change-Id: Idc2b5ed1a0a14cfabdbdb4231eab243d28c0aee7
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2016-12-21 10:58:05 +00:00
Tim Jenssen
f8618740a8 QmlDesigner: fix make check at qmldesigner tests
Change-Id: Ibadfb2f37c5b67fd5e12bcad4180e68aa8843aa6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2016-12-20 16:55:38 +00:00
Tim Jenssen
9de96a9997 QmlDesigner: just skip not working test
Change-Id: I90b279a16a082d4dbb6e5bc45ae1a573d2f85bee
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2016-12-20 16:55:31 +00:00
Nikolai Kosjar
186368c202 UnitTests: Disable known to fail tests for Windows
So we can easily verify if other changes break anything.

The disabled tests should be all related to the by default enabled delayed
template instantiation on Windows, which is necessary to parse windows headers.

The disabled tests can be run with --gtest_also_run_disabled_tests or by
setting the env variable GTEST_ALSO_RUN_DISABLED_TESTS=1.

Change-Id: I040d881ff0a3fbf5fe85c0b3d1b8e7b0959d1b9c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-20 16:29:58 +00:00
Eike Ziller
589fedf455 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/projectexplorer/kitinformation.cpp

Change-Id: I94299b069418586db97d1d596a252794e4037556
2016-12-20 17:14:19 +01:00
Thomas Hartmann
003a8985a2 QmlDesigner: Adjusting tests
We do not allows ids like "text" and "item" anymore,
since they are ambiguous. This patch adjusts a couple of tests.

Change-Id: I93a1404c052a8f1d302c179141c6feb35e83afc8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-12-20 09:39:56 +00:00
David Schulz
3c31692669 Debugger: Add a TypeDef construct to dumper test
Reducing the amount of duplicated checks and skip messages.

Change-Id: If7bb2057ef153c3829f28e131a77765fbacccc40
Reviewed-by: hjk <hjk@qt.io>
2016-12-20 06:12:09 +00:00
David Schulz
927df87f32 Debugger: Add engine to context of the dumper test
Change-Id: I52fa0281ef6911aaafbb7622a811fe8a0b78a8ea
Reviewed-by: hjk <hjk@qt.io>
2016-12-19 16:33:54 +00:00
David Schulz
f2261e4661 Debugger: Adjust dumper test to cdb python dumper 2
Change-Id: I49f425484f270551ffef4281b70f10c8cad02030
Reviewed-by: hjk <hjk@qt.io>
2016-12-19 13:30:29 +00:00
Nikolai Kosjar
9861a58400 CppTools: Prioritize project parts with selectedForBuilding=true
...when selecting one for the editor document.

This flag is only set by the QmakeProject.

Change-Id: I648886e12148bd1ebeccca52d9faaf4b528597c9
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-19 09:21:19 +00:00
Nikolai Kosjar
602c873d3e CppTools: Reparse editor documents after active project change
Change-Id: I010709c866291bf59c27f4a05765e1ab0efd28af
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:56:31 +00:00
Nikolai Kosjar
566ab175b3 CppTools: Prioritize project parts from active project
...when selecting one for the editor document.

Change-Id: I85066aaa0862870cb2db2fb2cb40c2b2c23b2cac
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:56:16 +00:00
Nikolai Kosjar
e691a5e96c Clang: Fix test ProjectFileKindsMatchProjectPartVersion
Change-Id: I9b2470f36ea8f6b5882ac10f28f3a05cbe890801
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:42:58 +00:00
Nikolai Kosjar
ce1c6b2258 CppTools: Extract ProjectPartChooser
...and put it under tests.

Change-Id: Id4bd2391abd1dfdc23640e871453558566cb0693
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-16 13:40:23 +00:00
hjk
90a4ff723b Debugger: Remove need for debug builds in some dumper tests
Not needed anymore.

Change-Id: I206c2ae4e93306f8dc4fcea0dab727f769ad739c
Task-number: QTCREATORBUG-16908
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-16 10:17:00 +00:00
Christian Stenger
62118e9d78 Valgrind: Move some memcheck auto tests into plugin
Due to changed dependencies it is nowadays necessary to have more
of the plugin infrastructure at hand. Moving memcheck related tests
to be able to execute them as QC plugin unit test.

Change-Id: Iab492b3cb87728425b950ca9387edf292d895350
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 10:04:56 +00:00
Marco Bubke
1e3f2eec8d Clang: Consolidate all ClangCompilerOptionsBuilder into one implementation
We used the same code in different but don't shared it. From a bug fixing
perspective it's actually not that smart.

Change-Id: Iaaffc883229e259ff77f95b5cf0a8f0d8b5117df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-12-15 10:18:15 +00:00
hjk
0e6c9d26f1 Debugger: Fix pointer arithmetic in dumper framework
Task-number: QTCREATORBUG-17428
Change-Id: I1e3a682a6f412af51e191dc783b89ff266020e3b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-12-14 14:23:37 +00:00
David Schulz
0cadb398a5 Debugger: Add environment variable for cdb extension path
Change-Id: I6d7710ad3f4ba8b9dd32928c06d36191e63e9d3b
Reviewed-by: hjk <hjk@qt.io>
2016-12-14 08:10:16 +00:00
Nikolai Kosjar
02d8e2af1b CppTools: Clean up ProjectInfo
Change-Id: I5d0db45d9fdb624bb6cc55d7f04061d553f13bce
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-12-13 09:15:25 +00:00