[DRE-commits] [ruby-backports] 03/07: Add a patch to make the test suite work under autopkgtest

Jérémy Bobbio lunar at moszumanska.debian.org
Wed Sep 9 13:24:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-backports.

commit 1bea3e6a426fc8f072662d3308abb332fa4844f0
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Sep 9 15:09:33 2015 +0200

    Add a patch to make the test suite work under autopkgtest
---
 debian/patches/series                              |  1 +
 ...em-library-paths-when-running-under-autopkgtest | 51 ++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 69c63a9..eab0d5a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 fix-collision-with-hash-function
+use-system-library-paths-when-running-under-autopkgtest
diff --git a/debian/patches/use-system-library-paths-when-running-under-autopkgtest b/debian/patches/use-system-library-paths-when-running-under-autopkgtest
new file mode 100644
index 0000000..55697d2
--- /dev/null
+++ b/debian/patches/use-system-library-paths-when-running-under-autopkgtest
@@ -0,0 +1,51 @@
+Description: Use system library paths when running under autopkgtest
+Author: Jérémy Bobbio <lunar at debian.org>
+Forwarded: not-needed
+Last-Update: 2015-09-09
+
+diff --git a/test/_backport_guards_test.rb b/test/_backport_guards_test.rb
+index ee05355..39d5250 100644
+--- a/test/_backport_guards_test.rb
++++ b/test/_backport_guards_test.rb
+@@ -80,6 +80,14 @@ class AAA_TestBackportGuards < Test::Unit::TestCase
+     delta unless delta.empty?
+   end
+ 
++  def lib_path(path)
++    unless ENV['ADTTMP'].nil? # running under autopkgtest
++      "/usr/lib/ruby/vendor_ruby/#{path}"
++    else
++      File.expand_path("../../lib/#{path}", __FILE__)
++    end
++  end
++
+   # Order super important!
+   def test__1_abbrev_can_be_required_before_backports
+     assert require('abbrev')
+@@ -103,7 +111,7 @@ class AAA_TestBackportGuards < Test::Unit::TestCase
+   end
+ 
+   def test_setlib_load_correctly_after_requiring_backports
+-    path = File.expand_path("../../lib/backports/1.9.2/stdlib/matrix.rb", __FILE__)
++    path = lib_path('backports/1.9.2/stdlib/matrix.rb')
+     assert_equal false,  $LOADED_FEATURES.include?(path)
+     assert_equal true,  require('matrix')
+     assert_equal true,  $bogus.include?("matrix")
+@@ -113,7 +121,7 @@ class AAA_TestBackportGuards < Test::Unit::TestCase
+ 
+   def test_setlib_load_correctly_before_requiring_backports_test
+     assert_equal true,  $bogus.include?("abbrev")
+-    path = File.expand_path("../../lib/backports/2.0.0/stdlib/abbrev.rb", __FILE__)
++    path = lib_path('backports/2.0.0/stdlib/abbrev.rb')
+     assert_equal true,  $LOADED_FEATURES.include?(path)
+     assert_equal false, require('abbrev')
+   end
+@@ -124,7 +132,7 @@ class AAA_TestBackportGuards < Test::Unit::TestCase
+   end
+ 
+   def test_load_correctly_new_libraries_test
+-    path = File.expand_path("../../lib/backports/2.0.0/stdlib/fake_stdlib_lib.rb", __FILE__)
++    path = lib_path('backports/2.0.0/stdlib/fake_stdlib_lib.rb')
+     assert_equal false, $LOADED_FEATURES.include?(path)
+     assert_equal true,  require('fake_stdlib_lib')
+     assert_equal true,  $LOADED_FEATURES.include?(path)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-backports.git



More information about the Pkg-ruby-extras-commits mailing list