Skip to content

Commit 3e29cd2

Browse files
committed
Merge pull request #4 from mpurland/master
Add Test post-action script to display dialog to generate/display code coverage report
2 parents eeff530 + 279eed0 commit 3e29cd2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ If you make changes to your production code, you should clear out all build
3535
artifacts before measuring code coverage again. "Clean Build Folder" by holding
3636
down the Option key in Xcode's "Product" menu.
3737

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

3945
Modification
4046
============

run_code_coverage_post.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
x=`/usr/bin/osascript <<EOT
3+
tell application "Finder"
4+
activate
5+
set myReply to button returned of (display dialog "Generate Code Coverage Report")
6+
end tell
7+
EOT`
8+
if [[ $x = "OK" ]]; then
9+
echo 'Generating code coverage report'
10+
cd ${SRCROOT}/XcodeCoverage && ./getcov
11+
fi
12+
echo 'Done.'

0 commit comments

Comments
 (0)