mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-09 09:40:15 +08:00
[test] Add rake spec:all task which runs the tests against all iOS SDKs.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user