-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add step by step setup * add setup basic use tutorial * add additional frameworks tutorial * add debug tutorial * add core dump gdb in debug tutorial * add partition table editor tutorial * code coverage * update code coverage tutorial * add nvs partition editor tutorial * add heap tracing system view tutorial * mv images out of vsix * add cmakelists editor * add efuse rainmaker tutorial * add doc fixes * add tutorials links in readme * smaller debug screenshots * smaller app tracing screenshots * basic use small blink example * update width height tutorial * add conditional breakpoint
- Loading branch information
1 parent
ed0ceff
commit 7b4110e
Showing
67 changed files
with
779 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,5 @@ gulpfile.js | |
.yarnrc | ||
report.txt | ||
report.json | ||
media/screenshots | ||
media/tutorials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
# Using **gcov** and **gcovr** to provide code coverage | ||
|
||
Source code coverage is data indicating the count and frequency of every program execution path that has been taken within a program’s runtime. [Gcov](https://en.wikipedia.org/wiki/Gcov) is a GCC tool that, when used in concert with the compiler, can generate log files indicating the execution count of each line of a source code. The [Gcovr](https://gcovr.com/) tool is utility for managing Gcov and generating summarized code coverage results. | ||
|
||
Please read [GCOV Code coverage](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#gcov-source-code-coverage) to learn more about code coverage with gcov in ESP-IDf projects. | ||
|
||
## Requirements | ||
|
||
Your ESP-IDF project should be configured to generate gcda/gcno coverage files using gcov. Please take a look at the [ESP-IDF gcov example](https://github.com/espressif/esp-idf/tree/master/examples/system/gcov) to see how to set up your project. | ||
Your ESP-IDF project should be configured to generate gcda/gcno coverage files using gcov as shown in [GCOV Code coverage](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#gcov-source-code-coverage). Please take a look at the [ESP-IDF gcov example](https://github.com/espressif/esp-idf/tree/master/examples/system/gcov) as example project. | ||
|
||
This extension also requires `gcovr` to generate JSON and HTML reports from generated files. This is installed as part of this extension ESP-IDF Debug Adapter Python requirements when following the **ESP-IDF: Configure ESP-IDF extension** command. | ||
Please take a look at [SETUP](./SETUP.md) for more information. | ||
This extension requires `gcovr` to generate JSON and HTML reports from generated files. This is installed as part of this extension [SETUP](./SETUP.md). | ||
|
||
Make sure you had properly configure xtensa toolchain in `idf.customExtraPaths` or in your environment variable PATH since the gcov executable used is `xtensa-esp32-elf-gcov` and `gcovr` exists in the same directory as your `${idf.pythonBinPath}` path. | ||
Make sure you had properly configure the toolchain in `idf.customExtraPaths` or in your environment variable PATH since the gcov executable used is `{TOOLCHAIN_PREFIX}-gcov` (replacing TOOLCHAIN_PREFIX for your IDF_TARGET toolchain prefix) and `gcovr` exists in the same directory as your `${idf.pythonBinPath}` path. | ||
|
||
## Editor Coverage | ||
|
||
For the text editor highlighting, we use execute a child process with `gcovr -r . --gcov-executable {TOOLCHAIN_PREFIX}-gcov --json`. | ||
For the text editor highlighting, the **ESP-IDF: Add Editor coverage** command execute a child process with `gcovr -r . --gcov-executable {TOOLCHAIN_PREFIX}-gcov --json`. You can remove the coverage highlight with **ESP-IDF; Remove Editor coverage**. | ||
|
||
> **NOTE:** This assumes you had configure your extension with Xtensa toolchain in `idf.customExtraPaths` and installed the `gcovr` from Debug adapter's python requirements. | ||
For the text editor, we use the json object generated by the previous command to highlight each line if it is covered or if it is not. We don't highlight noncode lines. | ||
|
||
You can customize highlight color using the extension settings. Visual Studio code support `"red"`, `rgb(255,0,120)` or `rgba(120,0,0,0.1)`. | ||
You can customize highlight color using the extension settings. Visual Studio code support `"red"`, `rgb(255,0,120)` or `rgba(120,0,0,0.1)` values. | ||
|
||
- Covered lines use `idf.coveredLightTheme` for light themes and `idf.coveredDarkTheme` for dark themes. | ||
- Partially covered lines use `idf.partialLightTheme` for light themes and `idf.partialDarkTheme` for dark themes. | ||
- Non-covered lines use `idf.uncoveredLightTheme` for light themes and `idf.uncoveredDarkTheme` for dark themes. | ||
|
||
## HTML report | ||
|
||
We execute a child process with command `gcovr -r . --gcov-executable {TOOLCHAIN_PREFIX}-gcov --html` for the HTML report. | ||
The **ESP-IDF: Get HTML Coverage Report for project** execute a child process with command `gcovr -r . --gcov-executable {TOOLCHAIN_PREFIX}-gcov --html` for the HTML report. | ||
|
||
> **NOTE:** This assumes you had configure your extension with Xtensa toolchain in `idf.customExtraPaths` and installed the `gcovr` from Debug adapter's python requirements. | ||
With the generated HTML, we generate a Webview Panel with report from `gcovr`. | ||
With the generated HTML from `gcovr`, a Webview Panel is launched to show the gcov html report. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.