[rubygem-gobject-introspection] Fix test failure, patch from upstream

Mamoru TASAKA mtasaka at fedoraproject.org
Sat Jan 18 19:14:57 UTC 2014


commit 360347f502223c062fb30780aab9ba87d6840a1c
Author: Mamoru TASAKA <mtasaka at fedoraproject.org>
Date:   Sun Jan 19 04:15:09 2014 +0900

    Fix test failure, patch from upstream

 ...-follow-maybe-GObjectIntrospection-change.patch |  100 ++++++++++++++++++++
 gi-2.1.0-test-maybe-fix-test-failure-on-i686.patch |   63 ++++++++++++
 rubygem-gobject-introspection.spec                 |   15 +++-
 3 files changed, 175 insertions(+), 3 deletions(-)
---
diff --git a/gi-2.1.0-test-follow-maybe-GObjectIntrospection-change.patch b/gi-2.1.0-test-follow-maybe-GObjectIntrospection-change.patch
new file mode 100644
index 0000000..bc2ee05
--- /dev/null
+++ b/gi-2.1.0-test-follow-maybe-GObjectIntrospection-change.patch
@@ -0,0 +1,100 @@
+From bbd7f802573b146a2cc9fc2c2b7d6c92453dcf4a Mon Sep 17 00:00:00 2001
+From: Kouhei Sutou <kou at clear-code.com>
+Date: Fri, 17 Jan 2014 23:58:01 +0900
+Subject: [PATCH 2/2] gi test: follow (maybe) GObjectIntrospection change
+
+GitHub: #217
+
+Reported by mtasaka. Thanks!!!
+---
+ gobject-introspection/test/test-interface-info.rb | 6 +++---
+ gobject-introspection/test/test-repository.rb     | 7 +++++--
+ 2 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/gobject-introspection/test/test-interface-info.rb b/gobject-introspection/test/test-interface-info.rb
+index e724df3..fe7eb7d 100644
+--- a/gobject-introspection/test/test-interface-info.rb
++++ b/gobject-introspection/test/test-interface-info.rb
+@@ -1,4 +1,4 @@
+-# Copyright (C) 2012  Ruby-GNOME2 Project Team
++# Copyright (C) 2012-2014  Ruby-GNOME2 Project Team
+ #
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+@@ -67,9 +67,9 @@ class TestInterfaceInfo < Test::Unit::TestCase
+   end
+ 
+   def test_get_signal_name
+-    require_version(1, 34, 0)
++    require_version(1, 36, 0)
+     info = @repository.find("Gio", "Volume")
+-    assert_kind_of(GObjectIntrospection::FunctionInfo,
++    assert_kind_of(GObjectIntrospection::SignalInfo,
+                    info.get_signal("changed"))
+   end
+ 
+diff --git a/gobject-introspection/test/test-repository.rb b/gobject-introspection/test/test-repository.rb
+index a180d64..7dd2903 100644
+--- a/gobject-introspection/test/test-repository.rb
++++ b/gobject-introspection/test/test-repository.rb
+@@ -1,4 +1,4 @@
+-# Copyright (C) 2012  Ruby-GNOME2 Project Team
++# Copyright (C) 2012-2014  Ruby-GNOME2 Project Team
+ #
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+@@ -15,6 +15,8 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ 
+ class TestRepository < Test::Unit::TestCase
++  include GObjectIntrospectionTestUtils
++
+   def setup
+     @repository = GObjectIntrospection::Repository.default
+     @repository.require("GObject")
+@@ -31,7 +33,8 @@ class TestRepository < Test::Unit::TestCase
+   end
+ 
+   def test_get_dependencies
+-    assert_equal(["GLib-2.0", "GObject-2.0"].sort,
++    require_version(1, 36, 0)
++    assert_equal(["GObject-2.0"].sort,
+                  @repository.get_dependencies("Gio").sort)
+   end
+ 
+-- 
+1.8.5.2
+
+commit 71e27982fb9145684f5afb76303d93f87b03e0a4
+Author: Kouhei Sutou <kou at clear-code.com>
+Date:   Fri Jan 17 23:59:11 2014 +0900
+
+    gi test: follow (maybe) GObjectIntrospection change
+    
+    GitHub: fix #217
+    
+    Reported by mtasaka. Thanks!!!
+
+diff --git a/gobject-introspection/test/test-signal-info.rb b/gobject-introspection/test/test-signal-info.rb
+index 93fbb89..232ec2f 100644
+--- a/gobject-introspection/test/test-signal-info.rb
++++ b/gobject-introspection/test/test-signal-info.rb
+@@ -15,6 +15,8 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ 
+ class TestSignalInfo < Test::Unit::TestCase
++  include GObjectIntrospectionTestUtils
++
+   def setup
+     @repository = GObjectIntrospection::Repository.default
+     @repository.require("Gio")
+@@ -23,7 +25,8 @@ class TestSignalInfo < Test::Unit::TestCase
+   end
+ 
+   def test_flags
+-    assert_equal(GLib::SignalFlags::RUN_CLEANUP,
++    require_version(1, 38, 0)
++    assert_equal(GLib::SignalFlags::RUN_LAST,
+                  @info.flags)
+   end
+ 
diff --git a/gi-2.1.0-test-maybe-fix-test-failure-on-i686.patch b/gi-2.1.0-test-maybe-fix-test-failure-on-i686.patch
new file mode 100644
index 0000000..6441d27
--- /dev/null
+++ b/gi-2.1.0-test-maybe-fix-test-failure-on-i686.patch
@@ -0,0 +1,63 @@
+From 915f971a4e1cd529f01221ea20484fcdef176f7b Mon Sep 17 00:00:00 2001
+From: Kouhei Sutou <kou at clear-code.com>
+Date: Fri, 17 Jan 2014 23:30:44 +0900
+Subject: [PATCH 1/2] gi test: maybe fix test failure on i686
+
+GitHub: fix #216
+
+Reported by mtasaka. Thanks!!!
+---
+ gobject-introspection/test/test-struct-info.rb | 25 ++++++++++++++++++++++---
+ 1 file changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/gobject-introspection/test/test-struct-info.rb b/gobject-introspection/test/test-struct-info.rb
+index aef5578..852b82c 100644
+--- a/gobject-introspection/test/test-struct-info.rb
++++ b/gobject-introspection/test/test-struct-info.rb
+@@ -1,4 +1,4 @@
+-# Copyright (C) 2012  Ruby-GNOME2 Project Team
++# Copyright (C) 2012-2014  Ruby-GNOME2 Project Team
+ #
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+@@ -40,11 +40,15 @@ class TestStructInfo < Test::Unit::TestCase
+   end
+ 
+   def test_size
+-    assert_equal(24, @info.size)
++    need_ruby_2_0
++    need_fiddle
++    assert_equal(16 + Fiddle::SIZEOF_SIZE_T, @info.size)
+   end
+ 
+   def test_alignment
+-    assert_equal(8, @info.alignment)
++    need_ruby_2_0
++    need_fiddle
++    assert_equal(Fiddle::ALIGN_SIZE_T, @info.alignment)
+   end
+ 
+   def test_gtype_struct?
+@@ -54,4 +58,19 @@ class TestStructInfo < Test::Unit::TestCase
+   def test_foreign?
+     assert_false(@info.foreign?)
+   end
++
++  private
++  def need_ruby_2_0
++    if RUBY_VERSION < "2.0.0"
++      omit("need Ruby 2.0.0 or later")
++    end
++  end
++
++  def need_fiddle
++    begin
++      require "fiddle"
++    rescue LoadError
++      omit("need fiddle")
++    end
++  end
+ end
+-- 
+1.8.5.2
+
diff --git a/rubygem-gobject-introspection.spec b/rubygem-gobject-introspection.spec
index 99a6c14..9a19eac 100644
--- a/rubygem-gobject-introspection.spec
+++ b/rubygem-gobject-introspection.spec
@@ -8,13 +8,17 @@
 Summary:	Ruby binding of GObjectIntrospection
 Name:		rubygem-%{gem_name}
 Version:	2.1.0
-Release:	1%{?dist}
+Release:	2%{?dist}
 
 Group:		Development/Languages
 # lib/gobject-introspection.rb and so on
 License:	LGPLv2+
 URL:		http://ruby-gnome2.sourceforge.jp/
 Source0:	http://rubygems.org/gems/%{gem_name}-%{version}.gem
+# https://github.com/ruby-gnome2/ruby-gnome2/issues/216
+Patch0:	gi-2.1.0-test-maybe-fix-test-failure-on-i686.patch
+# https://github.com/ruby-gnome2/ruby-gnome2/issues/217
+Patch1:	gi-2.1.0-test-follow-maybe-GObjectIntrospection-change.patch
 
 Requires:	ruby(release)
 BuildRequires:	ruby(release)
@@ -64,6 +68,9 @@ pushd tmpunpackdir
 gem unpack %{SOURCE0}
 cd %{gem_name}-%{version}
 
+%patch0 -p2
+%patch1 -p2
+
 # Permission
 find . -name \*.rb -print0 | xargs --null chmod 0644
 
@@ -120,8 +127,7 @@ ln -sf /bin/true make
 export PATH=$(pwd):$PATH
 popd
 
-ruby -Ilib:test ./test/run-test.rb || \
-	echo "Please investigate this"
+ruby -Ilib:test ./test/run-test.rb
 popd
 
 %files
@@ -149,6 +155,9 @@ popd
 %exclude	%{gem_instdir}/test/
 
 %changelog
+* Sun Jan 19 2014 Mamoru TASAKA <mtasaka at fedoraproject.org> - 2.1.0-2
+- Fix test failure, patch from upstream
+
 * Thu Jan 16 2014 Mamoru TASAKA <mtasaka at fedoraproject.org> - 2.1.0-1
 - 2.1.0
 


More information about the scm-commits mailing list