buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boisv...@apache.org
Subject svn commit: r1030590 - in /buildr/trunk: lib/buildr/core/cc.rb lib/buildr/core/test.rb spec/core/cc_spec.rb
Date Wed, 03 Nov 2010 18:16:38 GMT
Author: boisvert
Date: Wed Nov  3 18:16:37 2010
New Revision: 1030590

URL: http://svn.apache.org/viewvc?rev=1030590&view=rev
Log:
Fix ruby 1.9 failures

Modified:
    buildr/trunk/lib/buildr/core/cc.rb
    buildr/trunk/lib/buildr/core/test.rb
    buildr/trunk/spec/core/cc_spec.rb

Modified: buildr/trunk/lib/buildr/core/cc.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/cc.rb?rev=1030590&r1=1030589&r2=1030590&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/cc.rb (original)
+++ buildr/trunk/lib/buildr/core/cc.rb Wed Nov  3 18:16:37 2010
@@ -38,7 +38,7 @@ module Buildr
     end
 
     def monitor_and_compile
-      # we don't want to actually fail if our dependencies don't succede
+      # we don't want to actually fail if our dependencies don't succeed
       begin
         [:compile, 'test:compile'].each { |name| project.task(name).invoke }
         build_completed(project)
@@ -48,13 +48,13 @@ module Buildr
 
         build_failed(project, ex)
       end
-
       main_dirs = project.compile.sources.map(&:to_s)
       test_dirs = project.task('test:compile').sources.map(&:to_s)
       res_dirs = project.resources.sources.map(&:to_s)
 
-      main_ext = Buildr::Compiler.select(project.compile.compiler).source_ext.map(&:to_s)
unless project.compile.compiler.nil?
-      test_ext = Buildr::Compiler.select(project.task('test:compile').compiler).source_ext.map(&:to_s)
unless project.task('test:compile').compiler.nil?
+      source_ext = lambda { |compiler| Array(Buildr::Compiler.select(compiler).source_ext).map(&:to_s)
}
+      main_ext = source_ext.call(project.compile.compiler) unless project.compile.compiler.nil?
+      test_ext = source_ext.call(project.task('test:compile').compiler) unless project.task('test:compile').compiler.nil?
 
       test_tail = if test_dirs.empty? then '' else ",{#{test_dirs.join ','}}/**/*.{#{test_ext.join
','}}" end
       res_tail = if res_dirs.empty? then '' else ",{#{res_dirs.join ','}}/**/*" end

Modified: buildr/trunk/lib/buildr/core/test.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/test.rb?rev=1030590&r1=1030589&r2=1030590&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/test.rb (original)
+++ buildr/trunk/lib/buildr/core/test.rb Wed Nov  3 18:16:37 2010
@@ -193,8 +193,8 @@ module Buildr
 
       # Used by the test/integration to include specific tests
       def include(includes)
+        includes = wildcardify(Array(includes))
         Project.projects.each do |project|
-          includes = wildcardify(includes)
           project.test.send :include, *includes if includes.size > 0
           project.test.send :forced_need=, true
         end
@@ -202,8 +202,8 @@ module Buildr
 
       # Used by the test/integration to exclude specific tests
       def exclude(excludes)
+        excludes = wildcardify(Array(excludes))
         Project.projects.each do |project|
-          excludes = wildcardify(excludes)
           project.test.send :exclude, *excludes if excludes.size > 0
           project.test.send :forced_need=, true
         end
@@ -646,7 +646,7 @@ module Buildr
           excludes.map! { |t| t[1..-1] }
 
           TestTask.clear
-          TestTask.include(includes.empty? ? '*' : includes)
+          TestTask.include(includes.empty? ? ['*'] : includes)
           TestTask.exclude excludes
         end
         task('test').invoke

Modified: buildr/trunk/spec/core/cc_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/cc_spec.rb?rev=1030590&r1=1030589&r2=1030590&view=diff
==============================================================================
--- buildr/trunk/spec/core/cc_spec.rb (original)
+++ buildr/trunk/spec/core/cc_spec.rb Wed Nov  3 18:16:37 2010
@@ -105,7 +105,12 @@ describe Buildr::CCTask do
     filter.should_not_receive :run
     
     thread = Thread.new do
-      project.cc.invoke
+      begin
+        project.cc.invoke
+      rescue => e
+        p "unexpected exception #{e.inspect}"
+        p e.backtrace.join("\n").inspect
+      end
     end
     
     sleep 0.5



Mime
View raw message