/rakelib/spec.rake
Unknown | 51 lines | 40 code | 11 blank | 0 comment | 0 complexity | 4bf13723cace7a88ff7c15ebe7f391bc MD5 | raw file
Possible License(s): LGPL-2.1
1# Rake tasks that run the specs. 2 3namespace :spec do 4 5 # NOTE: "-t m" handled in $MAGLEV_HOME/default.mspec 6 # Running all of the specs in one VM requires bigger tmp obj size 7 PSPEC = %{MAGLEV_OPTS="--tocsz 1000000 $MAGLEV_OPTS" #{ENV['MAGLEV_HOME']}/spec/mspec/bin/mspec } 8 9 desc "Run one rubyspec file: rake spec:run[spec/rubyspec/.../foo_spec.rb]" 10 task :run, :spec do |t, args| 11 check_spec_file(args.spec) 12 sh "#{PSPEC} -V #{args.spec}" 13 end 14 15 desc "Run ci specs: there should be NO failures and NO errors." 16 task :ci do 17 rm_f "rubyspec_temp/*" 18 sh "#{PSPEC} -V -G fails" 19 end 20 21 desc "Run ci specs, generating a rubyspec_report.xml with JUnit output." 22 task :ci_report do 23 rm_f "rubyspec_temp/*" 24 sh "#{PSPEC} -f j -V -G fails 2>&1 | tee rubyspec_report.out" 25 sh 'csplit rubyspec_report.out "%<?xml%" "/</testsuites/+1"' 26 sh "mv xx00 rubyspec_report.xml" 27 sh "rm xx01 rubyspec_report.out" 28 end 29 30 desc "Retag the ci files (works only with hacked mspec-tag.rb)" 31 task :retag do 32 sh "#{PSPEC} tag -G fails" 33 end 34 35 desc "Run failing specs and untag ones that now pass (works only with hacked mspec-tag.rb)" 36 task :untag do 37 sh "#{PSPEC} tag --del fails" 38 end 39 40 desc "Run the named specs and tag the failing ones" 41 task :tag, :file do |t, args| 42 sh "#{PSPEC} tag -G fails #{args.file}" 43 end 44 45 def check_spec_file(f) 46 raise "No spec defined with: spec=..." unless f 47 raise "Can't find file #{f}" unless File.exists? f 48 end 49 50end 51