Skip to content

Commit 2e2bd4b

Browse files
authored
Chore/update readme (#90)
* Updated README for better readability * fixed kofi header * fixed kofi header * updated moch to run tests * updated moch to run tests
1 parent fc517de commit 2e2bd4b

3 files changed

Lines changed: 116 additions & 245 deletions

File tree

README.md

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,82 @@
11
# CppUTest Test Adapter for Visual Studio Code
22

33
[![Tests](https://github.com/bneumann/CppUTest-Test-Adapter/actions/workflows/unit_tests.yml/badge.svg?branch=master)](https://github.com/bneumann/CppUTest-Test-Adapter/actions/workflows/unit_tests.yml)
4+
<a href="https://ko-fi.com/B0B836FAL"><img src="img/kofi.png" width="104px"></a>
45

5-
This is the implementation for a [CppUTest](https://cpputest.github.io/) Test Adapter for VSCode. Check it out on the VSCode Market Place: [CppUTest Adapter](https://marketplace.visualstudio.com/items?itemName=bneumann.cpputest-test-adapter)
66

7-
<a href="https://ko-fi.com/B0B836FAL"><img src="img/kofi.png" height="40"></a>
7+
A Visual Studio Code extension that integrates the [CppUTest](https://cpputest.github.io/) C/C++ unit testing framework into VS Code's Test Explorer. Run, debug, and manage your CppUTest tests seamlessly within your development environment.
88

9-
![tests](img/tests.png)
9+
---
10+
11+
## Features
12+
- **Run and debug** CppUTest tests directly from VS Code.
13+
- **Supports multiple test executables** and wildcards for flexible test discovery.
14+
- **Pre-launch tasks** to build tests before execution.
15+
- **Logging support** for debugging and troubleshooting.
16+
17+
---
1018

1119
## Setup
1220

13-
To let this plugin know where your tests are set the ```cpputestTestAdapter.testExecutable``` to the executable of your tests. They are separated by semicolon and support wildcards, so you can add as many executables as you want:
14-
```
21+
### 1. Configure Test Executables
22+
Add the following to your VS Code `settings.json` to specify your test executables:
23+
24+
```json
1525
{
1626
"cpputestTestAdapter.testExecutable": "${workspaceFolder}/test/testrunner;${workspaceFolder}/test/subFolder/ut_*",
17-
"cpputestTestAdapter.testExecutablePath": "${workspaceFolder}/test"
27+
"cpputestTestAdapter.testExecutablePath": "\${workspaceFolder}/test"
1828
}
1929
```
2030

21-
Both settings support the ```${workspaceFolder}``` variable. The ```testExecutablePath``` determines the working directory:
22-
- If set to a valid directory path, all test executables will be run from this directory
23-
- If not set or set to an empty string, each test executable will be run from its own directory (the directory containing the executable)
31+
- ```testExecutable```: Path(s) to your test executables. Supports wildcards (*) and semicolon-separated lists.
32+
- ```testExecutablePath```: Working directory for running tests. If not set, each executable runs from its own directory.
2433

25-
To arrange for a task to be run prior to running tests or refreshing the test list, set ```cpputestTestAdapter.preLaunchTask``` to the name of a task from tasks.json. This can be used to rebuild the test executable, for example.
34+
Both settings support the ```${workspaceFolder}``` variable.
2635

27-
### Logging Configuration
36+
## Pre-Launch Task (Optional)
37+
38+
To rebuild your tests before running, define a task in tasks.json and reference it:
39+
```json
40+
{
41+
"cpputestTestAdapter.preLaunchTask": "build-tests"
42+
}
43+
```
44+
## Logging
45+
Enable logging for debugging:
2846

29-
To enable debugging and troubleshooting, configure the logging options:
3047
```json
3148
{
3249
"cpputestTestAdapter.logpanel": true,
3350
"cpputestTestAdapter.logfile": "C:/temp/cpputest-adapter.log"
3451
}
3552
```
53+
- logpanel: Shows logs in VS Code's Output panel ("CppUTest Test Adapter Log").
54+
- logfile: Saves logs to a file. Use absolute paths and ensure the directory exists.
3655

37-
- ```logpanel```: Shows logs in VSCode's Output panel ("CppUTest Test Adapter Log")
38-
- ```logfile```: Saves logs to a file. Use absolute paths (variables like ```${workspaceFolder}``` are not supported). Create the directory beforehand if it doesn't exist.
39-
40-
If you want to use the debugging functions you will also need to setup a launch.json file with your debugger path and arguments etc. The adapter will take care of the rest. Hopefully.
56+
## Debugging
57+
To debug your tests, configure your launch.json like you would with any debugger (in this case gdb):
4158

59+
```json
60+
{
61+
"version": "0.2.0",
62+
"configurations": [
63+
{
64+
"name": "Debug CppUTest",
65+
"type": "cppdbg",
66+
"request": "launch",
67+
"program": "${workspaceFolder}/test/testrunner",
68+
"args": [],
69+
"stopAtEntry": false,
70+
"cwd": "${workspaceFolder}",
71+
"environment": [],
72+
"externalConsole": false,
73+
"MIMode": "gdb",
74+
"miDebuggerPath": "/path/to/gdb"
75+
}
76+
]
77+
}
78+
```
79+
- The adapter automatically attaches to the test process.
4280

81+
## Contributing
82+
Contributions are welcome! Feel free to open an issue or submit a pull request.

0 commit comments

Comments
 (0)