This is instruction for code coverage for android instrumentation and junit tests.
In order to use EMMA code coverage, we need to create build time .em file and runtime .ec file. Then we need to process them using the build/android/generate_emma_html.py script.
gn args out-gn/Debug > target_os = "android" > emma_coverage = trueBy doing so, .em files will be created in out-gn/Debug.
--coverage-dir <directory>, to specify where to save the .ec file. For example, you can run chrome junit tests: out-gn/Debug/bin/run_chrome_junit_tests --coverage-dir /tmp/coverage.build/android/generate_emma_html.py --coverage-dir /tmp/coverage/ --metadata-dir out-gn/Debug/ --output example.html. Then an example.html containing coverage info will be created: EMMA: writing [html] report to [<your_current_directory>/example.html] …