Generate JUnit XML
Opened this issue · 1 comments
Would be awesome to optionally get a JUnit XML test report at the end.
Any suggestions as to how that could best be accomplished?
I'm hesitant to add this to the core because I expect it to be a rather large change.
I think technically the easiest way would be a layer on top of assert.sh which prints the header boilerplate (<junit>
) at sourcing time and the footer at exit (_assert_cleanup
). Test suite markup can be printed at each assert_end
which has all reports in $tests_errors
.
(If you wanted to retain function names, you could do something like eval $(typedef -f assert_end | sed '1s/.*/orig_&/')
and call orig_assert_end
from your custom assert_end
.)
If you need any API guarantees for this to work seamlessly I'm happy to oblige; I won't find the time to implement the JUnit XML output myself though.