@@ -165,16 +165,15 @@ def process_afl_test_cases(cargs):
165
165
(os .path .basename (f ), index + 1 , len (afl_files ),
166
166
curr_cycle ), cov_paths ['log_file' ], cargs )
167
167
168
- if cargs .coverage_cmd :
169
- # execute the command to generate code coverage stats
170
- # for the current AFL test case file
171
- if run_once :
172
- run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
173
- cov_paths ['log_file' ], cargs , NO_OUTPUT )
174
- else :
175
- out_lines = run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
176
- cov_paths ['log_file' ], cargs , WANT_OUTPUT )[1 ]
177
- run_once = True
168
+ # execute the command to generate code coverage stats
169
+ # for the current AFL test case file
170
+ if run_once :
171
+ run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
172
+ cov_paths ['log_file' ], cargs , NO_OUTPUT )
173
+ else :
174
+ out_lines = run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
175
+ cov_paths ['log_file' ], cargs , WANT_OUTPUT )[1 ]
176
+ run_once = True
178
177
179
178
tot_files += 1
180
179
@@ -267,39 +266,37 @@ def process_afl_test_cases(cargs):
267
266
cov_paths ['dirs' ][fuzz_dir ]['prev_lcov_info' ] = curr_lcov_info
268
267
cov_paths ['dirs' ][fuzz_dir ]['prev_lcov_info_final' ] = curr_lcov_info_final
269
268
270
- if cargs .coverage_cmd :
269
+ ### execute the command to generate code coverage stats
270
+ ### for the current AFL test case file
271
+ if run_once :
272
+ run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
273
+ cov_paths ['log_file' ], cargs , NO_OUTPUT )
274
+ else :
275
+ out_lines = run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
276
+ cov_paths ['log_file' ], cargs , WANT_OUTPUT )[1 ]
277
+ run_once = True
271
278
272
- ### execute the command to generate code coverage stats
273
- ### for the current AFL test case file
274
- if run_once :
275
- run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
276
- cov_paths ['log_file' ], cargs , NO_OUTPUT )
277
- else :
278
- out_lines = run_cmd (cargs .coverage_cmd .replace ('AFL_FILE' , f ),
279
- cov_paths ['log_file' ], cargs , WANT_OUTPUT )[1 ]
280
- run_once = True
281
-
282
- ### generate the code coverage stats for this test case
283
- gen_coverage (fuzz_dir , cov_paths , cargs )
284
-
285
- ### diff to the previous code coverage, look for new
286
- ### lines/functions, and write out results
287
- if cov_paths ['dirs' ][fuzz_dir ]['prev_file' ]:
288
- coverage_diff (curr_cycle , fuzz_dir , cov_paths ,
289
- f , cov , cargs )
290
-
291
- if not cargs .disable_lcov_web and cargs .lcov_web_all :
292
- gen_web_cov_report (fuzz_dir , cov_paths , cargs )
293
-
294
- ### log the output of the very first coverage command to
295
- ### assist in troubleshooting
296
- if len (out_lines ):
297
- logr ("\n \n ++++++ BEGIN - first exec output for CMD: %s" % \
298
- (cargs .coverage_cmd .replace ('AFL_FILE' , f )),
299
- cov_paths ['log_file' ], cargs )
300
- for line in out_lines :
301
- logr (" %s" % (line ), cov_paths ['log_file' ], cargs )
302
- logr ("++++++ END\n " , cov_paths ['log_file' ], cargs )
279
+ ### generate the code coverage stats for this test case
280
+ gen_coverage (fuzz_dir , cov_paths , cargs )
281
+
282
+ ### diff to the previous code coverage, look for new
283
+ ### lines/functions, and write out results
284
+ if cov_paths ['dirs' ][fuzz_dir ]['prev_file' ]:
285
+ coverage_diff (curr_cycle , fuzz_dir , cov_paths ,
286
+ f , cov , cargs )
287
+
288
+ if not cargs .disable_lcov_web and cargs .lcov_web_all :
289
+ gen_web_cov_report (fuzz_dir , cov_paths , cargs )
290
+
291
+ ### log the output of the very first coverage command to
292
+ ### assist in troubleshooting
293
+ if len (out_lines ):
294
+ logr ("\n \n ++++++ BEGIN - first exec output for CMD: %s" % \
295
+ (cargs .coverage_cmd .replace ('AFL_FILE' , f )),
296
+ cov_paths ['log_file' ], cargs )
297
+ for line in out_lines :
298
+ logr (" %s" % (line ), cov_paths ['log_file' ], cargs )
299
+ logr ("++++++ END\n " , cov_paths ['log_file' ], cargs )
303
300
304
301
if dir_ctr == 1 :
305
302
curr_file = f
0 commit comments