aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-06-13 00:21:03 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2008-06-14 02:04:38 -0700
commiteab71208db1afead6803501c8d51d77625e5ad6e (patch)
tree194e4911a90e5edf7af4c3c2990d6c0ad3645791 /railties/lib
parentba0f38f89e8473490270957849d7d5b06f6ee65b (diff)
downloadrails-eab71208db1afead6803501c8d51d77625e5ad6e.tar.gz
rails-eab71208db1afead6803501c8d51d77625e5ad6e.tar.bz2
rails-eab71208db1afead6803501c8d51d77625e5ad6e.zip
Performance: integration test benchmarking and profiling. [Jeremy Kemper]
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails_generator/generators/applications/app/app_generator.rb2
-rw-r--r--railties/lib/tasks/testing.rake15
2 files changed, 17 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
index 2f2dd82682..d31ab5bb49 100644
--- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb
+++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -51,6 +51,7 @@ class AppGenerator < Rails::Generator::Base
m.template "helpers/application.rb", "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest }
m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb"
m.template "helpers/test_helper.rb", "test/test_helper.rb"
+ m.template "helpers/performance_test.rb", "test/performance/browsing_test.rb"
# database.yml and routes.rb
m.template "configs/databases/#{options[:db]}.yml", "config/database.yml", :assigns => {
@@ -155,6 +156,7 @@ class AppGenerator < Rails::Generator::Base
test/fixtures
test/functional
test/integration
+ test/performance
test/unit
vendor
vendor/plugins
diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake
index cc2376cbb3..2cadcd55fa 100644
--- a/railties/lib/tasks/testing.rake
+++ b/railties/lib/tasks/testing.rake
@@ -103,6 +103,21 @@ namespace :test do
end
Rake::Task['test:integration'].comment = "Run the integration tests in test/integration"
+ Rake::TestTask.new(:benchmark) do |t|
+ t.libs << 'test'
+ t.pattern = 'test/performance/**/*_test.rb'
+ t.verbose = true
+ t.options = '-- --benchmark'
+ end
+ Rake::Task['test:benchmark'].comment = 'Benchmark the performance tests'
+
+ Rake::TestTask.new(:profile) do |t|
+ t.libs << 'test'
+ t.pattern = 'test/performance/**/*_test.rb'
+ t.verbose = true
+ end
+ Rake::Task['test:profile'].comment = 'Profile the performance tests'
+
Rake::TestTask.new(:plugins => :environment) do |t|
t.libs << "test"