kcov
kcov copied to clipboard
kcov seems to loosing trace when functions called xargs bash -c function
In my script I try to parallelize mass processing of files with this xargs bash -c bashfunction
solution.
For example:
https://coveralls.io/builds/15790039/source?filename=misspell_fixer.sh
The 2 functions whose name starts with loop_
are not covered in the report.
Is there an easy way to get coverage report about these functions as well?
Hmm... I'm not sure. So this starts a new bash shell to execute the function in?
The two options (which I don't think will affect this) kcov has are --bash-handle-sh-invocation
and --bash-method=DEBUG
.
Thank you for the answer.
Hmm... I'm not sure. So this starts a new bash shell to execute the function in?
Yes. I did not find a better way to parallelize the execution
I tried the suggested 2 options, but you were right. They did not make any difference.
@SimonKagstrom I was wondering maybe to generate individual data for all the xargs-forked instances and merge them somehow. Would this be possible? What do you think?
Yes! That should be possible. kcov has a --merge
option, where you can produce a merged output from multiple separate runs.
Also, if you run with the same output directory, merging is done automatically and placed under the [merged]
link in the html output.
Thanks. I think I managed to implement it... I had to create a wrapper script, kcov did not like bash as an argument, but it seems to be working now: https://github.com/vlajos/misspell-fixer/commit/efe0ea657d57826a72813afac5f585bd390ce372