Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 135 lines (112 sloc) 3.742 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
namespace :spec do
  MACRUBY_MSPEC = "./spec/macruby.mspec"
  DEFAULT_OPTIONS = "-B #{MACRUBY_MSPEC}"
  
  def mspec(type, options, env = nil)
    rm_rf 'rubyspec_temp'
    sh "#{"env '#{env}' " if env}./mspec/bin/mspec #{type} #{DEFAULT_OPTIONS} #{ENV['opts']} #{options}"
  end
  
  desc "Run all continuous integration examples (all known good examples)"
  task :ci do
    mspec :ci, ":full"
  end
  
  namespace :ci do
     desc "Run all continuous integration examples and report the stats (all known good examples)"
     task :stats do
       mspec :ci, ":full -f macruby"
     end
  end
  
  desc "Run continuous integration language examples (all known good examples) (32 bit mode)"
  task :ci32 do
    sh "/usr/bin/arch -arch i386 ./miniruby ./mspec/bin/mspec-ci #{DEFAULT_OPTIONS} :full"
  end
  
  desc "Run all MacRuby-only specs"
  task :macruby do
    mspec :ci, ":macruby"
  end

  desc "Run all RubySpec-only specs"
  task :rubyspec do
    mspec :ci, ":rubyspec"
  end

  desc "Run all Language-only specs"
  task :language do
    mspec :ci, ":language"
  end

  desc "Run all Core-only specs"
  task :core do
    mspec :ci, ":core"
  end

  desc "Run all Library-only specs"
  task :library do
    mspec :ci, ":library"
  end
  
  desc "Run the DietRB specs"
  task :irb do
    mspec :ci, ":irb"
  end
  
  desc "Run language examples that are known to fail"
  task :fails do
    mspec :run, "-g fails :full"
  end
  
  namespace :fails do
    task :verbose do
      desc "Run language examples that are known to fail with spec and verbose output"
      task :fails do
        mspec :run, "-V -f s -g fails :full"
      end
    end
  end
  
  namespace :tag do
    desc "Removed fail tags for examples which actually pass."
    task :remove do
      mspec :tag, "-g fails --del fails :full"
    end
    
    desc "Add fails tags for examples which fail."
    task :add do
      mspec :tag, "-G critical -G fails :full"
    end
  end
  
  desc "Run all continuous integration examples (all known good examples) (1.9)"
  task :"1.9" => "spec:1.9:ci"
  
  namespace :"1.9" do
    desc "Run all continuous integration examples (all known good examples) (1.9)"
    task :ci do
      mspec :ci, ":rubyspec", "RUN_WITH_MRI_19=true"
    end
    
    desc "Run all Language-only specs (1.9)"
    task :language do
      mspec :ci, ":language", "RUN_WITH_MRI_19=true"
    end
    
    desc "Run all Core-only specs (1.9)"
    task :core do
      mspec :ci, ":core", "RUN_WITH_MRI_19=true"
    end
    
    desc "Run all Library-only specs (1.9)"
    task :library do
      mspec :ci, ":library", "RUN_WITH_MRI_19=true"
    end
    
    desc "Run language examples that are known to fail (1.9)"
    task :fails do
      mspec :run, "-g fails :rubyspec", "RUN_WITH_MRI_19=true"
    end
    
    desc "Run all continuous integration examples and report the stats (all known good examples) (1.9)"
    task :stats do
      mspec :ci, ":rubyspec -f macruby", "RUN_WITH_MRI_19=true"
    end
  end
  
  %w{ fails critical }.each do |tag|
    namespace :list do
      # We cheat by using the fact that currently the ruby.1.9.mspec script uses the macruby tags,
      # otherwise macruby fails halfway because apperantly the spec files are loaded when listing tagged specs...
      desc "List all specs that are tagged as `#{tag}'"
      task tag do
        sh "./mspec/bin/mspec tag --list #{tag} -B ./spec/frozen/ruby.1.9.mspec :full"
      end
    end
    
    namespace :"1.9" do
      desc "Run roxor language specs tagged `#{tag}' against Ruby 1.9 (use this to look for possible 1.8/1.9 incompatibility bugs)"
      task tag do
        sh "./mspec/bin/mspec run -g #{tag} -B ./spec/frozen/ruby.1.9.mspec :full"
      end
    end
  end
end
Something went wrong with that request. Please try again.