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.
Integrate RKTracer with rktracer -tizen -integrate, turn on RKTracer ON from Run › External 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:
rktracer -tizen -integrate
After the integration completes, three RKTracer entries are added under Run › External 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 Run › External 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 Project › Properties › Resources › Linked Resources › Path Variables › RK_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:
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 Run › External 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:
ignore *.c instrument */power/* */core/* */keys/* never */firmware_loader/* */lockdown/*
ignore *.cignores all C source files from instrumentation.instrumentinstruments source files from the given folders.neverignores 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:
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 *.cignores all C source files.instrument *source-file-X.c *source-file-Y.c *source-file-Z.cinstruments 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.