ValgrindCI icon indicating copy to clipboard operation
ValgrindCI copied to clipboard

multiple xml reports

Open hocai opened this issue 4 years ago • 5 comments

Can ValgrindCI handle multiple xml reports now? If we have many valgrind.xml reports in the folder "/output/", could we use the command of "valgrind-ci /output/*.valgrind.xml "? Thank you very much!

hocai avatar Nov 05 '21 07:11 hocai

Hi @hocai,

Unfortunately not at the moment: valgrind-ci cannot handle multiple input in one row: https://github.com/bcoconni/ValgrindCI/blob/f825a326cc758fcd6b4af59c65cb3cdd55919f54/ValgrindCI/init.py#L53-L55 However it would be quite easy to iterate over the files with the glob module:

import glob
files = glob.glob(args.xml_file)
for fname in files:
    data = ValgrindData()
    data.parse(fname)

Keep in mind that all the files would be parsed with the same options and that if HTML reports are queried, they will be all overwritten by the HTML report of the last file.

bcoconni avatar Nov 05 '21 20:11 bcoconni

Thank you for your reply!!!

hocai avatar Nov 09 '21 01:11 hocai

Hi, if HTML reports are queried about all of xml files, could we merge these html reports to one? If we can only get the last html report, we lost others. Thanks!

hocai avatar Nov 19 '21 00:11 hocai

Not sure about the feasibility of merging all HTML into one but you could certainly overload the class HTMLRenderer so that its method _unique_html_filename would pick a new name if it finds that the default name is already chosen.

bcoconni avatar Nov 20 '21 15:11 bcoconni

This can easily be implemented using bash commands, for example:

for x in /output/*.valgrind.xml; do
    [ -f "$x" ] || continue
    valgrind-ci "$x" --summary
done

I suggest adding this to README, as today I faced the same problem. Thanks @bcoconni for your library, very useful! 🥰

ppizarror avatar Dec 19 '22 15:12 ppizarror