edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/context.rb;C495898
File: context.rb
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/context.rb;C495898  (server)    7/16/2008 3:31 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/context.rb;rubyspec3
@@ -2,7 +2,7 @@
 require 'fileutils'
 
 ENV['HOME'] ||= ENV['USERPROFILE']
-SVN_ROOT = Pathname.new 'c:/svn/trunk' 
+SVN_ROOT = Pathname.new 'c:/svn/trunk'
 DEFAULT_ROBOCOPY_OPTIONS = "/XF *#{EXCLUDED_EXTENSIONS.join(' *')} /NP /COPY:DAT /A-:R "
 
 class String
@@ -82,7 +82,7 @@
         b.call
       elsif args.length == 1
         args.first
-      else 
+      else
         raise 'framework_path must be called with either a path or a block that defines a path'
       end << nil)
     end
@@ -141,7 +141,7 @@
     references 'System.dll'
   }
   group(:desktop, :common) {
-    references 'System.Configuration.dll' 
+    references 'System.Configuration.dll'
   }
   group(:silverlight, :common) {
     switches :all, 'define:SILVERLIGHT', 'nostdlib+', 'platform:AnyCPU'
@@ -149,7 +149,7 @@
   }
   if ENV['mono'].nil?
     group(:desktop) {
-      framework_path [Pathname.new(ENV['windir'].dup) + 'Microsoft.NET/Framework/v2.0.50727', 
+      framework_path [Pathname.new(ENV['windir'].dup) + 'Microsoft.NET/Framework/v2.0.50727',
                       Pathname.new('c:\program files\reference assemblies\microsoft\framework\v3.5')]
     }
     group(:silverlight) {
@@ -299,12 +299,12 @@
     end
 
     # Source transformation related methods
-    
+
     def diff_directories(temp_dir)
       source_dirs, target_dirs = [], []
 
       nodes = [:root, :gppg, :dlr_core, :dlr_libs, :ironruby, :libraries, :tests, :console, :generator, :test_runner, :scanner, :yaml, :libs]
-      nodes.each do |node| 
+      nodes.each do |node|
         if is_recursive? node
           source_dirs += (temp_dir + get_relative_target_dir(node)).filtered_subdirs.map { |d| d.relative_path_from(temp_dir).downcase }
 
@@ -339,7 +339,7 @@
       dest = @project_context.target
 
       rake_output_message "Adding new directories to target source control\n"
-      added.each do |dir| 
+      added.each do |dir|
         copy_dir(temp_dir + dir, dest + dir)
         add(dest + dir)
       end
@@ -383,8 +383,8 @@
     # Compiler-related methods
 
     def resgen(base_path, resource_map)
-      resource_map.each_pair do |input, output| 
-        exec "resgen \"#{base_path + input.dup}\" \"#{build_path + output}\"" 
+      resource_map.each_pair do |input, output|
+        exec "resgen \"#{base_path + input.dup}\" \"#{build_path + output}\""
       end
     end
 
@@ -419,7 +419,7 @@
     def references(refs, working_dir)
       references = Configuration.get_references(clr)
       refs.each do |ref|
-        references << if ref =~ /^\!/ 
+        references << if ref =~ /^\!/
           resolve_framework_path(ref[1..ref.length])
         else
           (build_path + ref).relative_path_from(working_dir)
@@ -432,7 +432,7 @@
       cs_proj_files = Dir['*.csproj']
       if cs_proj_files.length == 1
         doc = REXML::Document.new(File.open(cs_proj_files.first))
-        result = doc.elements.collect("/Project/ItemGroup/Compile") { |c| "\"#{c.attributes['Include']}\"" }        
+        result = doc.elements.collect("/Project/ItemGroup/Compile") { |c| "\"#{c.attributes['Include']}\"" }
         result.delete_if { |e| e =~ /Silverlight\\SilverlightVersion.cs/ }
         result
       else
@@ -451,7 +451,7 @@
         cs_args += args[:switches] unless args[:switches].nil?
 
         unless args[:resources].nil?
-          resgen working_dir, args[:resources] 
+          resgen working_dir, args[:resources]
           args[:resources].each_value { |res| cs_args << "resource:\"#{build_path + res}\"" }
         end
 
@@ -466,19 +466,19 @@
     end
 
     # Project transformation methods
-    
+
     def replace_output_path(contents, old, new)
       contents.gsub! Regexp.new(Regexp.escape("<OutputPath>#{old}</OutputPath>"), Regexp::IGNORECASE), "<OutputPath>#{new}</OutputPath>"
     end
-    
+
     def replace_doc_path(contents, old, new)
       contents.gsub! Regexp.new(Regexp.escape("<DocumentationFile>#{old}</DocumentationFile>"), Regexp::IGNORECASE), "<DocumentationFile>#{new}</DocumentationFile>"
     end
-    
+
     def replace_key_path(contents, old, new)
       contents.gsub! Regexp.new(Regexp.escape("<AssemblyOriginatorKeyFile>#{old}</AssemblyOriginatorKeyFile>"), Regexp::IGNORECASE), "<AssemblyOriginatorKeyFile>#{new}</AssemblyOriginatorKeyFile>"
     end
-    
+
     def replace_import_project(contents, old, new)
       contents.gsub! Regexp.new(Regexp.escape("<Import Project=\"#{old}\" />"), Regexp::IGNORECASE), "<Import Project=\"#{new}\" />"
     end
@@ -527,14 +527,14 @@
   end
 
   # The Rakefile must always be found in the root directory of the source tree.
-  
-  # If ENV['MERLIN_ROOT'] is defined, then we know that we are running on 
+
+  # If ENV['MERLIN_ROOT'] is defined, then we know that we are running on
   # a machine with an enlistment in the MERLIN repository. This will enable
   # features that require a source context and a destination context (such as
   # pushing to / from MERLIN). Otherwise, destination context will always be
   # nil and we will throw on an attempt to do operations that require a
   # push.
-  
+
   private
   def self.init_context
     @rakefile_dir = Pathname.new(File.dirname(File.expand_path(__FILE__)).downcase)
@@ -549,7 +549,7 @@
       # on whether we are within MERLIN_ROOT or SVN_ROOT
       @merlin_root = Pathname.new(ENV['MERLIN_ROOT'].downcase) + '../../' # hack for changes in TFS layout
       @ruby_root = @merlin_root + 'merlin/main/languages/ruby'
-      
+
       if @rakefile_dir == @ruby_root
         @source = @merlin_root
         @target = SVN_ROOT
@@ -558,14 +558,14 @@
         @target = @merlin_root
       else
         raise <<-EOF
-          Rakefile is at #{@rakefile_dir}. This is neither the SVN_ROOT nor 
-          the MERLIN_ROOT. Possible causes of this are running from a 
+          Rakefile is at #{@rakefile_dir}. This is neither the SVN_ROOT nor
+          the MERLIN_ROOT. Possible causes of this are running from a
           non-MERLIN command prompt (where MERLIN_ROOT environment variable
           is defined) or if the SVN_ROOT constant in the Rakefile does not
           point to where you downloaded the SVN repository for IronRuby.
         EOF
       end
-    end  
+    end
 
     @map = {}
     @initialized = true
@@ -603,7 +603,7 @@
   def self.target_context(&b)
     if @target.nil?
       raise <<-EOF
-      Cannot invoke commands against target_context if you are not running in 
+      Cannot invoke commands against target_context if you are not running in
       a MERLIN_ROOT context. External folks should never see this error as they
       should never be running commands that require moving things between
       different contexts.
@@ -666,7 +666,7 @@
   end
 
   def regression(ruby, klass, method = nil)
-    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec ci -t #{ruby} -fm -V -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
+    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec ci -t #{ruby.join(" ")} -f summary -V -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
     cmd += "/#{method}_spec.rb" unless method.nil?
     cmd += " > #{tempdir}/out.txt"
     system cmd
@@ -674,64 +674,42 @@
       lines = f.readlines
       lines.each do |line|
         if SUMMARY_PARSER =~ line
-          m = SUMMARY_PARSER.match(line)
-          @files += m[1].to_i
-          @examples += m[2].to_i
-          @expectations += m[3].to_i
-          @failures += m[4].to_i
-          @errors += m[5].to_i
-          @summaries << "#{klass}: #{m[1].to_i} files, #{m[2].to_i} examples, #{m[3].to_i} expectations, #{m[4].to_i} failures, #{m[5].to_i} errors" 
+          @files += $1.to_i
+          @examples += $2.to_i
+          @expectations += $3.to_i
+          @failures += $4.to_i
+          @errors += $5.to_i
+          @summaries << "#{klass}: #{$1.to_i} files, #{$2.to_i} examples, #{$3.to_i} expectations, #{$4.to_i} failures, #{$5.to_i} errors"
         end
       end
     end
   end
 
-  def regression_all_core(ruby)
+  def all_core(method, ruby)
     Dir["#{UserEnvironment.rubyspec}/1.8/core/*"].each do |path|
       klass = File.basename(path)
-      regression ruby, klass
+      send method, ruby, klass
     end
   end
 
   def why_regression(ruby, klass, method = nil)
-    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec ci -t #{ruby} -fs -V -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
+    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec ci -t #{ruby.join(" ")} -f specdoc -V -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
     cmd += "/#{method}_spec.rb" unless method.nil?
     system cmd
   end
 
-  def why_regression_all_core(ruby)
-    Dir["#{UserEnvironment.rubyspec}/1.8/core/*"].each do |path|
-      klass = File.basename(path)
-      why_regression ruby, klass
-    end
-  end
-
   def test(ruby, klass, method = nil)
-    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec run -t #{ruby} -G critical -V -fs -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
+    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec run -t #{ruby.join(" ")} -G critical -V -f specdoc -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
     cmd += "/#{method}_spec.rb" unless method.nil?
     system cmd
   end
 
-  def test_all_core(ruby)
-    Dir["#{UserEnvironment::RUBYSPEC}/1.8/core/*"].each do |path|
-      klass = File.basename(path)
-      test ruby, klass
-    end
-  end
-
   def baseline(ruby, klass, method = nil)
-    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec tag -t #{ruby} -fs -V -G critical -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
+    cmd = "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec tag -t #{ruby.join(" ")} -f specdoc -V -G critical -B #{UserEnvironment.config} #{UserEnvironment.rubyspec}/1.8/core/#{klass}"
     cmd << "/#{method}_spec.rb" unless method.nil?
     system cmd
   end
 
-  def baseline_all_core(ruby)
-    Dir["#{UserEnvironment.rubyspec}/1.8/core/*"].each do |path|
-      klass = File.basename(path)
-      baseline ruby, klass
-    end
-  end
-
   def generate_critical_tags
     lines = []
     return unless File.exist? "#{UserEnvironment.tags}\\critical_tags.txt"
@@ -764,7 +742,7 @@
   # Find path to named executable
 
   def self.find_executable(executable)
-    executable.downcase!  
+    executable.downcase!
     result = []
     search_path = ENV['PATH'].split(';')
     search_path.each do |dir|
@@ -787,7 +765,7 @@
       raise NoMethodError.new("undefined method '#{name}' for #{self}", name, args)
     end
   end
-  
+
   def initialize
     path_to_config = ENV['HOME'] + '/.irconfig.rb'
     load path_to_config if File.exist? path_to_config
@@ -797,7 +775,7 @@
       if ruby_exe_paths.length == 1
         UserEnvironment.const_set(:MRI, Pathname.new(ruby_exe_paths.first + '\..\\'))
       else
-        raise ArgumentError.new("Found more than one version of ruby.exe on your path #{ruby_exe_paths.join(', ')}") 
+        raise ArgumentError.new("Found more than one version of ruby.exe on your path #{ruby_exe_paths.join(', ')}")
       end
     end
     UserEnvironment.const_set(:TAGS, "#{ENV['HOME']}\\dev\\ironruby-tags".gsub('\\', '/')) unless defined?(UserEnvironment::TAGS)
===================================================================
edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Rakefile;C495898
File: Rakefile
===================================================================
--- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Rakefile;C495898  (server)    7/16/2008 1:58 PM
+++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Rakefile;rubyspec3
@@ -175,7 +175,7 @@
 task :make_ir_cmd => [:clean_build] do
   ruby_exe_paths = UserEnvironment.find_executable 'ruby.exe'
 
-  if ruby_exe_paths.length == 1 
+  if ruby_exe_paths.length == 1
     if !IronRuby.is_merlin?
       IronRuby.source_context do
         lib_paths = []
@@ -299,24 +299,13 @@
 desc "Alias for mspec:core"
 task :mspec => "mspec:core"
 
-desc "Set ruby runner to CRuby"
-task :ruby do
-  begin
-    old_verbose,$VERBOSE = $VERBOSE,nil
-    $ruby_imp = UserEnvironment.mri
-    ARGV = [ARGV[0],*ARGV[2..-1]]
-  ensure
-    $VERBOSE = old_verbose
-  end
-end
-
 namespace :mspec do
   desc "Run RubySpec core suite"
-  task :core => ["mspec:ruby_imp", :testhappy] do
+  task :core => ["ruby_imp", :testhappy] do
     IronRuby.source_context { invoke_mspec($ruby_imp) }
     exit
   end
-  
+
   desc "Run core suite with both CRuby and Ironruby"
   task :dual => [:testhappy] do
     IronRuby.source_context do
@@ -329,20 +318,16 @@
   end
 
   desc "Run RubySpec language suite"
-  task :lang => ["mspec:ruby_imp", :testhappy] do
+  task :lang => ["ruby_imp", :testhappy] do
     IronRuby.source_context { invoke_mspec($ruby_imp, 'language')}
     exit
   end
-  
+
   desc "Run RubySpec library suite"
-  task :lib => ["mspec:ruby_imp", :testhappy] do
+  task :lib => ["ruby_imp", :testhappy] do
     IronRuby.source_context { invoke_mspec($ruby_imp, 'library')}
     exit
   end
-  
-  task :ruby_imp do
-    IronRuby.source_context {$ruby_imp ||= path_to_ir}
-  end
 end
 
 def list_specs(klass)
@@ -380,18 +365,18 @@
    when 'fail'
      '-f fail'
    when 'cov'
-     ['-f coverage','run']
+     ['-f coverage','run -G critical']
    when 'tag'
-     ['-f dotted','tag']
+     ['-f dotted','tag -G critical']
    when 'run'
-     ['-f dotted','run']
+     ['-f dotted','run -G critical']
    else
      '-f dotted'
    end
 end
 
 def invoke_mspec(path_to_ruby, root_path = "core")
-  unless root_path == "language"  
+  unless root_path == "language"
     klass, name, reporter = split_args
   else
     name, reporter, _ = split_args
@@ -405,7 +390,7 @@
     reporter,tag  = extract_reporter(reporter)
 
     chdir(get_source_dir(:tests) +'util'){
-      cmd =  "ruby #{UserEnvironment.mspec}/bin/mspec #{tag || 'ci'} -t #{path_to_ruby} -B #{UserEnvironment.config} #{run_spec} #{reporter}"
+      cmd =  "#{UserEnvironment.mri} #{UserEnvironment.mspec}/bin/mspec #{tag || 'ci'} -t #{path_to_ruby.join(" ")} -B #{UserEnvironment.config} #{run_spec} #{reporter}"
       exec_net cmd
     }
   end
@@ -562,18 +547,18 @@
 end
 
 # New mspec tasks for developers - these set a new regression baseline, run the
-# regression tests, reports why a regression test failed, and test a specific class 
+# regression tests, reports why a regression test failed, and test a specific class
 # while ignoring exclusions.
 
-def run_specs(method_name) 
+def run_specs(method_name)
   ARGV.delete_at 0
   runner = MSpecRunner.new
 
   IronRuby.source_context do
-    iruby = "#{path_to_ir}"  # TODO: enable interpreter for all tests
+    iruby = $ruby_imp
 
     if ARGV.length == 0
-      runner.send(:"#{method_name}_all_core", iruby)
+      runner.all_core(method_name, iruby)
     elsif ARGV.length == 1
       runner.send(:"#{method_name}", iruby, ARGV.first)
     elsif ARGV.length == 2
@@ -605,34 +590,62 @@
 end
 
 desc "generate new baseline against a class"
-task :baseline => [:testhappy] do
+task :baseline => [:testhappy, :ruby_imp] do
   run_specs(:baseline)
   exit
 end
 
 desc "run specs against a class, ignoring all exclusions"
-task :test => [:testhappy] do
+task :test => [:testhappy, :ruby_imp] do
   run_specs :test
   exit
 end
 
 desc "show report of why a regression test failed"
-task :why_regression => [:testhappy] do
+task :why_regression => [:testhappy, :ruby_imp] do
   run_specs :why_regression
   exit
 end
 
 desc "run regression tests using mspec"
-task :regression => [:testhappy] do
+task :regression => [:testhappy, :ruby_imp] do
   run_specs(:regression).report
   exit
 end
 
 desc "regenerate critical tags"
-task :regen_tags => :testhappy do
+task :regen_tags => [:testhappy] do
   IronRuby.source_context { MSpecRunner.new.generate_critical_tags }
 end
 
+desc "Set ruby runner to CRuby"
+task :ruby do
+  begin
+    old_verbose,$VERBOSE = $VERBOSE,nil
+    $ruby_imp = [UserEnvironment.mri]
+    ARGV = [ARGV[0],*ARGV[2..-1]]
+  ensure
+    $VERBOSE = old_verbose
+  end
+end
+
+task :ruby_imp do
+  IronRuby.source_context do
+    $ruby_imp ||= [path_to_ir, '-T "-X:Interpret"']
+  end
+end
+
+desc "Run PEVerify on the generated IL"
+task :peverify do
+  begin
+    old_verbose, $VERBOSE = $VERBOSE, nil
+    IronRuby.source_context {$ruby_imp ||= [path_to_ir, '-T "-X:SaveAssemblies"'] }
+    ARGV = [ARGV[0], *ARGV[2..-1]]
+  ensure
+    $VERBOSE = old_verbose
+  end
+end
+
 task :default => [:happy] do
   Rake.application.options.show_tasks = true
   Rake.application.options.show_task_pattern = Regexp.new('.')
===================================================================
