Skip to content

Commit a10c7ec

Browse files
authored
Update md files and icons (#381)
1 parent b71421c commit a10c7ec

35 files changed

+133
-73
lines changed

clion-plugin/CONFIGURATION.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Configuration
2+
3+
## Remote Scenario
4+
5+
If you run UTBot and CLion on different hosts, synchronization of project files is required:
6+
7+
- If UTBot is run inside the Docker container, mount your project folder to Docker.
8+
- If UTBot is run under WSL, no additional configuration required, just
9+
specify remote path to your project in `Settings` or use `Quickstart Wizard` to
10+
fill it for you.
11+
- If server is not run locally, CLion deployment can be used for synchronization, although it won't be
12+
fully automated, look at information below:
13+
14+
### Configuring CLion SFTP deployment for remote scenario
15+
16+
To configure SFTP do the following:
17+
18+
- Open `Settings -> Build, Execution, Deployment -> Deployment`
19+
- Create SFTP configuration: click `+` and choose or create SSH config with server host and port, than
20+
specify the path to your project on the remote machine in mappings, it is the same path you have specified
21+
in `Settings` for remote path
22+
- Go to `Options` and turn on upload on change:
23+
24+
![](images/plugin_usage/sftp/sftp-config.gif)
25+
26+
- Go to `Project view` and right-click on your project root, then
27+
choose `Deployment`, click `Upload to ...` and choose the name of your
28+
SFTP configuration:
29+
30+
![](images/plugin_usage/sftp/upload.gif)
31+
32+
Now server can access your project files.
33+
34+
When you change your files, CLion should upload changes to server.
35+
36+
## Local scenario
37+
38+
Wizard allows you to configure your project quickly without specifying different options manually in
39+
`Settings`. When you open your project for the first time, UTBot Wizard will be shown.
40+
41+
![](images/plugin_usage/wizard/wizard-welcome.png)
42+
43+
### Connection
44+
45+
After the first introductory step, you will be asked to
46+
fill several settings: server port, server host and remote path.
47+
Remote path specifies path to project on remote machine.
48+
49+
If UTBot is run on WSL or Linux (on the local machine), be sure
50+
to check the checkbox that fills in default values for the path and the port.
51+
52+
![](images/plugin_usage/wizard/wizard-connection.png)
53+
54+
### Build Directory and CMake Options
55+
56+
On the final Wizard step, UTBot will ask you to:
57+
- specify relative path to the build directory
58+
- set custom CMake options
59+
60+
![](images/plugin_usage/wizard/wizard-build-options.png)
61+
62+
### Demo
63+
64+
A demo how to go through the wizard:
65+
66+
![](images/plugin_usage/wizard/wizard-demo.gif)
67+
68+
## Plugin settings
69+
70+
The recommended way to configure plugin is to use UTBot Wizard.
71+
72+
If some advanced settings are required, specify them in `Settings -> Tools -> UTBot Settings`
73+
74+
![](images/plugin_usage/settings-demo.gif)
75+
76+
### Remote path
77+
78+
Remote path is a path to your project on the remote host. If UTBot is run locally, leave it empty.
79+
80+
81+
## Check configuration
82+
83+
When the connection to server is established, you can check project configuration
84+
to make sure that all path are specified correctly: just invoke `Configure project` action:
85+
86+
![](images/check-config/check-not.gif)
87+
88+
When project is configured, `Project is configured` notification appears:
89+
90+
![](images/check-config/check-ok.gif)
91+
92+
When plugin is configured and configuration is checked, you can start using plugin to generate tests.
93+
For further details how to use plugin see `USAGE.md`.

clion-plugin/README.md

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,13 @@ Plugin to communicate with [UTBotCpp](https://github.com/UnitTestBot/UTBotCpp) s
44

55
### Installation
66

7-
1. Clone UTBotCpp into selected folder, select it in the command line and run:
8-
```
9-
cd clion-plugin
10-
./gradlew assembleDist
11-
```
12-
2. Open CLion and go to `settings -> plugins`
13-
3. Click `Install Plugin from Disk...`:
7+
1. Open CLion. Go to `Settings -> plugins`
8+
2. Uninstall the previous version of plugin. Skip this step if you install it for the first time
9+
3. Click on `Settings` icon and then choose `Install from disk`
1410
![](images/install/install-from-disk.png)
15-
4. Navigate to plugin folder `clion-plugin`, go to `build/distributions`
16-
and choose `zip` file:
17-
![](images/install/choose-zip.png)
11+
4. Choose plugin's zip file: `clion_plugin.zip`
1812
5. Restart CLion
1913

20-
### Configuration
21-
22-
#### Using quickstart wizard
23-
When the plugin is opened for the first time, a quickstart wizard appears.
24-
25-
![](images/plugin_usage/wizard.png)
26-
27-
You can open it manually any time: click on `connection status` and choose
28-
`Show Quickstart Wizard` action.
29-
30-
![](images/plugin_usage/show_wizard.png)
31-
32-
or press `shift` twice and find this action:
33-
34-
35-
![](images/plugin_usage/find-wizard-action.png)
36-
37-
#### Using settings
38-
39-
You can also configure plugin using settings. All options can be set manually.
40-
41-
1. Open plugin settings in `settings` - `Tools` - `UTBot Settings`
42-
2. Click `detect paths`. It tries to get source paths and build directories paths from CLion
43-
cmake model.
44-
3. Specify an absolute path to the build directory, it should be different from the build directory that CLion uses,
45-
because conflicts between UTBotCpp and CLion may occur. For example, if CLion uses `project_path/cmake-build-debug`,
46-
you can specify `project_path/utbot_build`.
47-
4. For target path specify `/utbot/auto/target/path`
48-
5. Specify a path to test folder.
49-
6. Specify a name of the server and port.
50-
7. If you use docker to run UTBotCpp and your project is mounted to docker,
51-
you can specify path to project inside docker.
52-
14+
See `CONFIGURATION.md` to configure the plugin before use.
5315

5416
<!-- Plugin description end -->

clion-plugin/USAGE.md

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,59 @@
11

22
# How to use plugin
33

4-
### Check connection status
5-
You must be connected to server to use plugin. \
6-
Connection status can be checked in the status bar.
4+
### Status bar icons
75

8-
![](images/plugin_usage/connectionStatus.png)
6+
Before you start working with UTBot, it is worth to pay attention to the status bar in IDE
7+
and UTBot-specific controls there:
98

10-
### Configure project and generate json files
9+
<img src="images/plugin_usage/statusbar/status-bar-icons.png" alt="drawing" height="25"/>
1110

12-
Your project must be configured by server to generate tests.
11+
#### Connection status
1312

14-
To send request for project configuration or json files generation,
15-
click on `connection status` in the status bar and choose a suitable option:
13+
Connection status indicates whether the client and the server have established a connection.
14+
If the connection is lost, you'll see
1615

17-
![](images/plugin_usage/generateJson.png)
16+
<img src="images/plugin_usage/statusbar/not-connected.png" alt="drawing" height="25"/>
1817

19-
Plugin sends request for project configuration when you open
20-
the project. Sometimes configuration fails, then after changing
21-
your project you need to send the request for project configuration.
18+
In such case you need to check if UTBot Docker container is still running.
2219

23-
### Choose source folders
20+
Clicking on the connection status icon, you see the list of actions can be invoked:
2421

25-
To generate tests for project, server needs to know the folders source files are located in.
26-
The source folders are marked with green icons in the project view:
22+
<img src="images/plugin_usage/statusbar/status-bar-actions.png" alt="drawing" height="100"/>
2723

28-
![](images/plugin_usage/source-folders.png)
24+
#### Verbose mode
2925

30-
You can mark/unmark selected folders from context menu.
26+
You can change the verbose option from status bar.
3127

32-
![](images/plugin_usage/mark-unmark-folders.gif)
28+
If verbose mode is enabled or disabled, it is represented as follows:
3329

34-
### How to request tests generation
30+
<img src="images/plugin_usage/statusbar/verbose-on.png" alt="drawing" height="23"/>
3531

36-
Open a c/cpp file, right click in the text editor and
37-
choose suitable option in the context menu:
32+
<img src="images/plugin_usage/statusbar/verbose-off.png" alt="drawing" height="23"/>
3833

39-
![editor actions](images/plugin_usage/editorActions.png)
34+
### Plugin description
4035

41-
For example, to generate tests for the folder, right click on it in the project view
42-
and choose `Generate for folder`:
36+
Main UI elements of the plugin are:
37+
- Status bar icons, they show connection status and verbose mode option
38+
- `UTBot consoles`, a window to show logs from server (GTest log, Server log) and plugin (Client log)
39+
- `UTBot targets`, a window to show targets found by server in current project
40+
- `UTBot Source Directories`, a view to show source directories marked green
4341

44-
![project view actions](images/plugin_usage/projectViewActions.png)
42+
![](images/plugin_usage/overview.png)
4543

46-
### See logs from server and client
44+
#### Generate tests
4745

48-
You can see messages that are sent to the server and server own logging messages. Just click on the `UTBot consoles` tab in the bottom right corner:
46+
You can trigger tests generation from:
4947

50-
![UTBot consoles tab](images/plugin_usage/consolesTab.png)
48+
- Context menu in editor:
5149

52-
add choose the required tab:
50+
<img src="images/plugin_usage/generate/editor-gen.png" alt="drawing"/>
51+
52+
- Context menu in project view:
53+
54+
<img src="images/plugin_usage/generate/project-view-gen.png" alt="drawing" height="300"/>
55+
56+
- Search window: pressing `Shift` two times and searching for action
57+
58+
<img src="images/plugin_usage/generate/gen-search.png" alt="drawing" height="300"/>
5359

54-
![UTBot consoles view](images/plugin_usage/consolesToolWindow.png)
811 KB
Loading
299 KB
Loading
Binary file not shown.
-23.7 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
-62.4 KB
Binary file not shown.
Binary file not shown.
905 KB
Loading
Binary file not shown.
Loading
-409 KB
Binary file not shown.
Loading
Loading
-81.2 KB
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
-129 KB
Binary file not shown.
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)