File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ pub enum CargoAction {
187187 Build ,
188188 Clippy ,
189189 Coverage {
190+ lcov : bool ,
190191 open : bool ,
191192 } ,
192193 Doc {
@@ -254,9 +255,13 @@ impl Cargo {
254255 tool_args. extend ( [ "-D" , "warnings" ] ) ;
255256 }
256257 }
257- CargoAction :: Coverage { open } => {
258+ CargoAction :: Coverage { lcov , open } => {
258259 action = "llvm-cov" ;
259- extra_args. push ( "--html" ) ;
260+ if lcov {
261+ extra_args. extend ( [ "--lcov" , "--output-path" , "target/lcov" ] ) ;
262+ } else {
263+ extra_args. push ( "--html" ) ;
264+ }
260265 if open {
261266 extra_args. push ( "--open" ) ;
262267 }
Original file line number Diff line number Diff line change @@ -89,7 +89,10 @@ fn clippy(opt: &ClippyOpt) -> Result<()> {
8989fn code_coverage ( opt : & CovOpt ) -> Result < ( ) > {
9090 if has_cmd ( "cargo-llvm-cov" ) {
9191 let cargo = Cargo {
92- action : CargoAction :: Coverage { open : opt. open } ,
92+ action : CargoAction :: Coverage {
93+ lcov : opt. lcov ,
94+ open : opt. open ,
95+ } ,
9396 features : Feature :: more_code ( * opt. unstable , false ) ,
9497 // Leave out uefi-macros; the compilation tests will just make
9598 // things slower without contributing anything to the coverage
Original file line number Diff line number Diff line change @@ -113,6 +113,10 @@ pub struct CovOpt {
113113 #[ clap( long, action) ]
114114 pub open : bool ,
115115
116+ /// Output raw lcov data instead of HTML.
117+ #[ clap( long, action, conflicts_with = "open" ) ]
118+ pub lcov : bool ,
119+
116120 #[ clap( flatten) ]
117121 pub unstable : UnstableOpt ,
118122}
You can’t perform that action at this time.
0 commit comments