Sha256: 9a187e6706e4825ff60509a78094ad1923c74d5342e4f29373784416d4f39c1f

Contents?: true

Size: 1.77 KB

Versions: 16

Compression:

Stored size: 1.77 KB

Contents

require 'bundler/gem_tasks'
require 'shellwords'

task :test do
  blank_loop = File.expand_path('./examples/yaml/blank_loop.yml', __dir__) # no warmup
  blank_hash = File.expand_path('./examples/yaml/blank_hash.yml', __dir__) # needs warmup
  {
    'ips' => 'compare',
    'time' => 'simple',
    'memory' => 'simple',
    'once' => 'markdown',
  }.each do |runner, output|
    Bundler.with_clean_env do
      sh ['time', 'bundle', 'exec', 'exe/benchmark-driver', blank_loop, '-r', runner, '-o', output].shelljoin
      puts
      sh ['time', 'bundle', 'exec', 'exe/benchmark-driver', blank_hash, '-r', runner, '-o', output, '--run-duration', '1'].shelljoin
      puts
    end
  end
end

task :test_record do
  blank_loop = File.expand_path('./examples/yaml/blank_loop.yml', __dir__) # no warmup
  sh ['time', 'bundle', 'exec', 'exe/benchmark-driver', blank_loop, '-r', 'ips', '-o', 'record'].shelljoin
  puts
  sh ['time', 'bundle', 'exec', 'exe/benchmark-driver', 'benchmark_driver.record.yml', '-o', 'compare'].shelljoin
  puts
  sh ['time', 'bundle', 'exec', 'exe/benchmark-driver', 'benchmark_driver.record.yml', '-o', 'record'].shelljoin
  puts
  sh ['time', 'bundle', 'exec', 'exe/benchmark-driver', 'benchmark_driver.record.yml', '-o', 'simple'].shelljoin
  puts
end

task :test_ruby do
  Dir.glob(File.expand_path('./examples/*.rb', __dir__)).sort.each do |file|
    Bundler.with_clean_env do
      sh ['time', 'bundle', 'exec', 'ruby', file].shelljoin
    end
    puts
  end
end

task :test_yaml do
  Dir.glob(File.expand_path('./examples/yaml/*.yml', __dir__)).sort.each do |file|
    Bundler.with_clean_env do
      sh ['time', 'bundle', 'exec', 'exe/benchmark-driver', file, '--run-duration', '1'].shelljoin
    end
    puts
  end
end

task default: [:test, :test_record, :test_ruby, :test_yaml]

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
benchmark_driver-0.10.16 Rakefile
benchmark_driver-0.10.15 Rakefile
benchmark_driver-0.10.14 Rakefile
benchmark_driver-0.10.13 Rakefile
benchmark_driver-0.10.12 Rakefile
benchmark_driver-0.10.11 Rakefile
benchmark_driver-0.10.10 Rakefile
benchmark_driver-0.10.9 Rakefile
benchmark_driver-0.10.8 Rakefile
benchmark_driver-0.10.7 Rakefile
benchmark_driver-0.10.6 Rakefile
benchmark_driver-0.10.5 Rakefile
benchmark_driver-0.10.4 Rakefile
benchmark_driver-0.10.3 Rakefile
benchmark_driver-0.10.2 Rakefile
benchmark_driver-0.10.1 Rakefile