Skip to content

Commit b2d6cac

Browse files
committed
Merge pull request AFNetworking#1760 from kylef/xcpretty
All the hipsters use xcpretty
2 parents 259c736 + ebd7440 commit b2d6cac

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: objective-c
22
before_install:
33
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
4+
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
45
- brew update
5-
- brew uninstall xctool && brew install xctool --HEAD
66
- cd Tests && pod install && cd $TRAVIS_BUILD_DIR
77
script: rake test:ios

Rakefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
namespace :test do
2+
def run_tests(scheme, sdk)
3+
system("xcodebuild -workspace AFNetworking.xcworkspace -scheme '#{scheme}' -sdk '#{sdk}' -configuration Release test | xcpretty -c ; exit ${PIPESTATUS[0]}")
4+
end
5+
26
task :prepare do
37
system(%Q{mkdir -p "Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes" && cp Tests/Schemes/*.xcscheme "Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/"})
48
end
59

610
desc "Run the AFNetworking Tests for iOS"
711
task :ios => :prepare do
8-
$ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'iOS Tests' -sdk iphonesimulator -configuration Release test -test-sdk iphonesimulator")
12+
$ios_success = run_tests('iOS Tests', 'iphonesimulator')
913
end
1014

1115
desc "Run the AFNetworking Tests for Mac OS X"
1216
task :osx => :prepare do
13-
$osx_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' -sdk macosx -configuration Release test -test-sdk macosx")
17+
$osx_success = run_tests('OS X Tests', 'macosx')
1418
end
1519
end
1620

0 commit comments

Comments
 (0)