Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

76 lines (51 sloc) 1.553 kb
require 'rake'
require 'rake/testtask'
# Notes for cross compile:
# $ gcla ; bundle install ; rake compile ; rake cross compile ; rake cross native gem
def test_libs(mode='dblib')
['lib',
'test',
"#{ENV['RAILS_SOURCE']}/activerecord/test"]
end
def test_files
files = Dir.glob("test/cases/**/*_test_sqlserver.rb").sort
unless ENV['ACTIVERECORD_UNITTEST_SKIP']
ar_cases = Dir.glob("#{ENV['RAILS_SOURCE']}/activerecord/test/cases/**/*_test.rb")
adapter_cases = Dir.glob("#{ENV['RAILS_SOURCE']}/activerecord/test/cases/adapters/**/*_test.rb")
files += (ar_cases-adapter_cases).sort
end
files
end
task :test => ['test:dblib']
task :default => [:test]
namespace :test do
['dblib','odbc'].each do |mode|
Rake::TestTask.new(mode) do |t|
t.libs = test_libs(mode)
t.test_files = test_files
t.verbose = true
end
end
task 'dblib:env' do
ENV['ARCONN'] = 'dblib'
end
task 'odbc:env' do
ENV['ARCONN'] = 'odbc'
end
end
task 'test:dblib' => 'test:dblib:env'
task 'test:odbc' => 'test:odbc:env'
namespace :profile do
['dblib','odbc'].each do |mode|
namespace mode.to_sym do
Dir.glob("test/profile/*_profile_case.rb").sort.each do |test_file|
profile_case = File.basename(test_file).sub('_profile_case.rb','')
Rake::TestTask.new(profile_case) do |t|
t.libs = test_libs(mode)
t.test_files = [test_file]
t.verbose = true
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.