![]() ![]() When the tests finish running, open the Test->VisualGDB Code Coverage Reports window to display the code coverage from the latest run: The Code Coverage window will show statistics on the coverage of various functions in the project.Open the Test Explorer window, right-click on the test project and select “Run Selected Tests”:.We will show the exact setting responsible for this later in the tutorial. make sure you have enabled code coverage on the project level, not just in the C/C++->Instrumentation. Double-check that the build output contains the following line:ĭetached X coverage information blocks from Y object files ![]() Note that if instrumenting all code results in more than 100% overhead, the VisualGDB’s logic for trimming unnecessary coverage-related structures from the object files is likely not running. Note that the instrumented code will use more FLASH (due to extra instructions needed to track the executed functions and branches) and more RAM (due to the variables storing the function/branch counts): We will show how to reduce the overhead caused by the code coverage instrumentation later in this tutorial. Click “Yes” when VisualGDB asks whether you want to enable code instrumentation in the build settings: Enable the “build code coverage reports” checkbox and click “OK”. Open VisualGDB Project Properties and go to the Code Coverage page.Build it by pressing Ctrl-Shift-B and take a note of the FLASH/RAM use via the Embedded Memory Explorer window: Press “OK” to generate a basic project.If not, you can pick a debug method manually on the Debug Method page of the wizard: Connect your JTAG debugger to the USB and make sure VisualGDB detects it.Proceed with the default test project sample and click “Next” to continue to the next page:.For most accurate code coverage results we advise using GCC 9.x or later: On the next page select the toolchain and your device.On the first page of the VisualGDB’s part of the wizard, select “Create a new project -> Unit test -> MSBuild -> TinyEmbeddedTest”:.Specify the name and location for the project you are creating:.Start Visual Studio and open the VisualGDB Embedded Project Wizard:. ![]() We will create a basic test project based on the TinyEmbeddedTest framework, will instrument it to produce code coverage reports at the end of the debug sessions and will show how to view the reports and reduce the memory overhead by controlling which files get instrumented.īefore you begin, install VisualGDB 5.5 or later. This tutorial shows how to use VisualGDB to analyze the code coverage of embedded projects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |