Commit Graph

1682 Commits

Author SHA1 Message Date
Christian Kandeler
f900b4e1ba Selection changer autotest: Fix build with namespaced Qt.
Change-Id: Ic9709ac4e76a199bb9fdd7ed231d48d498201de6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-29 15:14:37 +00:00
Eike Ziller
4b30b30d6d Merge remote-tracking branch 'origin/master' into 4.0
Change-Id: Iad8f5ab4bc44e890cd0c72d5bcbceb6f18f6e995
2016-02-29 10:38:16 +01:00
Alexandru Croitor
bed88818ce C++: Implement context-aware expand / shrink selection actions.
Implement selection expanding / shrinking, that is aware of C++
semantics, thus giving smart selection changing.

Change-Id: I1386a20597fa6bb85c3aa0d8ddfb87cdb3fd7c38
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-02-29 08:15:03 +00:00
Eike Ziller
6d4abdc801 runAsync/mapReduce tests: Do not run moc on files from utils lib
Change-Id: I96cccbe9a2f617e0255bbedfae021d08c546fc8c
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-26 13:43:32 +00:00
Eike Ziller
34fd32565a Merge remote-tracking branch 'origin/master' into 4.0
Change-Id: I07981129945f5a78f3ec4a4740a983c613b41e48
2016-02-26 10:58:01 +01:00
Eike Ziller
47c3755600 mapReduce: Support progress information and add (unordered) map
If a container is given to mapReduce, it takes the responsibility to
report progress information for the whole operation. If the map function
reports its own progress, that is taken into account for the overall
progress.

The (so far only unordered) Utils::map operation can be used to replace
MultiTask, by passing a member function of the items in the container as
a map function.

Change-Id: I18ca38a6ad2899d73f590bfe59bf2e6eb2f1a57a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 08:36:08 +00:00
Eike Ziller
dcf09b0008 runAsync: Support functions wrapped in reference_wrapper
Change-Id: I2dbb793239d432a1316dadb81beee564cc858eaa
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-26 08:35:40 +00:00
Christian Stenger
ed7fee4ccb Tests: Fix compile
Introduced with aaf05f5acd.

Change-Id: I74707cf0af0dd8058536acdee19750583193ed8b
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-02-25 12:42:23 +00:00
hjk
aaf05f5acd Move analyzerbase to debugger
This is the first mechanical step to execute on the 'shared pool of
debugger/analyzer views' idea.

Future steps would be providing infrastructure for the view pool,
making all analyzer/debugger views use the pool and then re-extract
a sensible base for a 'analyzer-and/or-debugger' tool plugin interface.

Change-Id: I1bb392e6dd3084fc56937956bee1d6fd9530335d
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2016-02-25 12:31:06 +00:00
hjk
d9660c8479 Use C++11 unconditionally for qbs build of auto tests
... and valgrind fake tool.

Change-Id: I36d4e696ab0f37067eca639cb79613879d0fc990
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-02-24 16:17:49 +00:00
Eike Ziller
a3c0f0f66a MapReduce refactoring and improvements
- QThread instead of std::thread for better integration with Qt
- Use thread pool for recycling threads
- Map and reduce functions are handled like any function passed
  to runAsync, so they either report results through the
  QFutureInterface, or through the return value.
- Automatically deduce the reduce result type

Change-Id: I7a31370c21f8c27b378cd87c3d5974b162449ce1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-02-24 10:17:57 +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
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
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
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
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
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
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
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
Andre Hartmann
369b1f7f38 Lexer: Support Microsoft suffix (u)i64
MSVC2010 supports all combinations of upper- and lowercase U/I.

Task-number: QTCREATORBUG-15554
Change-Id: I0106e6b5038a62aebe5a6c1eb0467d693befb4b0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-12 05:56:50 +00:00
Orgad Shaneh
9e0631ea79 C++: Add a missing newline in CheckSymbols test
Change-Id: I4c6843b5bae06f09e4b3e41eabb1b3e0e9a8b6a2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2016-01-11 09:45:08 +00:00
hjk
7de7eb6bca Debugger: Work on WatchModel performance
Don't instantiate repeating boilerplate item data in some
cases (such as large arrays).

This makes it necessary to access parent WatchItems in
a lot more cases than before and needs another separation of
WatchItem/WatchModel code to keep the dumper autotests
in a functional state.

For a plain std::vector<int> with 1 mio items this reduces
 extraction time from more than 2 minutes to about 3 seconds.

Change-Id: I175c5f6ee90434a6e85342d8bb71bd10a04dd271
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-06 09:59:11 +00:00
hjk
31eb7c203d Debugger: Add dumpers for some of libc++'s std::{set,map,multimap}
At least for simple key/values (int etc)

Change-Id: Ib60017347a9f28f1994f7db78c0607f3fdbfac2e
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-05 15:20:51 +00:00
hjk
6a71c63186 Debugger: Make display of QObject names optional
... and switch it off by default. The feature has indeterministic
performance impact and lost quite a bit of its utility since GDB
learned to extract dynamic object types most of the times.

Change-Id: I22cccb03ba67f9ff6ad757bbc06eb372d84bbffe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-17 14:58:23 +00:00
Orgad Shaneh
ebf26ca125 C++: Support negative enum values
Change-Id: I93dac08a62be467918dbc9f72239d34191a81fd6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-12-15 09:45:26 +00:00
hjk
7c08f5a9b0 Debugger: Further improve base class dumping with LLDB
... in the presence of empty base classes. This now actually makes
the Inheritance dumper test pass.

Change-Id: I92ada5da46accb6e7eaff58ce5dc329484ef0909
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-12-07 12:38:50 +00:00
Christian Stenger
e2097fe8ec Tests: Fix compile for OSX...
...as the define points to a path containing a whitespace which confuses
moc this must be escaped.

Change-Id: If5fe0e7b3eeb0f4a46df4df3eb8236c94587ea88
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-30 07:18:31 +00:00
Christian Stenger
ce2a891c48 Tests: Fix sdktool test
Change-Id: Idc21354d3f546c1aaff7d1481c80190c6c1c366c
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-11-27 10:16:28 +00:00
Nikolai Kosjar
0498fb68ff C++: Revert lookup to 3.4.2
...which was least buggy.

The bugs fixed by the changes we revert here (highlighting/completion
for code involving templates) were minor compared to ones we currently
have. Those bugs will be addressed by the clang code model anyway.

Relevant commits were collected via:

  $ cd ${QTC}/src/libs/cplusplus
  $ git log \
   --no-merges \
   --format=oneline \
   v3.4.2..HEAD \
   -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \
      ../../plugins/cpptools/cppcompletion_test.cpp

From this list the following were skipped due to irrelevance:

  88c5b47e53 # CppTools: Minor cleanup in completion tests
  e5255a1f5c # CppTools: Add a test for ObjC not replacing dot with arrow
  5b12c8d63a # CppTools: Support ObjC in member access operator tests
  9fef4fb9ca # CPlusPlus: Fix warnings about overriding visit(...) methods

There were only minor conflicts while reverting those.

This changes touches so many files because there were quite some
cleanups and renames after the 3.4.2 release.

Task-number: QTCREATORBUG-14889
Task-number: QTCREATORBUG-15211
Task-number: QTCREATORBUG-15213
Task-number: QTCREATORBUG-15257
Task-number: QTCREATORBUG-15264
Task-number: QTCREATORBUG-15291
Task-number: QTCREATORBUG-15329
Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-19 14:48:38 +00:00
Lassi Hämäläinen
10e947f65f C++: Fix crashes with the pattern "enum class operator A"
Parser parsed the pattern as an enum declaration the name of
which is a conversion operator. Add check to disallow keywords
after enum-key (enum, enum class, enum struct).
Add tests tst_AST::enumDeclaration and
invalidEnumClassDeclaration.

Task-number: QTCREATORBUG-15341
Change-Id: Ia037f00184c1d7e5b0374f39331bb6748f8d90b1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-18 15:09:40 +00:00
Adam Strzelecki
9b3723d6f4 CppTools: Do not highlight instantiation as call
Underlying C++ model sometimes marks C++ object instantiation using initializer
as a (forward) function declaration. This leads to incorrect highlighting of
object variables as if they were function calls.

C++ model however marks in this case (and not any other case) such symbols as
ambiguous function types, see CPlusPlus::Bind::visit. This change skips such
ambiguous functions for highlighting as function call.

Also add test case for related bug report.

Task-number: QTCREATORBUG-15212
Change-Id: Ifde8db407f2fa8275a3f991bfa3d3b73eca8c14e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-16 10:18:05 +00:00
Orgad Shaneh
0bcddcd014 C++: Limit template instantiation depth
A recursive template generates infinite expansions.

Consider the following example:

template <class R1>
struct Base
{
};

template<typename R>
struct Derived :
  Base<
    typename Derived<typename Base<R>::type>::type,
    typename Derived<typename Base<R>::type>::type
  >::type
{};

R is instantiated as Base<R>::type, which causes another
instantiation of R into Base<Base<R>> etc...

This is not a solution, but a workaround.

Task-number: QTCREATORBUG-15141
Change-Id: Ib04f70275e07919e2cb6c7fb61a2045bd52f4a7d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-12 09:40:20 +00:00
Orgad Shaneh
3ab5527a83 C++: Produce copyable debug output in CheckSymbols test
Change-Id: I338352eaf6372316d2dc8f0f3ad961b7e8d8cbdc
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-12 09:15:49 +00:00
hjk
0f9e2baa1b Debugger: Adjust QFileInfo dumper for Qt 5.7 on Linux 32 bit
Change-Id: Idb14d81aa3546af0e7a21922fbb6d551ecbc1b06
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:57:37 +00:00
hjk
aa221121b6 Debugger: Pass down expanded inames in LLDB tests
... as well as the 'autoderef' flag. A lot of dumper tests were
failing even though the dumpers themselves were ok.

Change-Id: I198784d95eb0004e81bfab995121e048b1722c66
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-11 13:16:17 +00:00
Niels Weber
58804ad823 Fix two typos in comments
Change-Id: Iacb728715b11ca3a9f82d82cca49889eea9dd59b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-11-11 06:56:08 +00:00
hjk
d6bb579a41 Debugger: Fix QAtomic* and QShared* dumpers with Qt 5.6/C++11
With C++11 we use std::atomic in the ref counter, giving yet
another possibility of structure member names. Instead of
trying to keep up with that, access the binary data directly.

Change-Id: I572f727eb9dab37ac1ca07594d55bea723050817
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-09 13:49:25 +00:00
Christian Stenger
9ce0c9cd1e Tests: Provide basic boost version check
Change-Id: I38e38fdb129c172cb0056b6f96146a7e29d7288a
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 12:50:52 +00:00
Christian Stenger
e7df1233f0 Tests: Provide way to specify boost library include path
Change-Id: I162343f188c5f9c8849d93faf120a424ec41e6f8
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 12:50:45 +00:00
Christian Stenger
8cdc648139 Tests: Fix compilation
Change-Id: Ia63f3afd7ae3e76f78ffea31702ba5968b74b418
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-11-09 10:11:49 +00:00