embench / embench-iot

The main Embench repository
https://www.embench.org/
GNU General Public License v3.0
248 stars 101 forks source link

jsonfix for embench 1.0 #169

Closed DTowersM closed 1 year ago

DTowersM commented 1 year ago

Sister push to jsonfix, this fixes the same issue in the Embench-1.0-branch which is stable.

Contains the fixes for the JSON file output. The extra { and } in the benchmark_speed.py and benchmark_size.py let the json output be correctly inputted by computers. For JSON outputs, we do not want to print All benchmarks sized successfully, as this ruins the json file. Failed runs will not have the trailing }.

On the Embench_core.py file, the .format python function looks for { and } in the string. Because we need a }, the .format function gets confused and wonders why there isn't a { to give the bounds of what to replace. Currently, this throws a pretty nasty error (at least on my machine). We can fix this by using string concatenation.

log.info(' }' + '{oc}'.format(oc=opt_comma))

jeremybennett commented 1 year ago

Thanks @DTowersM As discussed in #168 the original JSON concept wasn't to be standalone. But this fix makes JSON output more generically useful.