Skip to content

Add Test post-action script to display dialog to generate/display code coverage report #4

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

Merged
merged 3 commits into from
Mar 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ If you make changes to your production code, you should clear out all build
artifacts before measuring code coverage again. "Clean Build Folder" by holding
down the Option key in Xcode's "Product" menu.

* Optional: Run code coverage after running unit tests
* Edit Xcode scheme -> Test -> Post-actions
* Set shell to: ``/bin/bash``
* Set script to:
``source ${SRCROOT}/XcodeCoverage/run_code_coverage_post.sh``


Modification
============
Expand Down
12 changes: 12 additions & 0 deletions run_code_coverage_post.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
x=`/usr/bin/osascript <<EOT
tell application "Finder"
activate
set myReply to button returned of (display dialog "Generate Code Coverage Report")
end tell
EOT`
if [[ $x = "OK" ]]; then
echo 'Generating code coverage report'
cd ${SRCROOT}/XcodeCoverage && ./getcov
fi
echo 'Done.'