Build Code Coverage instrumented binaries for native bianries in Linux and OSX.
Add an option in build.sh called 'coverage' to produce gcov-style instrumented builds.
Example usage - ./build.sh debug coverage clean
This will generate the '.gcno' notes files for each object file in the same directory along with the instrumented native binaries. These .gcno files contain some of the coverage data like source line mappings, basic block graphs info etc.
Each time these instrumented binaries are run, a separate .gcda file is created for each object file in the same directory. These .gcda files contain arc transition counts, and some summary information.
Code Coverage reports can be generated from the .gcno and .gcda files using a tool like gcovr or lcov. *But this commit is only for generated the .gcno files while compiling with the 'coverage' option.*
The next steps
- Add option in run-test.sh to generate code-coverage reports using the instrumented native binaries.
- Integrate with Jenkins CI to do code-coverage runs.
Commit migrated from https://github.com/dotnet/coreclr/commit/
38f82df88a37fa4f47bd1b01b0faad9970b00476