[DRE-commits] [SCM] gem2deb.git branch, master, updated. e54f196cd9435c5147d4b83469a2be5cf12303b1

Antonio Terceiro terceiro at softwarelivre.org
Fri Mar 25 07:20:36 UTC 2011


The following commit has been merged in the master branch:
commit cc91d3205cc234f50a162242a936a59ecaf571f3
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date:   Thu Mar 24 19:59:21 2011 -0700

    Update tests for change to single binary packages
    
      * Fixed the assumptions in the native extension tests
      * Removed tests that assumed mutiplie binary packages
      * Added back shebang rewiting call for the single binary package.

diff --git a/lib/gem2deb/dh_ruby.rb b/lib/gem2deb/dh_ruby.rb
index bd91e9f..a2f2658 100644
--- a/lib/gem2deb/dh_ruby.rb
+++ b/lib/gem2deb/dh_ruby.rb
@@ -103,32 +103,7 @@ module Gem2Deb
         run_tests(rubyver)
       end
 
-=begin This only works in the multi-binary packages case, which is not supported anymore
-      packages.each do |package|
-        # handle extensions
-        rubyver = ruby_version_for(package)
-        if rubyver == 'ruby'
-          if packages.size == 1 # pure-Ruby lib
-            SUPPORTED_RUBY_VERSIONS.keys.each do |ver|
-              run_tests(ver)
-            end
-          end
-        else
-          if metadata.has_native_extensions?
-            if not SUPPORTED_RUBY_VERSIONS.has_key?(rubyver)
-              puts "Unknown Ruby version: #{rubyver}"
-              exit(1)
-            end
-            puts "Building extension for #{rubyver} ..." if @verbose
-            run("#{SUPPORTED_RUBY_VERSIONS[rubyver]} -I#{LIBDIR} #{EXTENSION_BUILDER} #{package}")
-          end
-          run_tests(rubyver)
-        end
-
-        # Update shebang lines of installed programs
-        update_shebangs(package)
-      end
-=end
+      update_shebangs(package)
 
       # FIXME after install, check for require 'rubygems' and other stupid things, and
       #       issue warnings
diff --git a/test/unit/dh_make_ruby_test.rb b/test/unit/dh_make_ruby_test.rb
index 70cea6c..2ae1b0a 100644
--- a/test/unit/dh_make_ruby_test.rb
+++ b/test/unit/dh_make_ruby_test.rb
@@ -57,43 +57,6 @@ class DhMakeRubyTest < Gem2DebTestCase
    Gem2Deb::DhMakeRuby.new(SIMPLE_EXTENSION_UPSTREAM_TARBALL).build
   end
 
-=begin FIXME
-  context 'native extension' do
-    should 'generate one package for ruby1.8' do
-      Dir.chdir(DEBIANIZED_SIMPLE_EXTENSION) do
-        assert(packages.include?('ruby1.8-simpleextension'), "Package ruby1.8-simpleextension not created")
-      end
-    end
-    should 'generate one package for ruby1.9.1' do
-      Dir.chdir(DEBIANIZED_SIMPLE_EXTENSION) do
-        assert(packages.include?('ruby1.9.1-simpleextension'), "Package ruby1.9.1-simpleextension not created")
-      end
-    end
-  end
-
-  DEBIANIZED_SIMPLE_ROOT_EXTENSION = File.join(tmpdir, 'ruby-' + SIMPLE_ROOT_EXTENSION_DIRNAME.gsub('_', '-'))
-  SIMPLE_ROOT_EXTENSION_UPSTREAM_TARBALL = DEBIANIZED_SIMPLE_ROOT_EXTENSION + '.tar.gz'
-  one_time_setup do
-   Gem2Deb::Gem2Tgz.convert!(SIMPLE_ROOT_EXTENSION, SIMPLE_ROOT_EXTENSION_UPSTREAM_TARBALL)
-   Gem2Deb::DhMakeRuby.new(SIMPLE_ROOT_EXTENSION_UPSTREAM_TARBALL).build
-  end
-=end
-
-=begin FIXME
-  context 'native extension with extconf.rb in the sources root' do
-    should 'generate one package for ruby1.8' do
-      Dir.chdir(DEBIANIZED_SIMPLE_ROOT_EXTENSION) do
-        assert(packages.include?('ruby1.8-simpleextension-in-root'), "Package ruby1.8-simpleextension-in-root not created")
-      end
-    end
-    should 'generate one package for ruby1.9.1' do
-      Dir.chdir(DEBIANIZED_SIMPLE_ROOT_EXTENSION) do
-        assert(packages.include?('ruby1.9.1-simpleextension-in-root'), "Package ruby1.9.1-simpleextension-in-root not created")
-      end
-    end
-  end
-=end
-
   DEBIANIZED_SIMPLE_PROGRAM       = File.join(tmpdir, SIMPLE_PROGRAM_DIRNAME)
   SIMPLE_PROGRAM_UPSTREAM_TARBALL = DEBIANIZED_SIMPLE_PROGRAM + '.tar.gz'
   one_time_setup do
diff --git a/test/unit/dh_ruby_test.rb b/test/unit/dh_ruby_test.rb
index 71ee7a0..ed7aa4b 100644
--- a/test/unit/dh_ruby_test.rb
+++ b/test/unit/dh_ruby_test.rb
@@ -20,7 +20,6 @@ class DhRubyTest < Gem2DebTestCase
     end
   end
 
-=begin FIXME
   context 'installing a Ruby program' do
     should 'install programs at /usr/bin' do
       assert_installed SIMPLE_PROGRAM_DIRNAME, 'ruby-simpleprogram', '/usr/bin/simpleprogram'
@@ -29,21 +28,19 @@ class DhRubyTest < Gem2DebTestCase
       assert_match %r(#!/usr/bin/ruby1.8), read_installed_file(SIMPLE_PROGRAM_DIRNAME, 'ruby-simpleprogram', '/usr/bin/simpleprogram').lines.first.strip
     end
   end
-=end
 
-=begin FIXME
   context 'installing native extension' do
     arch = RbConfig::CONFIG['arch']
-    {
-      '1.8'   => 'ruby1.8',
-      '1.9.1' => 'ruby1.9.1',
-    }.each do |version_number, version_name|
+    [
+      '1.8',
+      '1.9.1',
+    ].each do |version_number|
       target_so = "/usr/lib/ruby/vendor_ruby/#{version_number}/#{arch}/simpleextension.so"
-      should "install native extension for #{version_name}" do
-        assert_installed SIMPLE_EXTENSION_DIRNAME, "#{version_name}-simpleextension", target_so
+      should "install native extension for Ruby #{version_number}" do
+        assert_installed SIMPLE_EXTENSION_DIRNAME, "ruby-simpleextension", target_so
       end
-      should "link #{target_so} against lib#{version_name}" do
-        installed_so = installed_file_path(SIMPLE_EXTENSION_DIRNAME, "#{version_name}-simpleextension", target_so)
+      should "link #{target_so} against libruby#{version_number}" do
+        installed_so = installed_file_path(SIMPLE_EXTENSION_DIRNAME, "ruby-simpleextension", target_so)
         assert_match /libruby-?#{version_number}/, `ldd #{installed_so}`
       end
     end
@@ -51,22 +48,19 @@ class DhRubyTest < Gem2DebTestCase
       assert_match %r(#!/usr/bin/ruby1.8), read_installed_file(SIMPLE_EXTENSION_DIRNAME, 'ruby-simpleextension', '/usr/bin/simpleextension').lines.first.strip
     end
   end
-=end
 
-=begin FIXME
   context 'installing native extension with extconf.rb in the sources root' do
     arch = RbConfig::CONFIG['arch']
-    {
-      '1.8'   => 'ruby1.8',
-      '1.9.1' => 'ruby1.9.1',
-    }.each do |version_number, version_name|
+    [
+      '1.8',
+      '1.9.1',
+    ].each do |version_number|
       target_so = "/usr/lib/ruby/vendor_ruby/#{version_number}/#{arch}/simpleextension_in_root.so"
-      should "install native extension for #{version_name}" do
-        assert_installed SIMPLE_ROOT_EXTENSION_DIRNAME, "#{version_name}-simpleextension-in-root", target_so
+      should "install native extension for Ruby #{version_number}" do
+        assert_installed SIMPLE_ROOT_EXTENSION_DIRNAME, "ruby-simpleextension-in-root", target_so
       end
     end
   end
-=end
 
   context 'determining ruby version for package' do
     {
@@ -112,13 +106,6 @@ class DhRubyTest < Gem2DebTestCase
       assert_equal ['ruby-foo-common'], dh_ruby.send(:packages_to_install_programs_in)
     end
 
-=begin FIXME
-    should 'duplicate pure-Ruby code in native packages' do
-      assert_installed SIMPLE_MIXED_DIRNAME, 'ruby1.8-simplemixed', '/usr/lib/ruby/vendor_ruby/1.8/simplemixed.rb' 
-      assert_installed SIMPLE_MIXED_DIRNAME, 'ruby1.9.1-simplemixed', '/usr/lib/ruby/vendor_ruby/1.9.1/simplemixed.rb'
-    end
-=end
-
   end
 
   context 'calculating libdir for each package' do

-- 
gem2deb.git



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