sanitycheck: Fix --log-file option
save_reports should be one of the last tasks executed because it closes the log file. Withouth it, other functions that use debug functions like info and error will try to write into a close file. This fixes the following problem: sanitycheck -x=USE_CCACHE=0 -p native_posix -T samples/hello_world/ -b -N --log-file sanity.log JOBS: 8 Building initial testcase list... 1 test configurations selected, 0 configurations discarded due to filters. Adding tasks to the queue... total complete: 1/ 1 100% skipped: 0, failed: 0 1 of 1 tests passed (100.00%), 0 failed, 0 skipped with 0 warnings in 2.91 seconds Traceback (most recent call last): File "./zephyr/scripts/sanitycheck", line 3866, in <module> main() File "./zephyr/scripts/sanitycheck", line 3854, in main suite.summary(options.disable_unrecognized_section_test) File "./zephyr/scripts/sanitycheck", line 2306, in summary self.duration)) File "./zephyr/scripts/sanitycheck", line 432, in info log_file.write(what + "\n") ValueError: I/O operation on closed file. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
5310510d07
commit
ca1feea5bb
1 changed files with 1 additions and 1 deletions
|
@ -3838,7 +3838,6 @@ def main():
|
||||||
|
|
||||||
suite.misc_reports(options.compare_report, options.show_footprint,
|
suite.misc_reports(options.compare_report, options.show_footprint,
|
||||||
options.all_deltas, options.footprint_threshold, options.last_metrics)
|
options.all_deltas, options.footprint_threshold, options.last_metrics)
|
||||||
suite.save_reports()
|
|
||||||
|
|
||||||
if options.coverage:
|
if options.coverage:
|
||||||
if options.gcov_tool is None:
|
if options.gcov_tool is None:
|
||||||
|
@ -3867,6 +3866,7 @@ def main():
|
||||||
if p['connected']:
|
if p['connected']:
|
||||||
print("%s (%s): %d" %(p['platform'], p.get('id', None), p['counter']))
|
print("%s (%s): %d" %(p['platform'], p.get('id', None), p['counter']))
|
||||||
|
|
||||||
|
suite.save_reports()
|
||||||
if suite.total_failed or (suite.warnings and options.warnings_as_errors):
|
if suite.total_failed or (suite.warnings and options.warnings_as_errors):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue