Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate JUnit XML #18

Open
cadorn opened this issue Dec 10, 2015 · 1 comment
Open

Generate JUnit XML #18

cadorn opened this issue Dec 10, 2015 · 1 comment

Comments

@cadorn
Copy link

cadorn commented Dec 10, 2015

Would be awesome to optionally get a JUnit XML test report at the end.

Any suggestions as to how that could best be accomplished?

@lehmannro
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants