Chromium Code Reviews| Index: build/android/docs/coverage.md |
| diff --git a/build/android/docs/coverage.md b/build/android/docs/coverage.md |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8b6a70738ad5efe6fd0ea02f22d64c2cddf8d387 |
| --- /dev/null |
| +++ b/build/android/docs/coverage.md |
| @@ -0,0 +1,27 @@ |
| +# Android code coverage instructions |
| + |
| +This is instruction for code coverage for android instrumentation and junit tests. |
| + |
| +[TOC] |
| + |
| +## How emma coverage works |
| + |
| +In order to use emma code coverage, we need to create build time .em file and run time |
| +.ec file. Then we need to merge them to become a readable html file. |
| + |
| +## Steps to make use of code coverage |
| + |
| +1. Make sure that 'emma_coverage = true' is in your gn args. |
|
mikecase (-- gone --)
2016/06/01 20:28:01
Should these be ` instead of '?
BigBossZhiling
2016/06/01 21:22:43
Done.
|
| +2. Build the apk. (With correct gn args, this will create the build time .em |
| + file) |
|
mikecase (-- gone --)
2016/06/01 20:28:01
Can probably combine the first steps into somethin
BigBossZhiling
2016/06/01 21:22:43
Done.
|
| +3. Run tests, with option '--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'. |
| +4. Now we have both .em and .ec files. We can merge them and create a html file, |
| + using generate_emma_html.py. For example, generate_emma_html.py can be called |
| + this way: |
| + '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 create: |
| + 'EMMA: writing [html] report to |
| + [<your_current_directory>/example.html] …' |