Last active
December 23, 2015 23:59
-
-
Save dlongmuir/6714184 to your computer and use it in GitHub Desktop.
Get code coverage on Xcode5. Hacky but pragmatic.
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
#! /usr/bin/env ruby | |
workspace_name = %x[ls].split.find{ |file_name| file_name.include? 'xcworkspace' } | |
project_name = workspace_name.split('.')[0] | |
pwd = %x[pwd].strip | |
settings = %x[xcodebuild -workspace #{workspace_name} -showBuildSettings -scheme #{project_name}] | |
%x[xcodebuild -workspace #{workspace_name} test -scheme #{project_name} -destination OS=6.1,name=iPad -configuration Debug] | |
if $? == 0 | |
full_build_root = settings[/BUILD_ROOT = (.*)/].split[2] | |
full_build_root[/(.*)\/Build\/Products/] | |
root_for_gcovr = $1 | |
%x[cp -R #{project_name} #{root_for_gcovr}] | |
%x[cd \"#{root_for_gcovr}\"; gcovr -r #{pwd} --exclude '.*Tests.*' --exclude '.*libs.*' --exclude '.*main.m' --exclude '.*ExternalFrameworks.*' --exclude '.*Spec.*' --html --html-details -o coverage.html] | |
%x[open \"#{root_for_gcovr}/coverage.html\"] | |
end | |
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 | |
# poor replacement for autotest but works | |
kicker -c -e ./coverage.rb . | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment