Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: build/android/docs/coverage.md

Issue 2031743002: Added instructions on how to use code coverage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 an d runtime
10 **.ec** file. Then we need to process them using the
11 build/android/generate_emma_html.py script.
12
13 ## How to collect EMMA coverage data
14
15 1. Build your APK with the GN arg emma_coverage=true.
16 ```
17 gn args out-gn/Debug
18 > target_os = "android"
19 > emma_coverage = true
20 ```
21 By doing so, **.em** files will be created in out-gn/Debug.
22 2. Run tests, with option `--coverage-dir <directory>`, to specify where to save
23 the .ec file. For example, you can run chrome junit tests:
24 `out-gn/Debug/bin/run_chrome_junit_tests --coverage-dir /tmp/coverage`.
25 3. Now we have both .em and .ec files. We can merge them and create a html file,
26 using generate_emma_html.py. For example, generate_emma_html.py can be called
27 this way:
28 `build/android/generate_emma_html.py --coverage-dir /tmp/coverage/
29 --metadata-dir out-gn/Debug/ --output example.html`.
30 Then an example.html containing coverage info will be created:
31 `EMMA: writing [html] report to
32 [<your_current_directory>/example.html] …`
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698