5050 "unsupported_coverage_format" : 5 ,
5151 "excl_not_found" : 6 ,
5252 "bad_chunk_file" : 7 ,
53+ "missing_json_key" : 8 ,
5354}
5455
5556# Disable all logging in case developers are using this as a module
@@ -272,7 +273,12 @@ def gcovWorker(data_q, metrics_q, args, chunk, gcov_filter_options):
272273 except json .decoder .JSONDecodeError as e :
273274 logging .error ("Could not process chunk file '{}' ({}/{})" .format (chunk [i ], i + 1 , len (chunk )))
274275 logging .error (str (e ))
275- error_exit = True
276+ setExitCode ("bad_chunk_file" )
277+ continue
278+
279+ if "current_working_directory" not in intermediate_json :
280+ logging .error ("Missing 'current_working_directory' for data file: {}" .format (intermediate_json ))
281+ setExitCode ("missing_json_key" )
276282 continue
277283
278284 intermediate_json_files = processGcovs (args .cdirectory , intermediate_json ["files" ], intermediate_json ["current_working_directory" ], gcov_filter_options )
@@ -285,8 +291,7 @@ def gcovWorker(data_q, metrics_q, args, chunk, gcov_filter_options):
285291 data_q .put (base_report )
286292 metrics_q .put ((gcovs_total , gcovs_skipped ))
287293
288- if error_exit :
289- sys .exit (1 )
294+ sys .exit (EXIT_CODE )
290295
291296def processGcdas (args , coverage_files , gcov_filter_options ):
292297 chunk_size = max (args .minimum_chunk , int (len (coverage_files ) / args .jobs ) + 1 )
@@ -309,7 +314,7 @@ def processGcdas(args, coverage_files, gcov_filter_options):
309314 for p in processes :
310315 p .join ()
311316 if p .exitcode != 0 :
312- setExitCode ( "bad_chunk_file" )
317+ setExitCodeRaw ( p . exitcode )
313318
314319 base_fastcov = fastcov_jsons .pop ()
315320 for fj in fastcov_jsons :
0 commit comments