Last active
January 25, 2016 18:38
-
-
Save notjosh/1ef61af220d3fe15ac75 to your computer and use it in GitHub Desktop.
spacecommander build formatter, that creates JUnit-ish output from piped `format-objc-mobuild` command output for Jenkins to consume, and GitHub pull request builder to show
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
#!/bin/bash | |
files=($(grep -o "git add '.*';$" | awk -F "'" '{print $2}')) | |
count=${#files[@]} | |
timestamp=$(date +%Y-%m-%dT%H:%M:%S%z) | |
cat <<EOT | |
<testsuites> | |
<testsuite name="[ Space Commander]" tests="$count" failures="$count" timestamp="$timestamp"> | |
EOT | |
for ((i = 0; i != count; i++)); do | |
file=${files[i]} | |
cat <<EOT | |
<testcase name="/$(basename $file)" classname="$(dirname $file)/"> | |
<error message="File not formatted">File '$file' has formatting problems.</error> | |
</testcase> | |
EOT | |
done | |
if [ $count -eq 0 ]; then | |
cat <<EOT | |
<testcase name="/dummy" classname="dummy/" /> | |
EOT | |
fi | |
cat <<EOT | |
</testsuite> | |
</testsuites> | |
EOT | |
exit $count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment