Prevent log file energy average printing dividing by zero
If there's not enough data for averages, skip the average printing
entirely. In principle, pr_ebin could be called from elsewhere than
print_ebin, so now we print "N/A" rather than "nan" or segfaulting.
Added some const correctness. Added some tests. Unfortunately they
currently have to write a file to disk, but we should have the test
before refactoring it to run in memory. The tests needed to be able
to clean up their memory, so runner can now also call done_ebin
but for stability we'll leave that off for now.
TODO When merging to master branch enable the call to done_ebin
in runner().
Fixes #2394
Change-Id: Id2e151664dd4553e49880f96bdd90aacc945f992
12 files changed: