embench / embench-iot

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

Jsonfix #168

Closed DTowersM closed 1 year ago

DTowersM commented 1 year ago

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

Hi @DTowersM Thanks for this. The original concept of the JSON output, was to be fragments to be edited in to the files for the embench-iot-results repo, hence the missing parentheses. However I was the only one who ever used this, and in the absence of an ability to generate a full embench-iot-results file, it is of marginal use.

So I am happy to accept this as making the JSON output more generically useful.

Thanks for the contribution.