OLD | NEW |
---|---|
(Empty) | |
1 # Android code coverage instructions | |
2 | |
3 This is instruction for code coverage for android instrumentation and junit test s. | |
4 | |
5 [TOC] | |
6 | |
7 ## How emma coverage works | |
8 | |
9 In order to use emma code coverage, we need to create build time .em file and ru n time | |
10 .ec file. Then we need to merge them to become a readable html file. | |
11 | |
12 ## Steps to make use of code coverage | |
13 | |
14 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.
| |
15 2. Build the apk. (With correct gn args, this will create the build time .em | |
16 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.
| |
17 3. Run tests, with option '--coverage-dir <directory>', to specify where to save | |
18 the .ec file. For example, you can run chrome junit tests: | |
19 'out-gn/Debug/bin/run_chrome_junit_tests --coverage-dir /tmp/coverage'. | |
20 4. Now we have both .em and .ec files. We can merge them and create a html file, | |
21 using generate_emma_html.py. For example, generate_emma_html.py can be called | |
22 this way: | |
23 'build/android/generate_emma_html.py --coverage-dir /tmp/coverage/ | |
24 --metadata-dir out-gn/Debug/ --output example.html'. | |
25 Then an example.html containing coverage info will be create: | |
26 'EMMA: writing [html] report to | |
27 [<your_current_directory>/example.html] …' | |
OLD | NEW |