Skip to content

Commit 5dce4c3

Browse files
committed
Migrate unit testing infrastructure from xcoder to xctool. Add Travis CI integration
1 parent 4cffe8c commit 5dce4c3

File tree

9 files changed

+28
-196
lines changed

9 files changed

+28
-196
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: objective-c
2+
before_install:
3+
- brew update
4+
- brew install xctool --HEAD
5+
- bundle update
6+
script: "./Tests/cibuild"

.xctool-args

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
"-workspace", "RestKit.xcworkspace",
3+
"-scheme", "RestKit",
4+
"-configuration", "Debug"
5+
]

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ gem "rake", "~> 10.0.0"
44
gem "bundler", "~> 1.3.0"
55
gem "sinatra", :git => "git://github.com/sinatra/sinatra.git"
66
gem "thin", "~> 1.5.0"
7-
gem 'xcoder', :git => "git://github.com/rayh/xcoder.git"
87
gem 'restkit', :git => 'git://github.com/RestKit/RestKit-Gem.git'
98
gem 'debugger', '~> 1.3.0'
109
gem 'cocoapods', '0.19.1'

Gemfile.lock

-26
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@ GIT
44
specs:
55
restkit (0.0.0)
66

7-
GIT
8-
remote: git://github.com/rayh/xcoder.git
9-
revision: 2560155d7c817c2e2801e6fb8b75e6453a3e7106
10-
specs:
11-
xcoder (0.1.17)
12-
aws-sdk
13-
builder
14-
colorize
15-
multi_json
16-
nokogiri
17-
plist
18-
rest-client
19-
207
GIT
218
remote: git://github.com/sinatra/sinatra.git
229
revision: 54d6ba06cc76b3ddcadbb8ccfe090f134364fca3
@@ -33,11 +20,6 @@ GEM
3320
i18n (= 0.6.1)
3421
multi_json (~> 1.0)
3522
addressable (2.3.3)
36-
aws-sdk (1.8.5)
37-
json (~> 1.4)
38-
nokogiri (>= 1.4.4)
39-
uuidtools (~> 2.1)
40-
builder (3.2.0)
4123
claide (0.2.0)
4224
cocoapods (0.19.1)
4325
activesupport (~> 3.2.13)
@@ -57,7 +39,6 @@ GEM
5739
rake (~> 10.0.0)
5840
cocoapods-downloader (0.1.0)
5941
colored (1.2)
60-
colorize (0.5.8)
6142
columnize (0.3.6)
6243
daemons (1.1.9)
6344
debugger (1.3.3)
@@ -76,11 +57,9 @@ GEM
7657
hashie (1.2.0)
7758
i18n (0.6.1)
7859
json (1.7.7)
79-
mime-types (1.21)
8060
multi_json (1.6.1)
8161
multipart-post (1.2.0)
8262
netrc (0.7.7)
83-
nokogiri (1.5.6)
8463
octokit (1.23.0)
8564
addressable (~> 2.2)
8665
faraday (~> 0.8)
@@ -89,19 +68,15 @@ GEM
8968
multi_json (~> 1.3)
9069
netrc (~> 0.7.7)
9170
open4 (1.3.0)
92-
plist (3.1.0)
9371
rack (1.5.2)
9472
rack-protection (1.5.0)
9573
rack
9674
rake (10.0.3)
97-
rest-client (1.6.7)
98-
mime-types (>= 1.16)
9975
thin (1.5.0)
10076
daemons (>= 1.0.9)
10177
eventmachine (>= 0.12.6)
10278
rack (>= 1.0.0)
10379
tilt (1.3.5)
104-
uuidtools (2.1.3)
10580
xcodeproj (0.5.5)
10681
activesupport (~> 3.2.13)
10782
colored (~> 1.2)
@@ -117,4 +92,3 @@ DEPENDENCIES
11792
restkit!
11893
sinatra!
11994
thin (~> 1.5.0)
120-
xcoder!

Rakefile

+15-29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require 'rubygems'
22
require 'bundler/setup'
3-
require 'xcoder'
43
require 'restkit/rake'
54
require 'debugger'
65

@@ -16,37 +15,24 @@ RestKit::Rake::ServerTask.new do |t|
1615
end
1716

1817
namespace :test do
19-
namespace :logic do
20-
desc "Run the logic tests for iOS"
21-
task :ios do
22-
config = Xcode.workspace(:RestKit).scheme(:RestKitTests)
23-
builder = config.builder
24-
build_dir = File.dirname(config.parent.workspace_root) + '/Build'
25-
builder.symroot = build_dir + '/Products'
26-
builder.objroot = build_dir
27-
builder.test(:sdk => 'iphonesimulator')
28-
end
29-
30-
desc "Run the logic tests for OS X"
31-
task :osx do
32-
config = Xcode.workspace(:RestKit).scheme(:RestKitFrameworkTests)
33-
builder = config.builder
34-
build_dir = File.dirname(config.parent.workspace_root) + '/Build'
35-
builder.symroot = build_dir + '/Products'
36-
builder.objroot = build_dir
37-
builder.test(:sdk => 'macosx')
38-
end
39-
end
18+
desc "Run the unit tests for iOS"
19+
task :ios do
20+
system("xctool -scheme RestKit test -test-sdk iphonesimulator")
21+
$ios_return_value = $?
22+
end
4023

41-
desc "Run the unit tests for iOS and OS X"
42-
task :logic => ['logic:ios', 'logic:osx']
24+
desc "Run the unit tests for OS X"
25+
task :osx do
26+
system("xctool -scheme RestKitFramework test -test-sdk macosx -sdk macosx")
27+
$osx_return_value = $?
28+
end
4329

44-
desc "Run all tests for iOS and OS X"
4530
task :all do
46-
Rake.application.invoke_task("test:logic")
47-
unit_status = $?.exitstatus
48-
puts "\033[0;31m!! Unit Tests failed with exit status of #{unit_status}" if unit_status != 0
49-
puts "\033[0;32m** All Tests executed successfully" if unit_status == 0 #&& integration_status == 0
31+
Rake.application.invoke_task("test:ios")
32+
Rake.application.invoke_task("test:osx")
33+
puts "\033[0;31m!! iOS unit tests failed" unless $ios_return_value.success?
34+
puts "\033[0;31m!! OS X unit tests failed" unless $osx_return_value.success?
35+
puts "\033[0;32m** All tests executed successfully" if $ios_return_value.success? && $osx_return_value.success?
5036
end
5137
end
5238

RestKit.xcworkspace/xcshareddata/xcschemes/RestKitFrameworkTests.xcscheme

-69
This file was deleted.

RestKit.xcworkspace/xcshareddata/xcschemes/RestKitTests.xcscheme

-69
This file was deleted.

Tests/Logic/Network/RKObjectRequestOperationTest.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ - (void)testInvocationOfFailureBlock
527527

528528
[requestOperation start];
529529
expect([requestOperation isFinished]).will.beTruthy();
530-
expect(blockError).notTo.beNil();
530+
expect(blockError).willNot.beNil();
531531
}
532532

533533
#pragma mark - Will Map Data Block

Tests/cibuild

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Configure RVM
44
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
5-
source .rvmrc
5+
rvm rvmrc load
66

77
# Git submodules
88
git submodule update --init

0 commit comments

Comments
 (0)