@@ -81,16 +81,20 @@ pub fn llvm_profiles_to_lcov(
8181 profile_paths : & [ PathBuf ] ,
8282 binary_path : & Path ,
8383 working_dir : & Path ,
84+ num_threads : usize ,
8485) -> Result < Vec < Vec < u8 > > , String > {
8586 let profdata_path = working_dir. join ( "grcov.profdata" ) ;
8687
88+ let num_threads = num_threads. to_string ( ) ;
8789 let args = vec ! [
8890 "merge" . as_ref( ) ,
8991 "-f" . as_ref( ) ,
9092 "-" . as_ref( ) ,
9193 "-sparse" . as_ref( ) ,
9294 "-o" . as_ref( ) ,
9395 profdata_path. as_ref( ) ,
96+ "--num-threads" . as_ref( ) ,
97+ num_threads. as_ref( ) ,
9498 ] ;
9599
96100 let stdin_paths: String = profile_paths. iter ( ) . fold ( "" . into ( ) , |mut a, x| {
@@ -301,6 +305,7 @@ mod tests {
301305 & [ tmp_path. join ( "default.profraw" ) ] ,
302306 & PathBuf :: from ( "src" ) , // There is no binary file in src
303307 tmp_path,
308+ 1 ,
304309 ) ;
305310 assert ! ( lcovs. is_ok( ) ) ;
306311 let lcovs = lcovs. unwrap ( ) ;
@@ -317,6 +322,7 @@ mod tests {
317322 & [ tmp_path. join ( "default.profraw" ) ] ,
318323 & tmp_path. join ( binary_path) ,
319324 tmp_path,
325+ 1 ,
320326 ) ;
321327 assert ! ( lcovs. is_ok( ) , "Error: {}" , lcovs. unwrap_err( ) ) ;
322328 let lcovs = lcovs. unwrap ( ) ;
@@ -349,7 +355,8 @@ mod tests {
349355
350356 assert_eq ! ( status. unwrap( ) . code( ) . unwrap( ) , 0 ) ;
351357
352- let lcovs = llvm_profiles_to_lcov ( & [ profdata_path] , & tmp_path. join ( binary_path) , tmp_path) ;
358+ let lcovs =
359+ llvm_profiles_to_lcov ( & [ profdata_path] , & tmp_path. join ( binary_path) , tmp_path, 1 ) ;
353360
354361 assert ! ( lcovs. is_ok( ) , "Error: {}" , lcovs. unwrap_err( ) ) ;
355362 let lcovs = lcovs. unwrap ( ) ;
@@ -396,6 +403,7 @@ mod tests {
396403 & [ path_with, path_without] ,
397404 & tmp_path. join ( bin_path) ,
398405 tmp_path,
406+ 1 ,
399407 ) ;
400408
401409 assert ! ( lcovs. is_ok( ) , "Error: {}" , lcovs. unwrap_err( ) ) ;
0 commit comments