Last active
August 29, 2015 14:23
-
-
Save cburgmer/adefa258c967613baf9f to your computer and use it in GitHub Desktop.
How to join JUnit XML files when all you have is basic Unix commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For test cases wrapped with <testsuites>. For a single <testsuite> adapt accordingly. | |
find . -name "*.xml" -exec cat {} \; \ | |
| sed "/<\?xml [^>]*\?>/d" | sed "/<\/*testsuites>/d" \ | |
| (echo '<?xml version="1.0" encoding="UTF-8"?>' && echo '<testsuites>' && cat && echo '</testsuites>') \ | |
> joined_xml | |
mv joined_xml joined.xml # Avoid the output being mixed up with the input |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment