-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathRakefile
More file actions
42 lines (31 loc) · 802 Bytes
/
Copy pathRakefile
File metadata and controls
42 lines (31 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Adapted from AFNetworking rakefile
include FileUtils::Verbose
namespace :test do
task :install do
sh("brew update && brew upgrade xctool") rescue nil
end
task :iOS do
run_tests('iOS Tests', 'iphonesimulator')
tests_failed('iOS') unless $?.success?
end
task :OSX do
run_tests('OSX Tests', 'macosx')
tests_failed('OSX') unless $?.success?
end
end
task :test do
Rake::Task['test:iOS'].invoke
Rake::Task['test:OSX'].invoke
end
task :default => 'test'
private
def run_tests(scheme, sdk)
sh("xctool -project Tests/RZImportTests.xcodeproj -scheme '#{scheme}' -sdk '#{sdk}' clean test; exit $?") rescue nil
end
def tests_failed(platform)
puts red("#{platform} unit tests failed")
exit $?.exitstatus
end
def red(string)
"\033[0;31m! #{string}"
end