Commit Graph

5028 Commits

Author SHA1 Message Date
Orgad Shaneh
119fc885be Dumpers: Fix tests execution on Windows/MinGW
Change-Id: Ie6207f5edba865e880249d6f70daf1e9c72c4163
Reviewed-by: hjk <hjk@qt.io>
2017-09-27 08:27:10 +00:00
Orgad Shaneh
6f1a18cc37 Dumpers: Modernize tests
* Remove QLatin1*
* foreach -> for

Change-Id: Ifac9b14b9904df8d112c71f791f1e0bd45ffc584
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-27 06:20:01 +00:00
Robert Loehning
cf370d5305 Squish: Update debugger tests
The used project looks a little different now.

Change-Id: I786749a4aae5d2ceaff0d2fc65aedf41c04a66f2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-26 10:25:49 +00:00
Orgad Shaneh
3924d3deac UnitTest: Fix build with clang 3.9.1
llvm-config-3.9 --cxxflags has -g1 which is substituted by 1.

Change-Id: I626f3f15c659f7de030c08883b5b739b1d636ada
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-25 11:32:41 +00:00
Nikolai Kosjar
92693b9ac9 Clang: Remove unused messages
Change-Id: Ibe2678de726a867308fac16c6a14b0eff10cbacb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-25 11:27:12 +00:00
Robert Loehning
5b94c3730b Squish: Update tst_SCOM02
...for changed QML file in project template.

Change-Id: I3a0999650bffc35bc09d0f8ae92a33b80ac90474
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-25 09:33:26 +00:00
Eike Ziller
cfdea6b9c2 Merge remote-tracking branch 'origin/4.4'
Change-Id: I7bf72444b19db20fcc7dc2c9d1f02ec2b30b658f
2017-09-25 11:00:25 +02:00
Ivan Donchevskii
68a49c79da Clang: Unify compiler options builders
Make build command the same for all builders.
Minimize differences.

Change-Id: I1cfe5071b3afb4944ed178fff1e57d3aee45d8a9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 15:00:48 +00:00
Ivan Donchevskii
f130de2400 Clang: use HighlightingMarks for hover with Ctrl highlighting
Make this highlighting work without builtin code model
but based on the HighlightingMarks that we already have
from ClangCodeModel.
Redundant parameters are removed by this change.

Change-Id: I73b5dab46ba59d2f813236831818f0a9bc94c5bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-22 12:58:46 +00:00
Nikolai Kosjar
4c571f4056 Clang: Simplify creation of JobRequest
Do what can be done in the constructor instead of relying on the
clients.

Change-Id: I5f475b5309afb37e34d228e54ad3c12f1698d72b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-22 07:25:53 +00:00
Marco Bubke
ed2ae5fa81 Sqlite: Improve SqliteStatement
There are now only value and values methods. value returns an optional
and values are returning a vector. The result value count has now be
specified instead of the result value list.

Change-Id: I17a0741d5e838b4bf4b9486825c870ada1722584
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-21 12:35:36 +00:00
Marco Bubke
2fc4e17e31 Utils: Add Utils::SmallStringView::empty
It is required by many template function because it is used in the STL.

Change-Id: I5a2b9266d0c9d79bdc37cbbc4e7b62fac7a82b8b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-21 12:35:24 +00:00
Marco Bubke
816a9175be Sqlite: Extend database
lastInsertedRowId() function was added and more test are now under test.

Change-Id: I02bf11dbab29654dbff9f2cad8c13c0c4d15e3be
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-21 12:35:18 +00:00
Marco Bubke
fc231309e8 Utils: Fix reverse iterators in SmallString
Change-Id: I859c801fdb1ad68d5943b580f07a9e8260ae192a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-21 12:35:10 +00:00
Marco Bubke
2df9a99cac Clang: Add RefactoringDatabaseInitializer
We moved the creation of the tables and indices to an extra class which can
be called from other places. So you can be sure that a database is
initialized.

Change-Id: Ief5b30ced7b9011ca94367aa2578098423dcecd9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-20 10:45:07 +00:00
Marco Bubke
623135592c Sqlite: Add locking for sqlite transactions
If you use the database in a multi-threaded environment, you must always
your statements in transactions.

For read-only statements, you use DeferredTransaction and write statements
you use ImmediateTransaction. If you mix read and write statements you have
to use ImmediateTransaction. Don't use DeferredTransaction because it leads
to undefined behavior.

Change-Id: Ida298a20f33423c8da09e768a7b658dd8e918f46
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-20 10:44:37 +00:00
Marco Bubke
c870199823 Sqlite: Don't use the lower level interface of the statements
We now have the very powerful write and read methods, so using the low
level interface leads only to stupid errors and prevents optimizations.

Change-Id: If2340833977935cb2d319735dee96b0bac33142b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-20 10:44:15 +00:00
Marco Bubke
a83d038208 Sqlite: Improve exception handling
Introducing different exceptions for different error cases.

Change-Id: I4371d1e64d9dca2a9f68dcbaa4a891c55879c1f5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-20 10:43:59 +00:00
Nikolai Kosjar
76006a1353 C++: Fix crash with invalid raw string literal
While parsing a document Bind::asStringLiteral() Token::spell() was
called for a raw string literal token with a Token::literal nullptr.

This is due scanRawStringLiteral() not properly aborting for
invalid/incomplete code and that the code paths handling
multi-line-raw-strings were not limited to the highlighting case.

Address both cases.

Task-number: QTCREATORBUG-18941
Change-Id: I489d288ccbd7b59be396dada846613ff555436cf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-20 07:38:04 +00:00
Andre Hartmann
50581683ba CamelHumpMatcher: Support uppercase snake matching
Often used for macro names, e.g. TEST_ASSERT_EQUAL_FLOAT(),
which can now be matched by "TAEF".

Change-Id: I0626a60e2be68c1514c28769c679212075227281
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-19 17:03:10 +00:00
Orgad Shaneh
a627f4eef7 Dumpers: Print readable output in tests
Change-Id: I32864c9c1b8fe60b5b01423f68e63a3c00b936f8
Reviewed-by: hjk <hjk@qt.io>
2017-09-19 13:47:19 +00:00
Robert Loehning
9afe6fa1c4 Squish: Update texts of message boxes
Change-Id: I3ca17bb62201d6271c0e98d07a99f7344faba439
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-19 12:04:54 +00:00
Tobias Hunger
5bd2887045 Environment: Keep case of environment variables on windows
Task-number: QTCREATORBUG-18915
Change-Id: I4c389155e03dde423d1ed578409baa1f38fc26db
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-09-19 11:37:03 +00:00
Eike Ziller
3d9cf954e2 Merge remote-tracking branch 'origin/4.4'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/debugger/gdb/remotegdbserveradapter.cpp

Change-Id: I1ae77869887a8d9ef2a33439f2733315db9e0cf0
2017-09-19 12:10:26 +02:00
Robert Loehning
b58dadfecc Squish: Enclose code model tests in sections
Change-Id: I4478acfc5ea7b3fa22d1cd17576e04fdda81dbb9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-19 09:44:08 +00:00
hjk
fe1cbd0f87 Debugger: Add yet another virtual inheritance test
Failing for now.

Change-Id: Ic624b9c64f85f06bf61a2e8f765a272a835c0c43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-19 09:20:52 +00:00
Andre Hartmann
632f2a7709 Locator: Add camel hump locator filter for C++, QML, and files
* Use the CamelHumpMatcher in the C++, QML, and files filters
* Supports matching against UpperCamelCase, lowerCamelCase
  and snake_case strings
* Supports highlighting of matched characters

Task-number: QTCREATORBUG-3111
Started-by: David Kaspar <dkaspar@blackberry.com>
Change-Id: If6220191432ef965bde3c8dbe4a10d89e222ba6f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-19 08:24:38 +00:00
Orgad Shaneh
2fb54abd03 CamelHump: Do not match first char in the middle of a word
When matching NLH against LongCamelHump do _not_ consider the N
of Long as part of the match. The first character needs to meet
the same requirements as the others.

Change-Id: I4e7b2fe5a28296afe6f06f90e1986336fe7f3179
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-09-19 08:24:14 +00:00
Orgad Shaneh
f97657b15e Dumpers: Add a show case for C-style strings
Change-Id: Ic70761ffcd76bdfed7879c222d471b50a8b32c0b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-09-18 15:00:37 +00:00
Marco Bubke
382c9647e8 Sqlite: Remove the Sqlite Prefix
We use a name space now, so the prefix is not of much use.

Change-Id: I2b077576f94dab778add6ab2e54870f7ca18da78
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-18 13:37:11 +00:00
Orgad Shaneh
2760b9fc67 Dumper: Dump CHAR/WCHAR arrays as strings
Change-Id: I78bdb181e27cc858356c9026fc960135b54cdcbb
Reviewed-by: hjk <hjk@qt.io>
2017-09-18 11:43:51 +00:00
Marco Bubke
76a7dff82b Utils: Simplify SmallString reserve
The reserve function is quite complicated because it is implementing a
grow pattern. Something we seldom need. So we now align to the next cache
line size.

Change-Id: I14bb88c12bd740a7afa7cd08969a4e07fb0f9add
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-18 10:17:11 +00:00
Marco Bubke
53f68fd86f ProjectExplorer: Remove test for Macro
Under windows the signature for private and public member are different. So
the hack to make private members public is not working. The other method
to use a macro project macro header is not wanted.

Change-Id: I25a3f4a8645394ba6b49a7d4778adab90155f892
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-18 09:38:08 +00:00
Ivan Donchevskii
a137b08eaa CppEditor: refactor FollowSymbol
Create an interface to get the ability to use
another FollowSymbol implementation

Change-Id: I5802f62523ff3ee47b8a14e487adf43edcb6c9b1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-15 14:14:01 +00:00
Ivan Donchevskii
76d12dc2d5 CppEditor: add default RefactoringEngine
..and use it when we don't have refactoring plug-in

Change-Id: Ibe317a9728d439b9c5e05271d92a330d22eaacb9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-15 14:13:48 +00:00
Nikolai Kosjar
d1799b9aa1 UnitTests: Fix build with QTC_NO_CLANG_LIBTOOLING
Change-Id: Ia2c5b9cf617e56f09bf334bdd57e58bf96c838b1
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-15 09:59:46 +00:00
Marco Bubke
b6e12f4a1c Convert macros from plain QByteArray to a vector of structs
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>
2017-09-14 15:23:56 +00:00
Marco Bubke
3adb71d45e Clang: Add Symbol Indexing
It is a first step and now a database is generated if you start QtCreator.
Some code is now shared with the PchManager which can be improved in the
future.

Change-Id: Ic267fe7960f6c455d91832859a673ce98f269aa2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-14 13:39:55 +00:00
Robert Loehning
89d08bf4b2 Squish: Update createNewQtQuickApplication() and calling code
This is only meant to let the wizard finish successfully. Further
changes will be needed because of changed code in the project.

Change-Id: Ic88ffa107f15c55b3278d3d6fc4d3c2dbc4d728b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-13 13:17:13 +00:00
Robert Loehning
9690337f47 Squish: Update expected tree for tst_cmake_speedcrunch
Needed since 3bb3f4af56
filters out duplicates.

Change-Id: If7e56914feb9d22c1620822fbb363b55b894a41a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-12 12:20:10 +00:00
Christian Stenger
6d0c167ba7 Squish: Update language test
Danish and Ukrainian had been added a while ago, so add them to the
list of languages to check.

Change-Id: I92c507e3a567efa39d7295559af0fb16bbcd1bb6
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-09-12 09:53:30 +00:00
Robert Loehning
1e3b5418ea Squish: Update createNewQtQuickUI() and calling code
Change-Id: I117afaabd0baf6074247c55b66d8d302b9dbfd34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-12 09:37:59 +00:00
Nikolai Kosjar
f2e5e22009 Clang: Avoid waiting plugin side if (re)parse fails
If a parse or reparse operation fails, the corresponding translation
unit is "not intact" anymore and further job requests for that
translation unit will be silently discarded without notifying the
plugin. This is especially problematic when the plugin expects/waits
(for) a certain message.

A parse/reparse can fail due to e.g. an invalid commandline or an
internal crash.

In such a case, ensure to send some dummy results.

Task-number: QTCREATORBUG-18864
Change-Id: Ida9b8066fd55e64027a9b0d8bd5cf365b16a7356
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-12 06:46:29 +00:00
Robert Loehning
40e90cb8be Squish: Update expected combo box in tst_WELP01
Change-Id: I35f40a637a6914bea2057b951409b21b7ce90c8d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-08 11:47:26 +00:00
Eike Ziller
a9aac73e37 Merge remote-tracking branch 'origin/4.4'
Change-Id: I53a31b3463b2bd8efffb1c00e5d172854d8ff5e5
2017-09-08 13:06:07 +02:00
Ivan Donchevskii
79e94ddae8 Clang: Workaround completion for make_unique/shared
Change unsaved file to provide constructor overloads
for std::make_unique, std::make_shared and
QSharedPointer::create

Example:
// Provide Foo constructor signatures at <Cursor>
std::make_unique<Foo>(<Cursor>

Task-number: QTCREATORBUG-18615
Change-Id: I87dd17085adf99ee498db969a3cdda5ebd973476
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-08 10:13:08 +00:00
Ivan Donchevskii
d809e3fb8f Clang: send function name position for completion
... to reuse this position in backend (instead of
searching the function start again)

Change-Id: I02818dce4fc37ed6e7ecfb533191dbfe60610204
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-09-08 07:37:06 +00:00
Christian Stenger
85e656b041 Squish: Workaround Squish issues when using nativeType
When using nativeType() Squish sends single key press events for
any char to type.
nativeType() does not wait until these events have been processed
which leads to complete useless time measurings inside
tst_tasks_handling as timestamps are taken too early if nativeType
had to be used - which happens when a native FileDialog is used.

Change-Id: I446de898fd99b2e169ca39bef1adb4306d6ee530
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2017-09-07 12:47:44 +00:00
Nikolai Kosjar
88e7af8a21 UnitTests: Disable related tests if suspend-patch is missing
Change-Id: Ifdccf2e5842aff13528e52caa4dfd3288214d723
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2017-09-07 08:59:40 +00:00
Robert Loehning
f98731b81a Squish: Update tst_create_proj_wizard
Change-Id: If6c85dab873fac694e3d0bea3ff65cbb08618f4d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-06 13:50:00 +00:00