Renew CI benchmark suite

This commit is contained in:
Takashi Kokubun 2015-11-15 00:20:16 -06:00
parent a327b100d6
commit b3b7db59b5
14 changed files with 38 additions and 47 deletions

View File

@ -4,7 +4,3 @@
%input{ disabled: disabled } %input{ disabled: disabled }
- disabled = true - disabled = true
%input{ disabled: disabled } %input{ disabled: disabled }
- hash = { disabled: false }
%input{ hash }
- hash = { disabled: true }
%input{ hash }

View File

@ -1,11 +1,5 @@
%div{ class: 'content active' }
- c = %w[content active]
%div{ class: c }
- hash = { class: %w[content active] }
%div{ hash }
.book{ class: 'content active' } .book{ class: 'content active' }
- c = %w[content active] .book(class='content active')
.book{ class: c }
- hash = { class: %w[content active] } - klass = %w[content active]
.book{ hash } .book{ class: klass }

View File

@ -1,5 +1,3 @@
%a{ href: '&"\'<>' } %a{ href: '&"\'<>' }
- href = '&"\'<>' - href = '&"\'<>'
%a{ href: href } %a{ href: href }
- hash = { href: '&"\'<>' }
%a{ hash }

View File

@ -1,6 +1,4 @@
%div{ data: { disabled: false } }
%div{ data: { disabled: true } } %div{ data: { disabled: true } }
- hash = { data: { disabled: true } } - hash = { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 }
%div{ hash } %div{ data: hash } data
- hash = { 'user' => { id: 1234, name: 'eagletmt' }, book_id: 5432 }
%div{ data: hash }
Book

View File

@ -0,0 +1,4 @@
- hash = { disabled: false }
%input{ hash }
- hash = { disabled: true }
%input{ hash }

View File

@ -0,0 +1,4 @@
- hash = { class: %w[content active] }
.book{ hash }
- arr = %w[foo bar]
.book(class=arr){ hash }

View File

@ -0,0 +1,2 @@
- hash = { href: '&"\'<>' }
%a{ hash }

View File

@ -0,0 +1,2 @@
- hash = { data: { 'user' => { id: 1234, name: 'k0kubun' }, book_id: 5432 } }
%div{ hash } data

View File

@ -0,0 +1,2 @@
- hash = { id: %w[content active] }
#book{ hash }

View File

@ -1,11 +1,3 @@
%div{ id: 'content active' }
- i = %w[content active]
%div{ id: i }
- hash = { id: %w[content active] }
%div{ hash }
#book{ id: 'content active' } #book{ id: 'content active' }
- c = %w[content active] - id = %w[content active]
#book{ id: c } #book{ id: id }
- hash = { id: %w[content active] }
#book{ hash }

View File

@ -10,10 +10,9 @@ require 'hamlit1' if File.exist?('hamlit1')
class Bench < Thor class Bench < Thor
desc 'bench HAML', 'Benchmark haml template' desc 'bench HAML', 'Benchmark haml template'
option :show_code, type: :boolean, aliases: ['-c'] option :show_code, type: :boolean, aliases: ['-c']
def bench(file) def bench(*files)
compile(file) files.each { |file| render(file) }
render(file) files.each { |file| code(file) if options[:show_code] }
code(file) if options[:show_code]
end end
desc 'compile HAML', 'Benchmark compilation' desc 'compile HAML', 'Benchmark compilation'

View File

@ -6,23 +6,23 @@ build:
name: clone hamlit1 name: clone hamlit1
code: bin/clone code: bin/clone
- script: - script:
name: attribute_builder.haml name: "[benchmark] static attributes"
code: bin/bench bench -c benchmark/attribute_builder.haml code: bin/bench bench benchmark/boolean_attribute.haml benchmark/class_attribute.haml benchmark/id_attribute.haml benchmark/data_attribute.haml benchmark/common_attribute.haml
- script: - script:
name: basic.haml name: "[benchmark] dynamic attributes"
code: bin/bench bench -c benchmark/basic.haml code: bin/bench bench benchmark/dynamic_attributes/boolean_attribute.haml benchmark/dynamic_attributes/class_attribute.haml benchmark/dynamic_attributes/id_attribute.haml benchmark/dynamic_attributes/data_attribute.haml benchmark/dynamic_attributes/common_attribute.haml
- script: - script:
name: old_attributes.haml name: "[benchmark] plain text"
code: bin/bench bench -c benchmark/old_attributes.haml code: bin/bench bench benchmark/plain.haml
- script: - script:
name: plain.haml name: "[benchmark] script"
code: bin/bench bench -c benchmark/plain.haml code: bin/bench bench benchmark/script.haml
- script: - script:
name: real_sample.haml name: "[benchmark] attribute_builder bench by faml"
code: bin/bench bench -c benchmark/real_sample.haml code: bin/bench bench benchmark/etc/attribute_builder.haml
- script: - script:
name: tags.haml name: "[benchmark] basic bench by slim"
code: bin/bench bench -c benchmark/tags.haml code: bin/bench bench benchmark/etc/slim_bench.haml
- script: - script:
name: minitest name: minitest
code: bundle exec rake test code: bundle exec rake test