File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/doc/unstable-book/src/compiler-flags Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 3
3
The tracking issue for this feature is: None
4
4
5
5
------------------------
6
+
7
+ This feature allows the generation of code coverage reports.
8
+
9
+ Set the compiler flags ` -Ccodegen-units=1 -Clink-dead-code -Cpasses=insert-gcov-profiling -Zno-landing-pads ` to enable gcov profiling.
10
+
11
+ For example:
12
+ ``` Bash
13
+ cargo new testgcov --bin
14
+ cd testgcov
15
+ export RUSTFLAGS=" -Ccodegen-units=1 -Clink-dead-code -Cpasses=insert-gcov-profiling -Zno-landing-pads"
16
+ cargo build
17
+ cargo run
18
+ ```
19
+
20
+ Once you've built and run your program, files with the ` gcno ` (after build) and ` gcda ` (after execution) extensions will be created.
21
+ You can parse them with [ llvm-cov gcov] ( http://llvm.org/docs/CommandGuide/llvm-cov.html#llvm-cov-gcov ) or [ grcov] ( https://github.com/marco-c/grcov ) .
You can’t perform that action at this time.
0 commit comments