Skip to content

Commit 906e33d

Browse files
committed
Restore execution of Unit Tests via Rake
1 parent 6b8a390 commit 906e33d

File tree

4 files changed

+168
-68
lines changed

4 files changed

+168
-68
lines changed

Gemfile.lock

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ GIT
66

77
GIT
88
remote: git://github.com/rayh/xcoder.git
9-
revision: ce2b36ed9e2f44513d22d2389576616e72d802b4
9+
revision: 4071b9f87acdb4fe4e25c3fc862d0ca45eac9b67
1010
specs:
11-
xcoder (0.1.12)
11+
xcoder (0.1.15)
1212
builder
1313
json
1414
nokogiri
@@ -17,21 +17,21 @@ GIT
1717

1818
GIT
1919
remote: git://github.com/sinatra/sinatra.git
20-
revision: 1e0a6472717f6ee5054ddd1e67d1af41b4f80c91
20+
revision: 9984d0d2b3f1ea12273c6c25f8e102b2329f33e9
2121
specs:
2222
sinatra (1.4.0)
23-
rack (~> 1.3, >= 1.3.6)
24-
rack-protection (~> 1.2)
23+
rack (~> 1.4)
24+
rack-protection (~> 1.3)
2525
tilt (~> 1.3, >= 1.3.3)
2626

2727
GEM
2828
remote: http://rubygems.org/
2929
specs:
30-
activesupport (3.2.9)
30+
activesupport (3.2.11)
3131
i18n (~> 0.6)
3232
multi_json (~> 1.0)
3333
addressable (2.3.2)
34-
builder (3.1.3)
34+
builder (3.1.4)
3535
cocoapods (0.16.0)
3636
activesupport (~> 3.2.6)
3737
colored (~> 1.2)
@@ -51,7 +51,7 @@ GEM
5151
debugger-ruby_core_source (~> 1.1.3)
5252
debugger-linecache (1.1.2)
5353
debugger-ruby_core_source (>= 1.1.1)
54-
debugger-ruby_core_source (1.1.3)
54+
debugger-ruby_core_source (1.1.6)
5555
escape (0.0.4)
5656
eventmachine (1.0.0)
5757
faker (1.1.2)
@@ -62,23 +62,25 @@ GEM
6262
faraday (>= 0.7.4, < 0.9)
6363
hashie (1.2.0)
6464
i18n (0.6.1)
65-
json (1.7.5)
65+
json (1.7.6)
6666
mime-types (1.19)
67-
multi_json (1.3.7)
67+
multi_json (1.5.0)
6868
multipart-post (1.1.5)
69-
nokogiri (1.5.5)
70-
octokit (1.18.0)
69+
netrc (0.7.7)
70+
nokogiri (1.5.6)
71+
octokit (1.21.0)
7172
addressable (~> 2.2)
7273
faraday (~> 0.8)
73-
faraday_middleware (~> 0.8)
74+
faraday_middleware (~> 0.9)
7475
hashie (~> 1.2)
7576
multi_json (~> 1.3)
77+
netrc (~> 0.7.7)
7678
open4 (1.3.0)
7779
plist (3.1.0)
78-
rack (1.4.1)
79-
rack-protection (1.2.0)
80+
rack (1.4.3)
81+
rack-protection (1.3.2)
8082
rack
81-
rake (0.9.5)
83+
rake (0.9.6)
8284
rest-client (1.6.7)
8385
mime-types (>= 1.16)
8486
thin (1.5.0)
@@ -87,6 +89,8 @@ GEM
8789
rack (>= 1.0.0)
8890
tilt (1.3.3)
8991
xcodeproj (0.4.0)
92+
activesupport (~> 3.2.6)
93+
colored (~> 1.2)
9094

9195
PLATFORMS
9296
ruby

Rakefile

Lines changed: 10 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require 'rubygems'
22
require 'bundler/setup'
33
require 'xcoder'
44
require 'restkit/rake'
5-
require 'ruby-debug'
5+
require 'debugger'
66

77
RestKit::Rake::ServerTask.new do |t|
88
t.port = 4567
@@ -23,19 +23,19 @@ namespace :test do
2323
namespace :logic do
2424
desc "Run the logic tests for iOS"
2525
task :ios => :kill_simulator do
26-
config = Xcode.project(:RestKit).target(:RestKitTests).config(:Debug)
26+
config = Xcode.workspace(:RestKit).scheme(:RestKitTests)
2727
builder = config.builder
28-
build_dir = File.dirname(config.target.project.path) + '/Build'
28+
build_dir = File.dirname(config.parent.workspace_root) + '/Build'
2929
builder.symroot = build_dir + '/Products'
3030
builder.objroot = build_dir
3131
builder.test(:sdk => 'iphonesimulator')
3232
end
3333

3434
desc "Run the logic tests for OS X"
3535
task :osx do
36-
config = Xcode.project(:RestKit).target(:RestKitFrameworkTests).config(:Debug)
36+
config = Xcode.workspace(:RestKit).scheme(:RestKitFrameworkTests)
3737
builder = config.builder
38-
build_dir = File.dirname(config.target.project.path) + '/Build'
38+
build_dir = File.dirname(config.parent.workspace_root) + '/Build'
3939
builder.symroot = build_dir + '/Products'
4040
builder.objroot = build_dir
4141
builder.test(:sdk => 'macosx')
@@ -45,31 +45,12 @@ namespace :test do
4545
desc "Run the unit tests for iOS and OS X"
4646
task :logic => ['logic:ios', 'logic:osx']
4747

48-
namespace :application do
49-
desc "Run the application tests for iOS"
50-
task :ios => :kill_simulator do
51-
config = Xcode.project(:RKApplicationTests).target('Application Tests').config(:Debug)
52-
builder = config.builder
53-
build_dir = File.dirname(config.target.project.path) + '/Build'
54-
builder.symroot = build_dir + '/Products'
55-
builder.objroot = build_dir
56-
builder.test(:sdk => 'iphonesimulator')
57-
end
58-
end
59-
60-
desc "Run the application tests for iOS"
61-
task :application => 'application:ios'
62-
6348
desc "Run all tests for iOS and OS X"
6449
task :all do
6550
Rake.application.invoke_task("test:logic")
6651
unit_status = $?.exitstatus
67-
puts "\033[0;33m!! Warning: RestKit application tests are disabled!!"
68-
# Rake.application.invoke_task("test:application")
69-
integration_status = $?.exitstatus
7052
puts "\033[0;31m!! Unit Tests failed with exit status of #{unit_status}" if unit_status != 0
71-
puts "\033[0;31m!! Integration Tests failed with exit status of #{integration_status}" if integration_status != 0
72-
puts "\033[0;32m** All Tests executed successfully" if unit_status == 0 && integration_status == 0
53+
puts "\033[0;32m** All Tests executed successfully" if unit_status == 0 #&& integration_status == 0
7354
end
7455
end
7556

@@ -100,10 +81,9 @@ end
10081

10182
desc "Build RestKit for iOS and Mac OS X"
10283
task :build do
103-
run("xcodebuild -workspace RestKit.xcodeproj/project.xcworkspace -scheme RestKit -sdk iphonesimulator5.0 clean build")
104-
run("xcodebuild -workspace RestKit.xcodeproj/project.xcworkspace -scheme RestKit -sdk iphoneos clean build")
105-
run("xcodebuild -workspace RestKit.xcodeproj/project.xcworkspace -scheme RestKit -sdk macosx10.6 clean build")
106-
run("xcodebuild -workspace Examples/RKCatalog/RKCatalog.xcodeproj/project.xcworkspace -scheme RKCatalog -sdk iphoneos clean build")
84+
run("xcodebuild -workspace RestKit.xcworkspace -scheme RestKit -sdk iphonesimulator5.0 clean build")
85+
run("xcodebuild -workspace RestKit.xcworkspace -scheme RestKit -sdk iphoneos clean build")
86+
run("xcodebuild -workspace RestKit.xcworkspace -scheme RestKit -sdk macosx10.6 clean build")
10787
end
10888

10989
desc "Generate documentation via appledoc"
@@ -175,7 +155,7 @@ end
175155
namespace :build do
176156
desc "Build all Example projects to ensure they are building properly"
177157
task :examples do
178-
ios_sdks = %w{iphoneos iphonesimulator5.0}
158+
ios_sdks = %w{iphoneos iphonesimulator5.0 iphonesimulator6.0}
179159
osx_sdks = %w{macosx}
180160
osx_projects = %w{RKMacOSX}
181161

@@ -199,25 +179,3 @@ desc "Validate a branch is ready for merging by checking for common issues"
199179
task :validate => [:build, 'docs:check', 'uispec:all'] do
200180
puts "Project state validated successfully. Proceed with merge."
201181
end
202-
203-
namespace :payload do
204-
task :generate do
205-
require 'json'
206-
require 'faker'
207-
208-
ids = (1..25).to_a
209-
child_ids = (50..100).to_a
210-
child_counts = (10..25).to_a
211-
hash = ids.inject({'parents' => []}) do |hash, parent_id|
212-
child_count = child_counts.sample
213-
children = (0..child_count).collect do
214-
{'name' => Faker::Name.name, 'childID' => child_ids.sample}
215-
end
216-
parent = {'parentID' => parent_id, 'name' => Faker::Name.name, 'children' => children}
217-
hash['parents'] << parent
218-
hash
219-
end
220-
File.open('payload.json', 'w+') { |f| f << hash.to_json }
221-
puts "Generated payload at: payload.json"
222-
end
223-
end
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0450"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "NO"
13+
buildForArchiving = "NO"
14+
buildForAnalyzing = "NO">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "25160E77145651060060A5C5"
18+
BuildableName = "RestKitFrameworkTests.octest"
19+
BlueprintName = "RestKitFrameworkTests"
20+
ReferencedContainer = "container:RestKit.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28+
shouldUseLaunchSchemeArgsEnv = "YES"
29+
buildConfiguration = "Debug">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "25160E77145651060060A5C5"
36+
BuildableName = "RestKitFrameworkTests.octest"
37+
BlueprintName = "RestKitFrameworkTests"
38+
ReferencedContainer = "container:RestKit.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
</TestAction>
43+
<LaunchAction
44+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
45+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
46+
launchStyle = "0"
47+
useCustomWorkingDirectory = "NO"
48+
buildConfiguration = "Debug"
49+
ignoresPersistentStateOnLaunch = "NO"
50+
debugDocumentVersioning = "YES"
51+
allowLocationSimulation = "YES">
52+
<AdditionalOptions>
53+
</AdditionalOptions>
54+
</LaunchAction>
55+
<ProfileAction
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
buildConfiguration = "Release"
60+
debugDocumentVersioning = "YES">
61+
</ProfileAction>
62+
<AnalyzeAction
63+
buildConfiguration = "Debug">
64+
</AnalyzeAction>
65+
<ArchiveAction
66+
buildConfiguration = "Release"
67+
revealArchiveInOrganizer = "YES">
68+
</ArchiveAction>
69+
</Scheme>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "0450"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "NO"
13+
buildForArchiving = "NO"
14+
buildForAnalyzing = "NO">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "25160D2514564E820060A5C5"
18+
BuildableName = "RestKitTests.octest"
19+
BlueprintName = "RestKitTests"
20+
ReferencedContainer = "container:RestKit.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
27+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
28+
shouldUseLaunchSchemeArgsEnv = "YES"
29+
buildConfiguration = "Debug">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "25160D2514564E820060A5C5"
36+
BuildableName = "RestKitTests.octest"
37+
BlueprintName = "RestKitTests"
38+
ReferencedContainer = "container:RestKit.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
</TestAction>
43+
<LaunchAction
44+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
45+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
46+
launchStyle = "0"
47+
useCustomWorkingDirectory = "NO"
48+
buildConfiguration = "Debug"
49+
ignoresPersistentStateOnLaunch = "NO"
50+
debugDocumentVersioning = "YES"
51+
allowLocationSimulation = "YES">
52+
<AdditionalOptions>
53+
</AdditionalOptions>
54+
</LaunchAction>
55+
<ProfileAction
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
buildConfiguration = "Release"
60+
debugDocumentVersioning = "YES">
61+
</ProfileAction>
62+
<AnalyzeAction
63+
buildConfiguration = "Debug">
64+
</AnalyzeAction>
65+
<ArchiveAction
66+
buildConfiguration = "Release"
67+
revealArchiveInOrganizer = "YES">
68+
</ArchiveAction>
69+
</Scheme>

0 commit comments

Comments
 (0)