blob: 04aaff73885730425ecd4f14ee59ca8aa0127089 [file] [log] [blame]
Kevin Clark5a7103a2008-06-18 00:55:11 +00001require 'rubygems'
2require 'rake'
3require 'spec/rake/spectask'
4
Kevin Clarkc2a07b12008-06-18 00:57:06 +00005task :default => [:spec, :test]
Kevin Clark5a7103a2008-06-18 00:55:11 +00006
7Spec::Rake::SpecTask.new("spec") do |t|
8 t.spec_files = FileList['spec/**/*_spec.rb']
9 t.spec_opts = ['--color']
10end
Kevin Clarkc2a07b12008-06-18 00:57:06 +000011
Kevin Clarkeb0dd7f2008-06-18 01:12:15 +000012Spec::Rake::SpecTask.new("rcov_spec") do |t|
13 t.spec_files = FileList['spec/**/*_spec.rb']
14 t.spec_opts = ['--color']
15 t.rcov = true
16 t.rcov_opts = ['--exclude', '^spec,/gems/']
17end
18
Kevin Clarkc2a07b12008-06-18 00:57:06 +000019task :test do
Kevin Clarka7613dd2008-06-18 01:13:48 +000020 sh 'make', '-C', File.dirname(__FILE__) + "/../../test/rb"
21end
22
Kevin Clarkca8a1b32008-06-18 01:17:06 +000023desc 'Compile the .thrift files for the specs'
24task :'gen-rb' => [:'gen-rb-spec', :'gen-rb-benchmark']
25
26THRIFT = '../../compiler/cpp/thrift'
27
28task :'gen-rb-spec' do
Kevin Clarka7613dd2008-06-18 01:13:48 +000029 dir = File.dirname(__FILE__) + '/spec'
Kevin Clarkca8a1b32008-06-18 01:17:06 +000030 sh THRIFT, '--gen', 'rb', '-o', dir, "#{dir}/ThriftSpec.thrift"
31end
32
33task :'gen-rb-benchmark' do
34 dir = File.dirname(__FILE__) + '/benchmark'
35 sh THRIFT, '--gen', 'rb', '-o', dir, "#{dir}/Benchmark.thrift"
36end
37
38desc 'Run benchmarking of NonblockingServer'
39task :benchmark do
40 ruby 'benchmark/fairness.rb'
Kevin Clarkc2a07b12008-06-18 00:57:06 +000041end