Skip to content

Instantly share code, notes, and snippets.

@lukestringer90
Last active August 29, 2015 14:05
Show Gist options
  • Save lukestringer90/8ce18a4005b88e5503c2 to your computer and use it in GitHub Desktop.
Save lukestringer90/8ce18a4005b88e5503c2 to your computer and use it in GitHub Desktop.
Makefile to run iOS tests from command line
PROJECT_NAME=ProjectNameHere
WORKSPACE=$(PROJECT_NAME).xcworkspace
SCHEME=$(PROJECT_NAME)
SDK=iphonesimulator
OUTPUT_PATH=test-report
DEFAULT_TASK=xcodebuild -workspace $(WORKSPACE) -scheme $(SCHEME) -sdk $(SDK) clean test | xcpretty --color ; exit ${PIPESTATUS[0]}
test:
$(DEFAULT_TASK)
travis-test:
# travis-ci.org uses xctool rather than xcodebuild
xctool -workspace $(WORKSPACE) -scheme $(SCHEME) test -sdk $(SQK) ONLY_ACTIVE_ARCH=NO
report-junit:
$(DEFAULT_TASK) -r junit --output $(OUTPUT_PATH).xml
report-html:
$(DEFAULT_TASK) -r html --output $(OUTPUT_PATH).html; open $(OUTPUT_PATH).html
install:
gem install cocoapods --no-ri --no-rdoc
gem install xcpretty --no-ri --no-rdoc
pod install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment