[arch-commits] Commit in subversion/trunk (PKGBUILD fix_ruby22_tests.patch)

Anatol Pomozov anatolik at archlinux.org
Tue Dec 30 14:59:18 UTC 2014


    Date: Tuesday, December 30, 2014 @ 15:59:18
  Author: anatolik
Revision: 228174

upgpkg: subversion 1.8.11-2

ruby 2.2 rebuild
fix swig tests broken because of ruby2.2 test api changes

Added:
  subversion/trunk/fix_ruby22_tests.patch
Modified:
  subversion/trunk/PKGBUILD

------------------------+
 PKGBUILD               |    9 +-
 fix_ruby22_tests.patch |  174 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 180 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2014-12-30 12:50:47 UTC (rev 228173)
+++ PKGBUILD	2014-12-30 14:59:18 UTC (rev 228174)
@@ -7,7 +7,7 @@
 
 pkgname=subversion
 pkgver=1.8.11
-pkgrel=1
+pkgrel=2
 pkgdesc="A Modern Concurrent Version Control System"
 arch=('i686' 'x86_64')
 url="http://subversion.apache.org/"
@@ -30,7 +30,8 @@
         svnserve.conf
         svnserve.tmpfiles
         svnserve.service
-        subversion.rpath.fix.patch)
+        subversion.rpath.fix.patch
+        fix_ruby22_tests.patch)
 md5sums=('766a89bbbb388f8eb76166672d3b9e49'
          'SKIP'
          'a0db6dd43af33952739b6ec089852630'
@@ -37,12 +38,14 @@
          'af1dd703cc28e61d2e2a132ce3eec37a'
          'bb2857eceafcfac35dde39dcffad2314'
          '733011145b8a8e74baf4c9fc9197b3e8'
-         '6b4340ba9d8845cd8497e013ae01be3f')
+         '6b4340ba9d8845cd8497e013ae01be3f'
+         'e5a59f43af24c103477e09bc1120831d')
 validpgpkeys=('19BBCAEF7B19B280A0E2175E62D48FAD16A0DE01')  # Ben Reser
 
 prepare() {
    cd ${pkgname}-${pkgver}
    patch -Np0 -i ../subversion.rpath.fix.patch
+   patch -p1 -i ../fix_ruby22_tests.patch
    sed -i 's|/usr/bin/env python|/usr/bin/env python2|' tools/hook-scripts/{,mailer/{,tests/}}*.py
 }
 

Added: fix_ruby22_tests.patch
===================================================================
--- fix_ruby22_tests.patch	                        (rev 0)
+++ fix_ruby22_tests.patch	2014-12-30 14:59:18 UTC (rev 228174)
@@ -0,0 +1,174 @@
+commit 1bf46d7f134b24a8f594a0e108056aed67759590
+Author: Anatol Pomozov <anatol.pomozov at gmail.com>
+Date:   Tue Dec 30 04:50:55 2014 -0800
+
+    Fix test for ruby 2.2
+    
+    The main source of problems with ruby 2.2 is that it uses new test-unit framework
+    that changes some API.
+    
+    In partcular all assert_* functions are void, but our tests expect bool. Change tests and do
+    not check output of assert_* functions.
+    
+    Do not override TestCase::inherit function as it is used by the framework itself.
+    
+    In ruby 2.2 bool is frozen object so we cannot modify it.
+
+diff --git a/subversion/bindings/swig/ruby/test/my-assertions.rb b/subversion/bindings/swig/ruby/test/my-assertions.rb
+index 77c42e7..91f7ad8 100644
+--- a/subversion/bindings/swig/ruby/test/my-assertions.rb
++++ b/subversion/bindings/swig/ruby/test/my-assertions.rb
+@@ -24,41 +24,13 @@ module Test
+   module Unit
+     module Assertions
+ 
+-      # make an intermediary assertion block handler
+-      def _my_assert_block(&block)
+-       if RUBY_VERSION > '1.9'
+-         assert_block do
+-           yield
+-         end
+-       else
+-         _wrap_assertion do
+-           yield
+-         end
+-       end
+-      end
+-
+-      def assert_true(boolean, message=nil)
+-        _my_assert_block do
+-          assert_equal(true, boolean, message)
+-        end
+-      end
+-
+-      def assert_false(boolean, message=nil)
+-        _my_assert_block do
+-          assert_equal(false, boolean, message)
+-        end
+-      end
+-
+       def assert_nested_sorted_array(expected, actual, message=nil)
+-        _my_assert_block do
+           assert_equal(expected.collect {|elem| elem.sort},
+                        actual.collect {|elem| elem.sort},
+                        message)
+-        end
+       end
+ 
+       def assert_equal_log_entries(expected, actual, message=nil)
+-        _my_assert_block do
+           actual = actual.collect do |entry|
+             changed_paths = entry.changed_paths
+             changed_paths.each_key do |path|
+@@ -73,7 +45,6 @@ module Test
+              entry.has_children?]
+           end
+           assert_equal(expected, actual, message)
+-        end
+       end
+     end
+   end
+diff --git a/subversion/bindings/swig/ruby/test/test-unit-ext.rb b/subversion/bindings/swig/ruby/test/test-unit-ext.rb
+index ce88d75..62a1508 100644
+--- a/subversion/bindings/swig/ruby/test/test-unit-ext.rb
++++ b/subversion/bindings/swig/ruby/test/test-unit-ext.rb
+@@ -18,6 +18,6 @@
+ # ====================================================================
+ 
+ require "test-unit-ext/always-show-result" if RUBY_VERSION < '1.9.3'
+-require "test-unit-ext/priority"
++#require "test-unit-ext/priority"
+ require "test-unit-ext/backtrace-filter" if RUBY_VERSION < '1.9.3'
+ require "test-unit-ext/long-display-for-emacs" if RUBY_VERSION < '1.9.3'
+diff --git a/subversion/bindings/swig/ruby/test/test_delta.rb b/subversion/bindings/swig/ruby/test/test_delta.rb
+index 541a4fe..90c1e3b 100644
+--- a/subversion/bindings/swig/ruby/test/test_delta.rb
++++ b/subversion/bindings/swig/ruby/test/test_delta.rb
+@@ -48,7 +48,6 @@ class SvnDeltaTest < Test::Unit::TestCase
+     target = StringIO.new(t)
+     stream = Svn::Delta::TextDeltaStream.new(source, target)
+     assert_nil(stream.md5_digest)
+-    _my_assert_block do
+       ret = stream.each do |window|
+         window.ops.each do |op|
+           op_size = op.offset + op.length
+@@ -64,8 +63,6 @@ class SvnDeltaTest < Test::Unit::TestCase
+           end
+         end
+       end
+-      true if RUBY_VERSION > '1.9' # this block returns nil in > ruby '1.9'
+-    end
+     assert_equal(Digest::MD5.hexdigest(t), stream.md5_digest)
+   end
+ 
+@@ -84,7 +81,6 @@ class SvnDeltaTest < Test::Unit::TestCase
+       end
+     end
+ 
+-    _my_assert_block do
+       composed_window.ops.each do |op|
+         op_size = op.offset + op.length
+         case op.action_code
+@@ -98,7 +94,6 @@ class SvnDeltaTest < Test::Unit::TestCase
+           flunk
+         end
+       end
+-    end
+   end
+ 
+   def test_txdelta_apply_instructions
+diff --git a/subversion/bindings/swig/ruby/test/test_repos.rb b/subversion/bindings/swig/ruby/test/test_repos.rb
+index 89ca8c1..6745200 100644
+--- a/subversion/bindings/swig/ruby/test/test_repos.rb
++++ b/subversion/bindings/swig/ruby/test/test_repos.rb
+@@ -678,7 +678,8 @@ class SvnReposTest < Test::Unit::TestCase
+ 
+       dest_path = File.join(@tmp_path, "dest")
+       Svn::Repos.create(dest_path) do |repos|
+-        assert_raises(NoMethodError) do
++        assert_raises(RuntimeError) do
++          # Can't modify frozen object
+           repos.load_fs(nil)
+         end
+       end
+diff --git a/subversion/bindings/swig/ruby/test/test_wc.rb b/subversion/bindings/swig/ruby/test/test_wc.rb
+index 3a2aa65..2313e60 100644
+--- a/subversion/bindings/swig/ruby/test/test_wc.rb
++++ b/subversion/bindings/swig/ruby/test/test_wc.rb
+@@ -411,7 +411,7 @@ EOE
+     end
+   end
+ 
+-  def test_status
++  def test_status2
+     source = "source"
+     file1 = "file1"
+     file2 = "file2"
+@@ -534,7 +534,6 @@ EOE
+       ctx.ci(lf_path)
+ 
+       Svn::Wc::AdmAccess.open(nil, @wc_path, true, 5) do |access|
+-        _my_assert_block do
+           File.open(src_path, "wb") {|f| f.print(source)}
+           args = [method_name, src_path, crlf_path, Svn::Wc::TRANSLATE_FROM_NF]
+           result = yield(access.send(*args), source)
+@@ -553,7 +552,6 @@ EOE
+           result ||= File.open(src_path, "rb") {|f| f.read}
+           assert_equal(lf_source, result)
+         end
+-      end
+     end
+   end
+ 
+@@ -1072,11 +1070,6 @@ EOE
+         assert_not_nil context
+         assert_kind_of Svn::Wc::Context, context
+       end
+-      if RUBY_VERSION > '1.9'
+-        assert_equal(result,true)
+-      else
+-        assert_nil result
+-      end
+     end
+   end
+ 



More information about the arch-commits mailing list