Skip to content

Instantly share code, notes, and snippets.

@barend
Created November 21, 2013 12:44
Show Gist options
  • Save barend/7580960 to your computer and use it in GitHub Desktop.
Save barend/7580960 to your computer and use it in GitHub Desktop.
# Processes Ant JUnit logging output into tab separated values.
#
# [junit] Running com.myapp.MyTest
# [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0.721 sec
#
# Suite Num tests Num failed Num error Time (s)
# com.myapp.MyTest 2 0 0 0.721
#
BEGIN {
testname=""
print "Suite\tNum tests\tNum failed\tNum error\tTime (s)"
}
/.*Running/{
testname=$3
}
/.*Tests run/{
sub(/,/, "", $4)
sub(/,/, "", $6)
sub(/,/, "", $8)
print testname "\t" $4 "\t" $6 "\t" $8 "\t" $11
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment