mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
5cdf99f64e
When installing an extension library which provides a header, that header should be installed under site_ruby (or vendor_ruby when "--vendor" option was given to extconf.rb). However, currently this file is about to be installed in the core include directory.
30 lines
1,023 B
Ruby
30 lines
1,023 B
Ruby
# frozen_string_literal: false
|
|
require_relative 'base'
|
|
|
|
class TestMkmf
|
|
class TestInstall < TestMkmf
|
|
def test_install_dirs
|
|
Dir.mktmpdir do |dir|
|
|
File.write(dir+"/extconf.rb", "require 'mkmf'; create_makefile('test')")
|
|
all_assertions do |a|
|
|
a.foreach(
|
|
["site"],
|
|
["vendor", "--vendor"],
|
|
) do |dest, *options|
|
|
assert_ruby_status(["-C", dir, "extconf.rb", *options])
|
|
mf = File.read(dir+"/Makefile")
|
|
a.foreach(
|
|
["RUBYCOMMONDIR", "$(#{dest}dir)$(target_prefix)"],
|
|
["RUBYLIBDIR", "$(#{dest}libdir)$(target_prefix)"],
|
|
["RUBYARCHDIR", "$(#{dest}archdir)$(target_prefix)"],
|
|
["HDRDIR", "$(#{dest}hdrdir)$(target_prefix)"],
|
|
["ARCHHDRDIR", "$(#{dest}archhdrdir)$(target_prefix)"],
|
|
) do |(var, path)|
|
|
assert_equal path, mf[/^#{var}\s*=\s*(.*)$/, 1]
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|