From c2c3a656e7e627b2f4353cc3f58fe26c1ed426d6 Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Mon, 13 May 2013 09:31:45 -0400 Subject: [PATCH] Add composite status code reporting during CLI execution --- Rakefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 48e4611..df32ced 100644 --- a/Rakefile +++ b/Rakefile @@ -1,16 +1,24 @@ namespace :test do desc "Run the AFNetworking Tests for iOS" task :ios do - system("xctool -workspace AFNetworking.xcworkspace -scheme 'iOS Tests' test -test-sdk iphonesimulator") + $ios_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'iOS Tests' test -test-sdk iphonesimulator") end desc "Run the AFNetworking Tests for Mac OS X" task :osx do - system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' test -test-sdk macosx -sdk macosx") + $osx_success = system("xctool -workspace AFNetworking.xcworkspace -scheme 'OS X Tests' test -test-sdk macosx -sdk macosx") end end desc "Run the AFNetworking Tests for iOS & Mac OS X" -task :test => ['test:ios', 'test:osx'] +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 task :default => 'test'