Commit Graph

54 Commits

Author SHA1 Message Date
Christian Kandeler
f12e53e83c Make use of the "issues" pane when errors occur during analyzing.
They can otherwise easily get lost in the Application output pane.
Policy is as follows:
    - Failure to analyze a specific file is considered a warning.
    - If no file could be successfully analyzed, we add an
      error and pop up the issues pane.
This approach is neither too noisy nor too quiet.

Change-Id: Ifc577a215006a6a565eee7de5099bd690427f7de
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-27 16:16:36 +02:00
Christian Kandeler
6e796591f4 Allow users to suppress diagnostics.
This patch deals with what is likely the most common use case:
Filtering specific messages at a particular location. The current
granularity is essentially per-file (and per-function, where possible),
which seems more useful than taking line numbers into
account, as that would not be robust with regards to code changes elsewhere
in the file. We can fine-tune this if the need arises.

Change-Id: I4e9b2671fa199339cc3b995953d072b840cd3205
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-27 11:39:32 +02:00
Nikolai Kosjar
a13818f5cd Clear status message on start
Change-Id: I82e94f0426796473b35dd2a534a4fd7c5aab2667
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-02-27 11:29:46 +02:00
Christian Kandeler
bba6f927e9 Don't attempt to analyze using icecc masquerading as clang.
Also warn the user in the settings page against this.

Change-Id: I4dbae953aa85f8dbdc9baa8dd0fda8ff0da45b76
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-26 17:44:37 +02:00
Christian Kandeler
7c9c7b297a Don't fade out analyzer summary.
There is no reason why the status of the analyzer run should disappear
after a few seconds.

Change-Id: I16c21f05a03ac31f489312fbe56373a531ecc5d5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-26 16:16:06 +02:00
André Pönitz
6ac1dc95fd Adjust to Analyzer core changes
Change-Id: I2985b1be505f9aa43f2a8615a8dfcafaeb991e21
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-02-20 11:35:49 +02:00
Daniel Teske
4495ab283c Fix compile after Analyzer changes
Change-Id: I3870488ff2052465508c23d429dcb2d25a249857
Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
2015-02-19 15:53:25 +02:00
André Pönitz
93685b97ef Compile fix after recent Analyzer core changes
Change-Id: I100e75c526ff8609849526c3317a6d0a1658176b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-19 10:14:28 +02:00
Christian Kandeler
0ece47de90 Remove overide declarations.
Not ready yet.

Change-Id: I800e75c526ff8609849526c3317a6d0a1658176b
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-02-13 16:08:40 +02:00
Eike Ziller
a8dfba176b Merge remote-tracking branch 'origin/3.3'
Conflicts:
	plugins/clangstaticanalyzer/ClangStaticAnalyzer.json.in

Change-Id: Iffa578b015c51375cdb2d9930830cb2d76433bc7
2015-02-13 09:37:39 +01:00
Christian Kandeler
19476fb70e Adapt to API change in mainline Creator.
Change-Id: If1028fcf28373d99394d081c98e5cbc46aca81c5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-12 12:24:06 +02:00
Christian Kandeler
2946364ce6 Add unit tests.
These test the complete workflow as the user experiences it when
clicking "Start".
Intended usage:
    (1) Run sdktool to set up a kit with the toolchain you want
        to test against (using a temporary directory).
        The tests assume exactly one Kit to be present.
    (2) Start Creator with a matching settings path and
        "-load ClangStaticAnalyzer -test ClangStaticAnalyzer".
    (3) Repeat until all toolchains have been tested.
The initial implementation tests one trivial source file
with both qbs and qmake.

Change-Id: I810f23e2990a789a4dd9f1dd16335fbcf5c5f39f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-09 16:48:26 +02:00
Christian Kandeler
c632be5c92 Enable run control for mingw toolchains.
This is supported now.

Change-Id: If56be39138f8cb6c10e486e4a48e35964bdc0a94
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-02-03 17:25:45 +02:00
Christian Kandeler
0aa20dd26d Add support for MSVC.
Via clang-cl, which supports the --analyze option now.

Change-Id: Idbefe048eaa80e8c5bdb2244cb30c26ba7c71ef5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-30 15:38:40 +02:00
Christian Kandeler
6aad65375b Add qbs project files for autotests.
Change-Id: I7fefef8059e11fc7d08168c147e0dc8c6be7d466
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-30 11:34:48 +02:00
Nikolai Kosjar
570e62b168 RunControl: Reset future interface before in startEngine()
This fixes an infinite loop for the following use case:
  1. Menu: Analyze > Clang Static Analzyer
  2. When finished, click "Re-run this run-configuration" in the
     application output pane

m_progress was left in the isFinished() state and the next run to
startEngine() called analyzeNextFile() which returned immediately.

Change-Id: I8acf4f03dfc1d7f81034610828f6fb707655bd52
Sanity-Review: Sanity Bot <srv.sanitybot@digia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2015-01-29 12:37:04 +02:00
Christian Kandeler
0d60463c67 Turn QTC_ASSERT into normal check.
It is not an error if no toolchain is present in the kit. It just means
the same as the toolchain not being gcc or clang.

Change-Id: I193fd196ab830321dade1c3d32080b81a93cf645
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-20 12:55:39 +02:00
Eike Ziller
c98db856f9 Update License
Change-Id: I0a127e78046369f7b55b3ace7b08a13a3f5319e5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2015-01-15 18:46:29 +02:00
Nikolai Kosjar
4bdd4c263e DiagnosticDelegate: Fix leaking QVBoxLayout
Change-Id: I523c2c13b2b7f2b2eebc00781b6a2e18a74f8c17
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-25 13:15:27 +02:00
Nikolai Kosjar
25d5210039 Use QString::toHtmlEscaped() for GUI text
Otherwise diagnostics mentioning the '<<' operator might be interpreted
strangely.

Task-number: QCE-21
Change-Id: Ifc55335a6639020c143edd5f8b02158f8c8ab651
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-25 12:42:20 +02:00
Nikolai Kosjar
30b77eb032 DiagnosticView: Add copy action to context menu
Task-number: QCE-22
Change-Id: I22a71bd99689e4eaece3b2595b28e0d434a52453
Reviewed-by: Riitta-Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-25 12:41:45 +02:00
Nikolai Kosjar
802a7d653c Tool: Use "No" button in mode check dialog
...instead of "Cancel".

Task-number: QCE-20
Change-Id: Ibef52dc17cb3aee73e1f42eb1c64e4f9d5a9f990
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
2014-11-24 17:23:23 +02:00
Christian Kandeler
293dcae8c7 Add missing variable initializations.
Change-Id: Ib3573ee41915fe750c8615755ee1d4355cb0137d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-20 18:04:19 +02:00
Christian Kandeler
37b8e7252e Add qbs project file.
Change-Id: I675c1f95d7a22dca4a6cfdc8bec3f815d2576884
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-18 12:19:35 +02:00
Nikolai Kosjar
33fd656641 Check for valid Diagnostic
Change-Id: Icfce44a373d56f008027330f9b1a2d446f4d2adb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-14 16:05:47 +02:00
Nikolai Kosjar
e06c9ec09b RunControl: Skip sub projects not selected for building
Change-Id: I38e5a4f829484a7970fa4b6b06f00ec4cc92e8d0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 14:11:46 +02:00
Nikolai Kosjar
124311227d Sort files to process
Change-Id: Iac23e40c3154bf143b91d0262418f90907758276
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 13:21:37 +02:00
Nikolai Kosjar
b6a50a1a4c Use updated ProjectInfo
...that actually make us use the ProjectInfo with updated
CompilerCallData.

Change-Id: Ieee298b3db64159f3faa02231921275e4466bcb5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 12:40:56 +02:00
Nikolai Kosjar
2f3666a3f0 Ensure that project configuration did not change
Otherwise we might try to analyze invalid or vanished files.

Change-Id: I387dfb127618f2db21a538b07e1c152dbd026ca6
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 12:01:44 +02:00
Nikolai Kosjar
22003c8ea0 RunControl: Handle also ProjectInfo::CompilerCallData
...if it's available.

Change-Id: I41b8ab30e0c87ddd223f115e759bbd2a2c86cc68
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 12:00:43 +02:00
Nikolai Kosjar
36d306c5ba Adapt to qtcreator 3.3 changes / Compile fix
Change-Id: I6074f163184b5287b4ba6b791cadbeeb47ae1e4e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-11-07 11:20:08 +02:00
Nikolai Kosjar
273f2b8c5d Load the plugin only on Linux / OS X
On these platforms clang and/or gcc are available and the QMakeProject
and QbsProject can provide "enough" information.

Windows/MinGW:
Currently mingw 4.8.2 can't be used with clang 3.5. See
https://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg09490.html
Tests with mingw 4.9 are needed.

Windows/MSVC:
This needs more investigation. Observations so far:
* Does not work at the moment calling clang.exe.
* clang-cl.exe does not understand '--analyze'.
  Passing '-Xclang --analyze' in does not help either.

Change-Id: I83afe4a186cba67faf7bd0ad6c1de42790e281b2
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2014-11-03 17:54:35 +02:00
Nikolai Kosjar
aa98ee2755 Tool: Warn on run in Release mode
Change-Id: I3443ccc8daf37a1b10b43df3736fcf24c7ae2fea
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-31 16:58:42 +02:00
Nikolai Kosjar
1acf562612 Runner: Use Utils::SynchronousProcess::stopProcess
Change-Id: I77b0b039dae230c80a02f1692985c517bdd52023
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-31 14:59:10 +02:00
Nikolai Kosjar
d61117e814 Tool: Clear model already before building the project
Change-Id: I507056c9a5ee950bd95541a9e3042e9af23c0731
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-31 11:41:08 +02:00
Nikolai Kosjar
23136eb749 RunControl: Show more status in Application Output pane
Change-Id: I07e80e5a987612c19247a2d9a0628382b1136a06
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-31 11:41:00 +02:00
Nikolai Kosjar
f6eb83490a RunControl: Announce starting and finishing in Application output pane
Change-Id: I040f848dbdd6ef92ce03525e91c4b536390df9b4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-29 12:16:09 +02:00
Nikolai Kosjar
4acbedf841 RunControl: Fix 'Stop'
Terminate/kill current runners, so that the GUI will reflect that quite
soon and not if all runners finished.

Change-Id: I83eed6ecf1678444a8b38bab6cc05d8694a4eb49
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-28 11:13:05 +02:00
Nikolai Kosjar
cb49d04f46 Runner: Print command line with quoted arguments
...for easier debugging.

Change-Id: I53d4128defd9ac03350ce38d4d3f687191921a15
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-28 11:12:50 +02:00
Nikolai Kosjar
c9feffd2a0 RunControlFactory: Limit to Clang/GCC toolchain
Change-Id: Ib50572a062f0bbe9950fee108b53ba8e7370f459
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-27 16:22:14 +02:00
Nikolai Kosjar
c7c93810c4 RunControlFactory: Do not limit to LocalApplicationRunConfiguration
Change-Id: I088ef62b8baf98392cbda962f272ea4742bb8fc1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-27 16:22:04 +02:00
Nikolai Kosjar
8fc13e4afd Runner: Clarify requirements for run()
Change-Id: I51bfe1382e7692582dc361a65f104c17e578eb53
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-24 12:37:07 +03:00
Nikolai Kosjar
5634d16e4a Tests: Fix running tests
Change-Id: I5e32a900ce5a55ae4d49dd8fdae7e375e861a227
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-24 12:08:01 +03:00
Nikolai Kosjar
76e920f71b Tests: Fix reference to qtcreator directory
Change-Id: I1ba118394a3b97d9a2f6ddf94b1d12e0133c3d9d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-24 12:07:56 +03:00
Nikolai Kosjar
168682571f RunControl: qCDebug(LOG()) --> qCDebug(LOG)
Change-Id: I31ae029e2bd66badebfb40dc026d7de2158c4c13
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-24 11:28:08 +03:00
Nikolai Kosjar
3163b602e1 Remove some debug code
Change-Id: I0c23a5956ae921cdbe1e87cd12c3bc247fdedfbc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-24 11:28:02 +03:00
Nikolai Kosjar
a8f06e858f RunControl: Use the project from the RunConfiguration
Change-Id: I9f9214bc82e9d3ebecb3974ff5197f4af885fa07
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-24 11:27:56 +03:00
Nikolai Kosjar
3f8314024c RunControl: Pass on toolchain defines and language options
Change-Id: I3a44707f7f27e1b4bb781886b63b23a3c20e0414
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-23 18:25:22 +03:00
Nikolai Kosjar
8cca190dfc Set experimental attribute
Change-Id: I0eb38defb189c58b52de7cb424a7e2b72e0d205d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-23 18:25:01 +03:00
Nikolai Kosjar
1eaef8dbb0 Fix logging category names
Change-Id: Ie4568879656a9c6c7f1713b354c4a8cf59934dd7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
2014-10-22 12:01:08 +03:00