Commit Graph

4883 Commits

Author SHA1 Message Date
Christian Stenger
bad4cb4896 Tests: Fix wrong license header
Introduced with b278dc87ca.

Change-Id: I595384b35e9e5f2f319ec4e9c1ad92f7fc4bdcd4
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-02-22 07:22:36 +00:00
Marco Bubke
1eb0c94f81 Utils: Add SmallString
SmallString is a very simple utf8 string class. It's purpose is performance.
It uses a short string opimization which provides 31 bytes of heap free
memory to save a 30 bytes long string plus null terminator. If the string
gets larger heap is allocated. The grow strategy is 1.5 to improve reuse
of allocated memory.

It uses optionally constexpr to provide string literals.

Change-Id: I7757fb51abfeca200d074cbfce2f1d99edc0ecb0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-17 15:07:01 +00:00
Marco Bubke
7984e928d1 UnitTests: Rename CLANGBACKEND_TESTS in UNIT_TESTS
Change-Id: I26635a0c85edcc90cdffb93d3f9ae4ad4c8cb98e
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-17 14:57:53 +00:00
Robert Loehning
122f896548 Squish: Update addHelpDocumentation()
Change-Id: I8b26f1e5efbc51058306ea7183c0b37bcbc49179
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-17 14:52:04 +00:00
Marco Bubke
f8884501c2 Clang: Add Google Benchmark unit tests
Change-Id: I5d137aebd3e94f5d2f867d8ec007973a827491ec
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-17 10:35:34 +00:00
Marco Bubke
b11c14808d Clang: Fix broken windows build
Change-Id: I51b696cbb04e50058ace92a3ead04e3655b0a2f6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-16 18:27:44 +00:00
Robert Loehning
7aa8dc38e9 Squish: override startApplication in startCreatorTryingClang()
Change-Id: I6cb16c2a93ca46503f056c558eb8a6a2b33153d7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-16 13:16:00 +00:00
Robert Loehning
9d8e4aa922 Squish: Test overwriting of files when adding class
Change-Id: I86ed9a3749f692fe9ead13c31e0ba62c2baa3020
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-16 13:14:35 +00:00
Kevin Funk
0d079062d9 proparser: Make compile
Change-Id: Ifb96fd11f542f9622ea3867c3bf877e722120136
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-15 17:44:14 +00:00
Robert Loehning
692261564f Squish: Include binary editor in tests
Change-Id: I0b4fc4e0cb18dcbd569ebdba201bfb9e2596ba5b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-15 10:44:47 +00:00
Robert Loehning
901d74121a Squish: Use existing tools for finding executables
Change-Id: Ic3e7f5db6d12e37f908df3290893768a5be4fa56
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-15 10:43:11 +00:00
Robert Loehning
6f7c4249ad Squish: Stabilize tst_CSUP06
Change-Id: I52f4c858f178cb3018e57461e2350564fbf78024
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-15 10:40:54 +00:00
Nikolai Kosjar
b064b06759 Clang: Display also child diagnostics in tooltips
...by introducing a custom tooltip widget for diagnostics.

Locations and fixits of child diagnostics are presented as clickable
links, leading to that position in the editor or to the execution of
that fix it.

Change-Id: I83e801e22d0421dd29275e333e5dd91587885cf1
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-02-12 11:54:09 +00:00
Nikolai Kosjar
9a4284d666 Clang: Use CppHoverHandler for diagnostic tooltips
We used to call QTextCharFormat::setToolTip from the ExtraSelection to
install the diagnostic tooltip. Since this allows to set only text
tooltips and we would like to introduce a custom tooltip widget for
diagnostics, make use of CppHoverHandler, which is more flexible.

Change-Id: Ia1b2c3c50810596ce4a3a025002e6e4efd8789db
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2016-02-12 11:20:27 +00:00
Eike Ziller
72af6b7834 runAsync: Remove ResultType template parameter.
It is now deduced from either the type of the
QFutureInterface<ResultType> function argument, or the return type.

Change-Id: Iddab3cc329206c649a6e55a44b2de2d406701dee
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-10 10:58:55 +00:00
Marco Bubke
974070d2c8 Clang: Use MessageEnvelop instead of QVariant
QVariant has unwanted dependencies so we provided our own simpler solution.
We want to support move only types and calling the copy constructor as you
move the value in and outside. This copying is adding unwanted overhead
too.

Change-Id: I2e27a7924868efe81e8b8ff3415499c9fa22c2bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-08 14:11:44 +00:00
Christian Stenger
5f69a505ec ClangStaticAnalyzer: Fix flaky tests
The same problems we had on Windows (started() emitted before
QSignalSpy::wait() called) occur also on OS X.

Get rid of the QSignalSpys completely and watch out for the signal
emissions manually.

Change-Id: I092126c6605b046f250999b8ff04d11e685297c2
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-02-08 09:06:53 +00:00
Eike Ziller
d362abf1e2 runAsync: Support functions without QFutureInterface parameter.
Change-Id: I8e387d683eceab642ddd3fac90a2a5f407a868dc
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-05 08:57:49 +00:00
Eike Ziller
41d4fabf34 runAsync: Allow thread priority without thread pool
Change-Id: I6d4ee8fa1bf45c7a24ff6a004b3c69007c645547
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-04 10:13:20 +00:00
Eike Ziller
b19cac022e runAsync: Add test for move-only types
Excludes MSVC2013 which doesn't really support moving.

Change-Id: I2bffa546f2c90946b4d99e0eee292741b900a386
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-02-03 14:08:36 +00:00
Robert Loehning
cb7b24be15 Squish: Try to stabilize tst_qml_js_console
Change-Id: I9de2d7784954ebe658530505ba64e816a95d411c
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-03 13:53:36 +00:00
Eike Ziller
b1b118821b Merge remote-tracking branch 'origin/3.6'
Change-Id: Iba662995e76f1b6ec135d64072a36a2498b2b5bb
2016-02-03 10:55:48 +01:00
hjk
dcfb622126 Valgrind: Simplify device setup and handling
Make isLocal() less intrusively used and correct.  Use the stored device
more often, also handle errors more quickly.

Change-Id: I146d1f5788ea79d0a9d7b058c81908d451cf00d0
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-02-02 14:14:02 +00:00
Robert Loehning
8c13f2437e Squish: Increase timeout in tst_git_first_commit
Change-Id: Id65b729cd200bb37ad132b4071a263ab61bb3ed8
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-02 10:19:12 +00:00
Nikolai Kosjar
db8b9f9463 Clang: Fix variable name in test
Change-Id: Ief210920c62710786cf75fd6aea04897f4e2965e
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-02-01 15:17:11 +00:00
Eike Ziller
5952165cf9 Merge remote-tracking branch 'origin/3.6'
Change-Id: Ic4d3d94feaaa588c6244509bb3dd14c5cb646fe7
2016-02-01 16:15:48 +01:00
Nikolai Kosjar
57877cc14d Clang: Workaround dot detection for arrow correction
...by explicitly checking for the dot in the source.

Task-number: QTCREATORBUG-15654
Change-Id: I4172e88a7fbb3015ef391daf13ded1f0002aab9c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-02-01 12:20:58 +00:00
Nikolai Kosjar
da27ea4d42 Clang: Introduce UnsavedFile wrapper
This simplifies UnsavedFiles and makes TemporaryModifiedUnsavedFiles
useless.

Change-Id: I1896f971215ed22ce7aa7bf21b16381862b7469d
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-02-01 12:20:53 +00:00
Robert Loehning
7114ee9149 Squish: Run tst_CSUP01 on clang code model, too
Change-Id: Ic2424cc9d962feff06baadc23a5fdf121bf2a11d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-02-01 11:38:49 +00:00
Eike Ziller
4a954c296e runAsync: Fix unexpected behavior for using singleShot/timers etc
Timers/singleShot etc can only be used in QThreads (they require the
event dispatcher). So we have to use QThreads instead of std::threads to
nicely interoperate with Qt features.

Task-number: QTCREATORBUG-15681
Change-Id: I851e2f102e15ccd3347d455cc9d8b7df935c2d5e
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-01-28 14:18:09 +00:00
Eike Ziller
349b49caaa RunExtensions: Allow running functions on arbitrary thread pools
Change-Id: Icf642e7365535e4b2ca6fa4dee90a7033eb39af7
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
2016-01-28 12:41:37 +00:00
Nikolai Kosjar
bfa292cdc9 ClangStaticAnalyzer: Tests: Fix failing runner tests on Windows
Both runner tests fail on Windows at

	QVERIFY(st.expectStartedSignal());

because QProcess::started() is emitted before ClangStaticAnalyzerRunner::run()
returns and thus before QSignalSpy::wait() is reached.

Watch out for the signal manually before calling run().

Change-Id: Ia786bfc6c859a4a4b420aeccc7e7f7bb0b4c47c0
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-01-27 09:47:07 +00:00
hjk
50499079dc Valgrind: Fix test compilation
Change-Id: I1b64cab7326830cec86b9b5154e9efb6d0ea8569
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-26 15:20:41 +00:00
Eike Ziller
d18d7eaef6 Merge remote-tracking branch 'origin/3.6'
Change-Id: I4e1ec4054d7364057c63e63e293a246e64afdddb
2016-01-25 13:21:18 +01:00
Nikolai Kosjar
e79a7d47dc ClangStaticAnalyzer: Tests: Skip if there is no clang in PATH
Change-Id: Ibd082ac26ccd1476148131e2f3a9528f7b0048b9
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-01-22 09:56:50 +00:00
Nikolai Kosjar
c705cfca8c ClangStaticAnalyzer: Move non-plugin tests into tests/auto
Change-Id: I014ef6fd125393b69ec242219c0833efde0c216b
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-01-22 09:56:40 +00:00
Robert Loehning
76773763e6 Squish: Update tst_qml_editor to use Qt 5
Change-Id: I1f2c8b9212ab2b1eec07a4587495aaf02d201523
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-21 16:48:00 +00:00
Robert Loehning
62fae6b6c2 Squish: Test clicking on unknown git commit id
Task-number: QTCREATORBUG-15051
Change-Id: I9046fe8279a661a5ba28bd14747a9ee9915c3416
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-21 12:42:25 +00:00
Christian Kandeler
b37884a439 RunExtensions autotest: Fix qbs build.
Change-Id: If5f116261353d9625de26b3c927c6cc6e34e9c39
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-01-20 13:53:34 +00:00
Robert Loehning
03e5392ac9 Squish: Don't expect parsers to understand invalid C++
Change-Id: Icfe466540b7193c6f55014a68f1399debb0a17c3
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-20 10:19:06 +00:00
Tobias Hunger
954569387c Update License according to agreement with Free Qt Foundation
* Update license information in tests directory

Change-Id: I311441dd37d053ca3175e44b284258e232ee93e0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 16:01:06 +00:00
Eike Ziller
98257617e9 Merge remote-tracking branch 'origin/3.6'
Conflicts:
	src/plugins/clangcodemodel/clangassistproposalmodel.cpp
	src/plugins/clangcodemodel/clangassistproposalmodel.h

Change-Id: Iba30d2f4d95fa0f551afe58890d15f5835dfb715
2016-01-19 16:41:17 +01:00
Nikolai Kosjar
5691156b35 Clang: Fix inserting "::" after namespace
The extra "::" is showed in the tooltip right to the completion list
item, but it was not inserted.

Change-Id: I0ad2b816c56b8e3b5ccf0643f2c1a4f2a20b8818
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-19 13:37:10 +00:00
Nikolai Kosjar
2324db9d41 Clang: Fix html code in completion list item
E.g. "dynamic_cast&lt&gt;()" showed up as item.

Let CompletionChunksToTextConverter default to plain text format and
explicitly request HTML where needed.

Change-Id: Iebce85cb888a5bd697ffdce364118b6dc65a435d
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-19 13:37:06 +00:00
Nikolai Kosjar
a071e52b94 Clang: Extract duplicate code
Change-Id: I476916f825ab475f77f918127217dfc33eb4f388
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-19 13:27:55 +00:00
Nikolai Kosjar
8d6549fa74 Clang: Correct member access operator if possible
1 struct Foo { int member; };
 2 void f(Foo *foo)
 3 {
 4     foo.<REQUEST COMPLETION> // correct '.' to '->' and provide results
 5 }

The preferred approach would be to check if "foo" in line 4 is of
pointer type, but there is no suitable cursor (only CompoundStmt) at
that position since the code is usually not yet parsed and thus invalid.

Thus, just run the completion as is. If there are not any results for a
dot completion, re-run the completion with "." exchanged by "->". This
approach is inherently slower than the preferred approach implemented in
the built-in code model.

The following rare cases are not handled:

 1) Requesting completion after white space:
      Works: foo.<COMPLETE HERE>
      Fails: foo. <COMPLETE HERE>

 2) Opening a file and requesting completion (ctrl+space) without prior
    editing. No editing before triggering completion means that no
    unsaved file is generated on the backend side, which is a
    requirement for the correction.

Task-number: QTCREATORBUG-11581
Change-Id: I6bc8e8594778774ab342755fdb01a8a3e5c52ba0
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-01-19 13:20:35 +00:00
Eike Ziller
6513fc88b3 runAsync: Allow calling member functions
Change-Id: Ide09b5585730fb3dcb4a18718a02a4d8351ef91e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-01-19 06:07:43 +00:00
Eike Ziller
4b077921e2 runAsync: Allow function references, and non-const parameters.
Change-Id: I258259da7767087a8319d6a4489aa4d6c3b32c6f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-01-19 06:07:33 +00:00
Eike Ziller
e90ef40336 Add auto tests for Utils::runAsync
Change-Id: I59494d410ec529fd9689c64fea299ada6f6a472b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-01-19 06:07:23 +00:00
Orgad Shaneh
5be49c5187 C++: Match const/volatile/signed/unsigned for FullySpecifiedType
Changing a function signature from const to non-const is not recognized as a
changed, and doesn't trigger the "Apply Function Signature Changes" quickfix.

For example:
void func(Foo &var);
void func(Foo &var) {} // Add const before Foo, quickfix is not triggered

Change-Id: I71ae41765d66df69204abd085fdfcfcb2d605f4c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-15 14:05:22 +00:00