2013-05-10 15:53:33 -04:00
|
|
|
namespace :test do
|
|
|
|
|
desc "Run the AFNetworking Tests for iOS"
|
|
|
|
|
task :ios do
|
2013-05-21 12:25:57 +02:00
|
|
|
$ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'iOS Tests' test -test-sdk iphonesimulator -configuration Release")
|
2013-05-10 15:53:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
desc "Run the AFNetworking Tests for Mac OS X"
|
|
|
|
|
task :osx do
|
2013-05-21 12:25:57 +02:00
|
|
|
$osx_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' test -test-sdk macosx -sdk macosx -configuration Release")
|
2013-05-10 15:53:33 -04:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2013-05-11 13:24:41 -04:00
|
|
|
desc "Run the AFNetworking Tests for iOS & Mac OS X"
|
2013-05-13 09:31:45 -04:00
|
|
|
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
|
|
|
|
|
if $ios_success && $osx_success
|
|
|
|
|
puts "\033[0;32m** All tests executed successfully"
|
|
|
|
|
else
|
|
|
|
|
exit(-1)
|
|
|
|
|
end
|
|
|
|
|
end
|
2013-05-11 13:24:41 -04:00
|
|
|
|
|
|
|
|
task :default => 'test'
|