[test] Add rake spec:all task which runs the tests against all iOS SDKs.

This commit is contained in:
Eloy Durán
2013-12-13 00:41:01 +01:00
parent c6bc81459a
commit 9778e48abb

View File

@@ -9,4 +9,29 @@ Motion::Project::App.setup do |app|
app.name = 'test'
app.frameworks += ['AddressBook', 'AddressBookUI', 'CoreData', 'CoreMIDI', 'GameKit']
app.vendor_project('vendor/code', :static)
app.deployment_target = ENV['deployment_target'] if ENV['deployment_target']
end
namespace :spec do
desc "Run tests on all available iOS SDKs"
task :all do
sdk_versions = Dir.glob(File.join(App.config.platforms_dir, "#{App.config.deploy_platform}.platform/Developer/SDKs/#{App.config.deploy_platform}*.sdk")).map do |path|
File.basename(path).scan(/#{App.config.deploy_platform}(.*)\.sdk/)[0][0]
end
counter = 0
sdk_versions.each do |sdk_version|
App.info "Info", "Running specs on iOS #{sdk_version} SDK."
#sh "rake clean"
begin
sh "rake spec deployment_target=#{sdk_version}"
rescue RuntimeError
counter += $?.exitstatus
end
end
if counter > 0
App.info "Failed", "A total of #{counter} failures occurred."
exit counter
end
end
end