[macruby-changes] [1782] MacRuby/branches/experimental/rakelib/spec.rake

source_changes at macosforge.org source_changes at macosforge.org
Sat Jun 6 07:25:32 PDT 2009


Revision: 1782
          http://trac.macosforge.org/projects/ruby/changeset/1782
Author:   eloy.de.enige at gmail.com
Date:     2009-06-06 07:25:32 -0700 (Sat, 06 Jun 2009)
Log Message:
-----------
Added a rake task which uses mspec-tag to remove fails tags for examples which pass. Still not confident that it actually works as it should, as I would have expected much more examples to pass.

Modified Paths:
--------------
    MacRuby/branches/experimental/rakelib/spec.rake

Modified: MacRuby/branches/experimental/rakelib/spec.rake
===================================================================
--- MacRuby/branches/experimental/rakelib/spec.rake	2009-06-06 14:25:25 UTC (rev 1781)
+++ MacRuby/branches/experimental/rakelib/spec.rake	2009-06-06 14:25:32 UTC (rev 1782)
@@ -70,6 +70,42 @@
     end
   end
   
+  namespace :tag do
+    desc "Removed fail tags for examples which actually pass. (FIXME)"
+    task :remove do
+      mspec :tag, "-g fails --del fails #{CI_DIRS}"
+    end
+    
+    desc "Tags failing examples in spec/core, specify the class to tag with the env variable `class'"
+    task :add do
+      klass = ENV['class']
+      puts "Tagging failing examples of class `#{klass}'"
+      
+      tag_base = "./spec/frozen/tags/macruby/core/#{klass}"
+      mkdir_p tag_base
+      
+      Dir.glob("./spec/frozen/core/#{klass}/*_spec.rb").each do |spec_file|
+        puts "Running spec: #{spec_file}"
+        cmd = "./mspec/bin/mspec ci -I./lib -f s -B ./spec/macruby.mspec #{spec_file}"
+        out = `#{cmd}`
+        
+        if out.match(/^1\)(.+?)(FAILED|ERROR)/m)
+          failures = $1.strip.split("\n")
+          
+          tag_file = "#{tag_base}/#{spec_file.match(/\/(\w+)_spec\.rb$/)[1]}_tags.txt"
+          puts "Writing tags file: #{tag_file}"
+          
+          File.open(tag_file, 'a+') do |f|
+            f << "\n" unless f.read.empty?
+            failures.each do |failure|
+              f << "fails:#{failure}\n"
+            end
+          end
+        end
+      end
+    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,
@@ -87,33 +123,4 @@
       end
     end
   end
-  
-  desc "Tags failing examples in spec/core, specify the class to tag with the env variable `class'"
-  task :tag_failing do
-    klass = ENV['class']
-    puts "Tagging failing examples of class `#{klass}'"
-    
-    tag_base = "./spec/frozen/tags/macruby/core/#{klass}"
-    mkdir_p tag_base
-    
-    Dir.glob("./spec/frozen/core/#{klass}/*_spec.rb").each do |spec_file|
-      puts "Running spec: #{spec_file}"
-      cmd = "./mspec/bin/mspec ci -I./lib -f s -B ./spec/macruby.mspec #{spec_file}"
-      out = `#{cmd}`
-      
-      if out.match(/^1\)(.+?)(FAILED|ERROR)/m)
-        failures = $1.strip.split("\n")
-        
-        tag_file = "#{tag_base}/#{spec_file.match(/\/(\w+)_spec\.rb$/)[1]}_tags.txt"
-        puts "Writing tags file: #{tag_file}"
-        
-        File.open(tag_file, 'a+') do |f|
-          f << "\n" unless f.read.empty?
-          failures.each do |failure|
-            f << "fails:#{failure}\n"
-          end
-        end
-      end
-    end
-  end
 end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090606/daba437d/attachment.html>


More information about the macruby-changes mailing list