| Kevin Clark | 5a7103a | 2008-06-18 00:55:11 +0000 | [diff] [blame] | 1 | require 'rubygems' | 
|  | 2 | require 'rake' | 
|  | 3 | require 'spec/rake/spectask' | 
|  | 4 |  | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 5 | task :default => [:spec, :test] | 
| Kevin Clark | 5a7103a | 2008-06-18 00:55:11 +0000 | [diff] [blame] | 6 |  | 
|  | 7 | Spec::Rake::SpecTask.new("spec") do |t| | 
|  | 8 | t.spec_files = FileList['spec/**/*_spec.rb'] | 
|  | 9 | t.spec_opts = ['--color'] | 
|  | 10 | end | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 11 |  | 
| Kevin Clark | eb0dd7f | 2008-06-18 01:12:15 +0000 | [diff] [blame] | 12 | Spec::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/'] | 
|  | 17 | end | 
|  | 18 |  | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 19 | task :test do | 
| Kevin Clark | a7613dd | 2008-06-18 01:13:48 +0000 | [diff] [blame] | 20 | sh 'make', '-C', File.dirname(__FILE__) + "/../../test/rb" | 
|  | 21 | end | 
|  | 22 |  | 
| Kevin Clark | ca8a1b3 | 2008-06-18 01:17:06 +0000 | [diff] [blame] | 23 | desc 'Compile the .thrift files for the specs' | 
|  | 24 | task :'gen-rb' => [:'gen-rb-spec', :'gen-rb-benchmark'] | 
|  | 25 |  | 
|  | 26 | THRIFT = '../../compiler/cpp/thrift' | 
|  | 27 |  | 
|  | 28 | task :'gen-rb-spec' do | 
| Kevin Clark | a7613dd | 2008-06-18 01:13:48 +0000 | [diff] [blame] | 29 | dir = File.dirname(__FILE__) + '/spec' | 
| Kevin Clark | ca8a1b3 | 2008-06-18 01:17:06 +0000 | [diff] [blame] | 30 | sh THRIFT, '--gen', 'rb', '-o', dir, "#{dir}/ThriftSpec.thrift" | 
|  | 31 | end | 
|  | 32 |  | 
|  | 33 | task :'gen-rb-benchmark' do | 
|  | 34 | dir = File.dirname(__FILE__) + '/benchmark' | 
|  | 35 | sh THRIFT, '--gen', 'rb', '-o', dir, "#{dir}/Benchmark.thrift" | 
|  | 36 | end | 
|  | 37 |  | 
|  | 38 | desc 'Run benchmarking of NonblockingServer' | 
|  | 39 | task :benchmark do | 
| Kevin Clark | d3cee02 | 2008-06-18 01:19:09 +0000 | [diff] [blame] | 40 | ruby 'benchmark/benchmark.rb' | 
| Kevin Clark | c2a07b1 | 2008-06-18 00:57:06 +0000 | [diff] [blame] | 41 | end |