Merge branch 'feature/test-prepare-task' of https://github.com/blakewatters/AFNetworking into blakewatters-feature/test-prepare-task

Conflicts:
	Rakefile
This commit is contained in:
Mattt Thompson 2013-05-31 09:28:36 -07:00
commit 9589ac3ea5
3 changed files with 12 additions and 8 deletions

1
.gitignore vendored
View file

@ -17,3 +17,4 @@ profile
DerivedData
.idea/
Tests/Pods
Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/

View file

@ -3,5 +3,4 @@ before_install:
- brew update
- brew install xctool --HEAD
- cd Tests && pod install && cd $TRAVIS_BUILD_DIR
- mkdir -p "Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes" && cp Tests/Schemes/*.xcscheme "Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/"
script: rake test

View file

@ -1,23 +1,27 @@
namespace :test do
task :prepare do
system(%Q{mkdir -p "Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes" && cp Tests/Schemes/*.xcscheme "Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/"})
end
desc "Run the AFNetworking Tests for iOS"
task :ios do
task :ios => :prepare do
$ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'iOS Tests' build -sdk iphonesimulator -configuration Release")
$ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'iOS Tests' build-tests -sdk iphonesimulator -configuration Release")
$ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'iOS Tests' test -test-sdk iphonesimulator -configuration Release")
end
desc "Run the AFNetworking Tests for Mac OS X"
task :osx do
$ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' build -sdk macosx -configuration Release")
$ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' build-tests -sdk macosx -configuration Release")
task :osx => :prepare do
$osx_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' build -sdk macosx -configuration Release")
$osx_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' build-tests -sdk macosx -configuration Release")
$osx_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' test -test-sdk macosx -sdk macosx -configuration Release")
end
end
desc "Run the AFNetworking Tests for iOS & Mac OS X"
task :test => ['test:ios', 'test:osx'] do
puts "\033[0;31m!! iOS unit tests failed" unless $ios_success
puts "\033[0;31m!! OS X unit tests failed" unless $osx_success
puts "\033[0;31m! iOS unit tests failed" unless $ios_success
puts "\033[0;31m! OS X unit tests failed" unless $osx_success
if $ios_success && $osx_success
puts "\033[0;32m** All tests executed successfully"
else