diff --git a/.gitignore b/.gitignore index 3d395db4..1391d1b0 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,4 @@ Docs/API Examples/RKDiscussionBoardExample/discussion_board_backend/public/system/attachments/* -# Thin -log -tmp \ No newline at end of file +test-reports/ \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index dcfa3f47..ac32c477 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://github.com/GateGuru/xcoder.git - revision: 01c76b85b3f69039ea02f74d0e853e15a227f291 + revision: ba4079305cc28ef46e19c9c4de1ad568c03c3b02 branch: gateguru specs: xcoder (0.1.10) diff --git a/Rakefile b/Rakefile index 7ce19f1f..31b14bb9 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require 'rubygems' require 'bundler/setup' +require 'xcoder' require 'restkit/rake' RestKit::Rake::ServerTask.new do |t| @@ -13,6 +14,44 @@ RestKit::Rake::ServerTask.new do |t| end end +namespace :test do + task :kill_simulator do + system(%q{killall -m -KILL "iPhone Simulator"}) + end + + namespace :units do + desc "Run the RestKit unit tests for iOS" + task :ios => :kill_simulator do + config = Xcode.project(:RestKit).target(:RestKitTests).config(:Debug) + builder = config.builder + build_dir = File.dirname(config.target.project.path) + '/Build' + builder.symroot = build_dir + '/Products' + builder.objroot = build_dir + builder.test('iphonesimulator') + end + + desc "Run the RestKit unit tests for OS X" + task :osx => :kill_simulator do + config = Xcode.project(:RestKit).target(:RestKitFrameworkTests).config(:Debug) + builder = config.builder + build_dir = File.dirname(config.target.project.path) + '/Build' + builder.symroot = build_dir + '/Products' + builder.objroot = build_dir + builder.test('macosx') + end + end + + desc "Run the RestKit unit tests for iOS and OS X" + task :units => ['units:ios', 'units:osx'] + + task :all => ['test:units', 'test:integration'] +end + +desc 'Run all the GateGuru tests' +task :test => "test:all" + +task :default => "test:all" + def restkit_version @restkit_version ||= ENV['VERSION'] || File.read("VERSION").chomp end @@ -33,8 +72,6 @@ def run(command, min_exit_status = 0) return $?.exitstatus end -task :default => 'test:server' - desc "Build RestKit for iOS and Mac OS X" task :build do run("xcodebuild -workspace RestKit.xcodeproj/project.xcworkspace -scheme RestKit -sdk iphonesimulator5.0 clean build")