Cleanup test rake tasks

This commit is contained in:
Takashi Kokubun 2015-11-26 01:02:11 +09:00
parent b3a615f10a
commit 514c01bcb1
2 changed files with 23 additions and 25 deletions

View File

@ -1,13 +1,6 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
begin
origin, $stdout = $stdout, StringIO.new
Bundler.require
ensure
$stdout = origin
end
Dir['benchmark/*.rake'].each { |b| import(b) }
namespace :haml do
@ -29,26 +22,25 @@ namespace :hamlit do
t.verbose = true
end
end
task default: 'hamlit:test'
Rake::TestTask.new do |t|
t.libs << 'lib' << 'test'
files = Dir['test/hamlit/**/*_test.rb']
files += Dir['test/haml/*_test.rb']
files << 'test/haml/haml-spec/*_test.rb'
t.ruby_opts = %w[-rtest_helper]
t.test_files = files
t.verbose = true
end
Rake::TestTask.new(:spec) do |t|
t.libs << 'lib' << 'test'
t.ruby_opts = %w[-rtest_helper]
t.test_files = %w[test/haml/haml-spec/ugly_test.rb test/haml/haml-spec/pretty_test.rb]
t.verbose = true
end
namespace :test do
Rake::TestTask.new(:all) do |t|
t.libs << 'lib' << 'test'
files = Dir['test/hamlit/**/*_test.rb']
files += Dir['test/haml/*_test.rb']
files << 'test/haml/haml-spec/*_test.rb'
t.ruby_opts = %w[-rtest_helper]
t.test_files = files
t.verbose = true
end
Rake::TestTask.new(:spec) do |t|
t.libs << 'lib' << 'test'
t.ruby_opts = %w[-rtest_helper]
t.test_files = %w[test/haml/haml-spec/ugly_test.rb test/haml/haml-spec/pretty_test.rb]
t.verbose = true
end
Rake::TestTask.new(:engine) do |t|
t.libs << 'lib' << 'test'
t.ruby_opts = %w[-rtest_helper]
@ -77,3 +69,6 @@ namespace :test do
t.verbose = true
end
end
task default: %w[hamlit:test]
task test: %w[test:all]

View File

@ -12,6 +12,9 @@ build:
- script:
name: clone hamlit1
code: bin/clone
- script:
name: test all
code: bundle exec rake test
- script:
name: "[benchmark] static attributes"
code: bin/bench bench -t benchmark/boolean_attribute.haml benchmark/class_attribute.haml benchmark/id_attribute.haml benchmark/data_attribute.haml benchmark/common_attribute.haml