From 0ddcc36b3306af948005be0d41c1e8721a28e047 Mon Sep 17 00:00:00 2001 From: Matthew Purland Date: Mon, 18 Mar 2013 15:20:47 -0700 Subject: [PATCH 1/3] Script to display dialog with intent of being attached to a test post-action. --- run_code_coverage_post.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 run_code_coverage_post.sh diff --git a/run_code_coverage_post.sh b/run_code_coverage_post.sh new file mode 100644 index 0000000..8f3cd80 --- /dev/null +++ b/run_code_coverage_post.sh @@ -0,0 +1,12 @@ +#!/bin/bash +x=`/usr/bin/osascript < Date: Mon, 18 Mar 2013 15:21:29 -0700 Subject: [PATCH 2/3] Updated readme for adding optional code coverage dialog to scheme Test post-action. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index f34cb77..7422b9f 100644 --- a/README.md +++ b/README.md @@ -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 ============ From 279eed07732e616f2707341c2e1d3b32f1d486ba Mon Sep 17 00:00:00 2001 From: Matthew Purland Date: Mon, 18 Mar 2013 15:26:56 -0700 Subject: [PATCH 3/3] Updated Test post-action script to only open code coverage report once. --- run_code_coverage_post.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_code_coverage_post.sh b/run_code_coverage_post.sh index 8f3cd80..d44d1da 100644 --- a/run_code_coverage_post.sh +++ b/run_code_coverage_post.sh @@ -7,6 +7,6 @@ end tell EOT` if [[ $x = "OK" ]]; then echo 'Generating code coverage report' -cd ${SRCROOT}/XcodeCoverage && ./getcov && open ./lcov/index.html +cd ${SRCROOT}/XcodeCoverage && ./getcov fi echo 'Done.'