@@ -301,28 +301,40 @@ def _generate(self, outdir, coveragelog, build_dirs=None):
301
301
invalid_chars = re .compile (r"[^A-Za-z0-9_]" )
302
302
cmd .append ("--test-name" )
303
303
cmd .append (invalid_chars .sub ("_" , next (iter (self .instances ))))
304
- self .run_lcov (cmd , coveragelog )
304
+ ret = self .run_lcov (cmd , coveragelog )
305
+ if ret :
306
+ logger .error ("LCOV capture report stage failed with %s" , ret )
307
+ return ret , {}
305
308
306
309
# We want to remove tests/* and tests/ztest/test/* but save tests/ztest
307
310
cmd = ["--extract" , coveragefile ,
308
311
os .path .join (self .base_dir , "tests" , "ztest" , "*" ),
309
312
"--output-file" , ztestfile ]
310
- self .run_lcov (cmd , coveragelog )
313
+ ret = self .run_lcov (cmd , coveragelog )
314
+ if ret :
315
+ logger .error ("LCOV extract report stage failed with %s" , ret )
316
+ return ret , {}
311
317
312
318
files = []
313
319
if os .path .exists (ztestfile ) and os .path .getsize (ztestfile ) > 0 :
314
320
cmd = ["--remove" , ztestfile ,
315
321
os .path .join (self .base_dir , "tests/ztest/test/*" ),
316
322
"--output-file" , ztestfile ]
317
- self .run_lcov (cmd , coveragelog )
323
+ ret = self .run_lcov (cmd , coveragelog )
324
+ if ret :
325
+ logger .error ("LCOV remove ztest report stage failed with %s" , ret )
326
+ return ret , {}
318
327
319
328
files = [coveragefile , ztestfile ]
320
329
else :
321
330
files = [coveragefile ]
322
331
323
332
for i in self .ignores :
324
333
cmd = ["--remove" , coveragefile , i , "--output-file" , coveragefile ]
325
- self .run_lcov (cmd , coveragelog )
334
+ ret = self .run_lcov (cmd , coveragelog )
335
+ if ret :
336
+ logger .error ("LCOV remove ignores report stage failed with %s" , ret )
337
+ return ret , {}
326
338
327
339
if 'html' not in self .output_formats .split (',' ):
328
340
return 0 , {}
@@ -334,6 +346,8 @@ def _generate(self, outdir, coveragelog, build_dirs=None):
334
346
cmd .append ("--show-details" )
335
347
cmd += files
336
348
ret = self .run_command (cmd , coveragelog )
349
+ if ret :
350
+ logger .error ("LCOV genhtml report stage failed with %s" , ret )
337
351
338
352
# TODO: Add LCOV summary coverage report.
339
353
return ret , { 'report' : coveragefile , 'ztest' : ztestfile , 'summary' : None }
0 commit comments