mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-01-12 22:51:50 +08:00
Implemented Rake tasks for executing unit tests for iOS and OS X
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -21,6 +21,4 @@ Docs/API
|
||||
|
||||
Examples/RKDiscussionBoardExample/discussion_board_backend/public/system/attachments/*
|
||||
|
||||
# Thin
|
||||
log
|
||||
tmp
|
||||
test-reports/
|
||||
@@ -1,6 +1,6 @@
|
||||
GIT
|
||||
remote: git://github.com/GateGuru/xcoder.git
|
||||
revision: 01c76b85b3f69039ea02f74d0e853e15a227f291
|
||||
revision: ba4079305cc28ef46e19c9c4de1ad568c03c3b02
|
||||
branch: gateguru
|
||||
specs:
|
||||
xcoder (0.1.10)
|
||||
|
||||
41
Rakefile
41
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")
|
||||
|
||||
Reference in New Issue
Block a user