Product
Solutions
Resources
Company
Download Trial Book a Demo

Code Coverage for the Tizen Studio IDE

Generate code coverage for an embedded application built in the Tizen Studio IDE with RKTracer. Integrate the tool with the IDE, enable RKTracer ON, rebuild and run your tests, save the coverage data, and generate the HTML reports.

Use this guide to generate code coverage for an embedded application built in the Tizen Studio IDE. RKTracer integrates directly with the IDE, so once it is set up you turn coverage on, rebuild your application, run your tests on the target, save the coverage data, and generate the HTML reports, all from the Run menu.

In short

Integrate RKTracer with rktracer -tizen -integrate, turn on RKTracer ON from RunExternal Tools, rebuild and run your tests, save the data with sdb dlog, then run RKTracer Reports to generate the HTML reports.

Step 1: Enable the RKTracer code coverage tool

Integrate the RKTracer code coverage tool with the Tizen Studio IDE by running the integration command:

integrate with Tizen Studio
rktracer -tizen -integrate

After the integration completes, three RKTracer entries are added under RunExternal Tools in the IDE: RKTracer ON, RKTracer OFF, and RKTracer Reports.

Step 2: Enable the coverage tool

To turn on code coverage for your embedded application, select RKTracer ON from RunExternal Tools. To turn coverage off again, select RKTracer OFF from the same menu.

You can pass options to RKTracer through the RK_ARGS path variable. Set it under ProjectPropertiesResourcesLinked ResourcesPath VariablesRK_ARGS. For example, set the value to the verbose flag -v for verbose output.

Step 3: Rebuild the application and run your tests

With RKTracer ON enabled, rebuild the application so that RKTracer instruments it during compilation. Run your tests against the instrumented application on the target, then save the coverage data from the device log to the rk-coverage.txt file:

save the coverage data
sdb dlog > rk-coverage.txt

Step 4: Generate the code coverage reports

Once you have the rk-coverage.txt file, generate the HTML coverage reports by selecting RKTracer Reports from RunExternal Tools.

Enable coverage for selected files and functions

You can scope coverage to specific folders, files, or functions by editing rktracer.config in the RKTracer installation folder.

Coverage reports for selected folders

To instrument source files from some folders while ignoring others, edit rktracer.config using the ignore, instrument, and never keywords:

rktracer.config
ignore *.c
instrument */power/* */core/* */keys/*
never */firmware_loader/* */lockdown/*
  • ignore *.c ignores all C source files from instrumentation.
  • instrument instruments source files from the given folders.
  • never ignores the selected folders.

Coverage reports for selected functions

To generate coverage only for selected functions from different files, edit rktracer.config using the function-ignore and function-instrument keywords:

rktracer.config
ignore *.c
instrument *source-file-X.c *source-file-Y.c *source-file-Z.c
function-ignore *
function-instrument fun_X() fun_Y() fun_Z()
  • ignore *.c ignores all C source files.
  • instrument *source-file-X.c *source-file-Y.c *source-file-Z.c instruments only these three source files.
  • function-ignore * then ignores all functions in the above three files.
  • function-instrument fun_X() fun_Y() fun_Z() does not ignore these three functions from instrumentation.

Next steps

Once your Tizen Studio application reports coverage, the same RKTracer workflow applies across other build systems and IDEs. Browse the rest of the documentation, or read more about how RKTracer measures coverage through MC/DC.

Stuck on your build?

Open a support ticket and an engineer who knows your toolchain will help. You get a tracked ticket ID by email.