|
| 1 | +#How to check UTBot manually |
| 2 | + |
| 3 | +It's recommended to perform some smoke checks on UTBot before raising a pull request |
| 4 | + |
| 5 | +##Check installation in your own local environment |
| 6 | + |
| 7 | +Download an archive with build artifacts on a local machine and unpack it into separate folder locally |
| 8 | + |
| 9 | + |
| 10 | +-[ ] Check folder contains: |
| 11 | + |
| 12 | + - ```utbot_distr.tar.gz``` - UTbot binary/dependencies |
| 13 | + - ```utbot_plugin.vsix``` - UTBot plugin for VSCode |
| 14 | + - ```unpack_and_run_utbot.sh``` - setup script |
| 15 | + - ```version.txt``` - version file |
| 16 | + |
| 17 | + |
| 18 | +-[ ] Perform setup on server side: |
| 19 | + |
| 20 | +Move binary and script into a new separate directory |
| 21 | + |
| 22 | +``` |
| 23 | + mkdir utbot-release-version |
| 24 | + mv utbot_distr.tar.gz utbot-release-version |
| 25 | + mv unpack_and_run_utbot.sh utbot-release-version |
| 26 | +``` |
| 27 | +and run installation script in it |
| 28 | +``` |
| 29 | + cd utbot-release-version |
| 30 | + chmod +x unpack_and_run_utbot.sh && ./unpack_and_run_utbot.sh |
| 31 | +``` |
| 32 | +Check process is up and running |
| 33 | + |
| 34 | +``` |
| 35 | + ps aux | grep utbot | grep port |
| 36 | +``` |
| 37 | + |
| 38 | +PID/port 2121 should be found |
| 39 | + |
| 40 | + If no errors and process is up then |
| 41 | + |
| 42 | +-[ ] Perform client setup: |
| 43 | + |
| 44 | + - In local VSCode look for *Install from VSIX* command, select early downloaded ```utbot_plugin.vsix``` and install it - "UnitTestBot for C/C++" plugin should be visible in Extensions |
| 45 | + - For Win: setup SSH remote connection with server - locally installed UTBot plugin should be available in remote mode (no new installation required) |
| 46 | + - Open folder with source code, test connection as proposed, click Next and finish setup configuring project |
| 47 | + |
| 48 | +##Check UTBot: Generate Tests |
| 49 | +On a source code project |
| 50 | +- [ ] For Current Function: |
| 51 | +1. Move to any function in the (as example) ```file.c``` |
| 52 | +2. Right mouse click → UTBot: Generate Tests... → for Current Function |
| 53 | + |
| 54 | +  |
| 55 | + |
| 56 | +- ```file_test.cpp``` is generated |
| 57 | + |
| 58 | +  |
| 59 | + |
| 60 | +- "Run Tests with Coverage" generates coverage report shown in a source ```file.c``` |
| 61 | + |
| 62 | +  |
| 63 | + |
| 64 | + |
| 65 | +- [ ] For Current File: |
| 66 | +1. Move to any `file2.c` in the project |
| 67 | +2. Right click → UTBot: Generate Tests... → for Current File |
| 68 | +- `file2_test.cpp` is generated |
| 69 | +- "Run Tests with Coverage" generates coverage report shown in a source file |
| 70 | + |
| 71 | + |
| 72 | +- [ ] For Current Line: |
| 73 | +1. Move to any statement line in the `file3.c` |
| 74 | +2. Right click → UTBot: Generate Tests... → for Current Line |
| 75 | +- `file3_test.cpp` is generated |
| 76 | +- "Run Tests with Coverage" generates coverage report shown in a source file |
| 77 | + |
| 78 | + |
| 79 | +- [ ] With Prompted Result: |
| 80 | +1. Move to any function in the `file4.c` code |
| 81 | +2. On statement/assert Right click → UTBot: Generate Tests... → with Prompted Result |
| 82 | +3. In appeared dialog select condition and enter some number → Press Enter |
| 83 | + |
| 84 | +  |
| 85 | + |
| 86 | +- `file4_test.cpp` is generated with selected condition on prompted result |
| 87 | +- "Run Tests with Coverage" generates coverage report shown in a source file |
| 88 | + |
| 89 | + |
| 90 | +- [ ] For Folder: |
| 91 | +1. In project navigate to folder with several files |
| 92 | +2. Right click → UTBot: Generate Tests for Folder |
| 93 | + |
| 94 | +  |
| 95 | + |
| 96 | +3. Select needed folder → OK |
| 97 | +- directory with test files created: |
| 98 | + |
| 99 | +  |
| 100 | + |
| 101 | +- "Run Tests with Coverage" generates coverage report shown in a source file |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
0 commit comments