Last active
May 31, 2018 19:24
-
-
Save diegolovison/ae434e014e8b9ea66d2168e9567e62b8 to your computer and use it in GitHub Desktop.
Counting Surefire Results
This file contains hidden or 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
DIR=$1 | |
num=0 | |
skipped=0 | |
failures=0 | |
for file in $(find $DIR -name 'TEST-*.xml') | |
do | |
if [[ -f $file ]]; then | |
num=$((num + $(xmllint --xpath 'string(/testsuite/@tests)' $file))) | |
current_skipped=$(xmllint --xpath 'string(/testsuite/@skipped)' $file) | |
failures=$((failures + $(xmllint --xpath 'string(/testsuite/@failures)' $file))) | |
if [ -z "$current_skipped" ] | |
then | |
current_skipped=0 | |
fi | |
skipped=$((skipped + current_skipped)) | |
fi | |
done | |
echo "tests: $num" | |
echo "skipped: $skipped" | |
echo "failures: $failures" | |
echo "run: $((num - skipped))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment