Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 78 lines (59 sloc) 1.845 kb
cb15709 @raggi Rakefiles are executables, and rake loads rake, not rakefile code
raggi authored
1 #!/usr/bin/env rake
db045db @dhh Initial
dhh authored
2 require 'rake/testtask'
3 require 'rake/packagetask'
79e9a29 @vijaydev fixes Rake::GemPackageTask deprecation warnings from rake 0.9.0
vijaydev authored
4 require 'rubygems/package_task'
db045db @dhh Initial
dhh authored
5
6 desc "Default Task"
a9f5f4b @josh Don't force test suite to use bundler
josh authored
7 task :default => :test
ddb4600 @wycats Get ActionPack's test running on bundled gems. This should make running ...
wycats authored
8
db045db @dhh Initial
dhh authored
9 # Run the unit tests
10
d8fffe7 @lifo Replace ad hoc Rack::Test with ActionController::IntegrationTest
lifo authored
11 desc "Run all unit tests"
d5cfc72 @josh Merge "test_new_base" runner into standard "test_action_pack"
josh authored
12 task :test => [:test_action_pack, :test_active_record_integration]
070f3fd @jeremy Clean up and run the Active Record integration tests by default.
jeremy authored
13
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
14 Rake::TestTask.new(:test_action_pack) do |t|
6d214c9 @josh Merge abstract_controller/test_helper and new_base/test_helper since the...
josh authored
15 t.libs << 'test'
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
16
17 # make sure we include the tests in alphabetical order as on some systems
18 # this will not happen automatically and the tests (as a whole) will error
75a2f00 @josh Move improved isolated test runner to AP
josh authored
19 t.test_files = Dir.glob('test/{abstract,controller,dispatch,template}/**/*_test.rb').sort
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
20
17599ab @miloops Enable warnings now that they can be readed.
miloops authored
21 t.warning = true
38f6533 @tenderlove argument error is done for us
tenderlove authored
22 t.verbose = true
c19c0e7 @jeremy Disable warnings in AP tests
jeremy authored
23 end
86fc43f ActionPack components should no longer have undeclared dependencies.
Yehuda Katz + Carl Lerche authored
24
75a2f00 @josh Move improved isolated test runner to AP
josh authored
25 namespace :test do
26 Rake::TestTask.new(:isolated) do |t|
27 t.pattern = 'test/ts_isolated.rb'
28 end
41bca5d @apotonick Add rake test:template.
apotonick authored
29
30 Rake::TestTask.new(:template) do |t|
31 t.libs << 'test'
32 t.pattern = 'test/template/**/*.rb'
33 end
fa5da8a @jeremy isolated_test task
jeremy authored
34 end
db045db @dhh Initial
dhh authored
35
d49a5fc @NZKoz * Fix pagination problems when using include
NZKoz authored
36 desc 'ActiveRecord Integration Tests'
37 Rake::TestTask.new(:test_active_record_integration) do |t|
6d214c9 @josh Merge abstract_controller/test_helper and new_base/test_helper since the...
josh authored
38 t.libs << 'test'
d49a5fc @NZKoz * Fix pagination problems when using include
NZKoz authored
39 t.test_files = Dir.glob("test/activerecord/*_test.rb")
40 end
41
f430d6b @josh Make gemspecs the authoritative source instead of generating them from t...
josh authored
42 spec = eval(File.read('actionpack.gemspec'))
43
79e9a29 @vijaydev fixes Rake::GemPackageTask deprecation warnings from rake 0.9.0
vijaydev authored
44 Gem::PackageTask.new(spec) do |p|
db045db @dhh Initial
dhh authored
45 p.gem_spec = spec
46 end
47
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
48 desc "Release to gemcutter"
459ecaf @jeremy Submarine the rake-gemcutter dep in Rakefiles
jeremy authored
49 task :release => :package do
50 require 'rake/gemcutter'
51 Rake::Gemcutter::Tasks.new(spec).define
52 Rake::Task['gem:push'].invoke
53 end
c1785f3 @jeremy Release using gemcutter gem:push tasks
jeremy authored
54
e0a2dab @dhh Added KLOC counter for AR and AP. Combined theyre at ~9KLOC
dhh authored
55 task :lines do
56 lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
57
58 for file_name in FileList["lib/**/*.rb"]
59 next if file_name =~ /vendor/
60 f = File.open(file_name)
61
62 while line = f.gets
63 lines += 1
64 next if line =~ /^\s*$/
65 next if line =~ /^\s*#/
66 codelines += 1
67 end
68 puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
6094e65 @josh We won't be publishing tars and zips anymore
josh authored
69
e0a2dab @dhh Added KLOC counter for AR and AP. Combined theyre at ~9KLOC
dhh authored
70 total_lines += lines
71 total_codelines += codelines
6094e65 @josh We won't be publishing tars and zips anymore
josh authored
72
e0a2dab @dhh Added KLOC counter for AR and AP. Combined theyre at ~9KLOC
dhh authored
73 lines, codelines = 0, 0
74 end
75
76 puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
b378b19 @spastorino Makes Rakefile activate rdoc >= 2.5.9
spastorino authored
77 end
Something went wrong with that request. Please try again.