By the way, if you already have a CLion license (purchased before November 2 or after launching a new licensed model), you receive this update absolutely free. So what's inside? ')
Google test
One of the main innovations of this release is Google Test support and the ability to run tests directly from the IDE. To do this, CLion implements special configurations that are created automatically when you run a test, test file, test class, or manually in the settings. In the configuration settings, it is indicated which tests to run, which target to call and so on:
The test can be started directly via the context menu or by using the keyboard shortcut ( Ctrl+Shift+F10 on Windows / Linux, Ctrl-Shift-R on OS X). The result of the launch will be displayed in a special window:
The interface is probably familiar to those who have used / used other products based on our IntelliJ platform. From this window you can:
restart all tests or just dropped;
sort tests by name or by duration;
view / go to the specific test code;
view the output of each specific test and error messages;
transfer the results of the current test run to a file;
view previous runs of tests on the history, which is saved automatically.
To facilitate the writing of tests directly, we added code generation:
The menu appears by pressing Alt+Insert on Windows / Linux, Cmd-N on OS X, and offers to generate one test, a test class (fixture) and a standard pair of SetUp / TearDown methods. At the same time, the generation of the test method itself is tricky - first, the TEST () macro is always created, and then, depending on the context, it is automatically replaced with a more suitable one. For example, when specifying the name of an existing fixture, the macro is automatically replaced with TEST_F ():
This release includes more than 50 fixes related to the C ++ language. For example, support for the macro __LINE__ , required for development under the Unreal Engine 4 and not only. (By the way, about getting a CMake project for working with UE4 in CLion, read an article in English from our colleague).
Our IDEs are known for their ability to infer types, and with the advent of C ++ 11, this has also been true for C ++. The point is that it is not always easy to determine the type of a variable declared as auto ; you need to study carefully and for a long time what kind of call assigns a value to a variable. The IDE comes to the rescue here - the Quick Documentation popup window shows the type you want. The new version of CLion 1.2 fixes several problems with the output of these types:
Continuing to work on templates, we implemented a search for uses and renaming refactoring for template parameters. And in case the parameter is not used in any way, the IDE added the option of smart deletion (quick-fix) of a parameter from the definition and use of the template:
CMake
To make it easier to write CMake files, CLion 1.2 has two options:
ready-made templates (Live Templates) and
autocompletion of variables.
We added a few pre-made templates: foreach , function , if , macro , while , incboost (which helps connect the Boost libraries to the project). You can also create your own and use them in CMake files. As for other similar templates, for abbreviations of templates there is autocompletion, and the template is revealed by pressing the Tab key (or another one configured in the settings):
In previous versions, CMake commands autocompletion was already present, and now we have implemented autocomplete variables (so far only those with static names).
There is also an option in the formatting settings that allows you to always use only uppercase letters or always only lowercase letters for CMake commands (valid and a variant of the mixed style).
Debugger
The main changes in the built-in debugger are work on performance. We made a lot of changes that markedly improved the situation (but we still have where to go). Such, for example, as “lazy” creation of variables for GDB.
There have also been several changes to the rendering of references type variables and Unicode character arrays:
Platform Changes
Like other IDEs on the IntelliJ platform, CLion received a number of general improvements:
A quick-fix appeared, which allows you to change the formatting settings that are relevant only for the selected piece of code. It works in all languages ​​supported in CLion (C ++, C, CMake, languages ​​for WEB development).
When searching by path (Find in Path), a preview tab has been added to the corresponding dialog, which displays the first 100 search results and makes the task much easier.
When performing a search and replace, you can now use regular expressions.
Many improvements for different version control systems (added Perforce Shelve, work with patches Mercurial Queues, Git operations for brunch are now collected in one menu).
The appearance has also undergone changes, especially noticeable for HiDPI Linux / Windows users, and users of the default (“white”) scheme on OS X. And, by the way, the OS X version is now compiled by default with a customized JDK with fixes from JetBrains, but while in the IDE itself, you can select any JDK installed on the system.
At the end of a small demo (in English):
Follow the posts in our English-language blog and read more about the capabilities of the new version of CLion 1.2 on the site . As usual, there is a 30-day free trial, and in the price section you can find out about the cost of a new model and licensing options. We are happy to answer any of your questions in the comments.