1 # frozen_string_literal: false
6 class TestRbConfig < Test::Unit::TestCase
9 Shellwords::shellwords(RbConfig::CONFIG["configure_args"]).grep(/\A--with-([^=]*)=(.*)/) do
10 @@with_config[$1.tr('_', '-')] = $2
14 RbConfig::MAKEFILE_CONFIG.each do |key, val|
15 next unless /\Asite(?!arch)/ =~ key
16 next if @@with_config[key]
17 assert_match(/(?:\$\(|\/)site/, val, key)
22 RbConfig::MAKEFILE_CONFIG.each do |key, val|
23 next unless /\Avendor(?!arch)/ =~ key
24 next if @@with_config[key]
25 assert_match(/(?:\$\(|\/)vendor/, val, key)
30 RbConfig::MAKEFILE_CONFIG.each do |key, val|
31 next unless /\A(?!site|vendor|archdir\z).*arch.*dir\z/ =~ key
32 next if @@with_config[key]
33 assert_match(/\$\(arch|\$\(rubyarchprefix\)/, val, key)
38 bug7823 = '[ruby-dev:46964] [Bug #7823]'
39 RbConfig::MAKEFILE_CONFIG.each do |key, val|
40 next unless /\Asite.*arch.*dir\z/ =~ key
41 next if @@with_config[key]
42 assert_match(/\$\(sitearch|\$\(rubysitearchprefix\)/, val, "#{key} #{bug7823}")
46 def test_vendorarchdirs
47 bug7823 = '[ruby-dev:46964] [Bug #7823]'
48 RbConfig::MAKEFILE_CONFIG.each do |key, val|
49 next unless /\Avendor.*arch.*dir\z/ =~ key
50 next if @@with_config[key]
51 assert_match(/\$\(sitearch|\$\(rubysitearchprefix\)/, val, "#{key} #{bug7823}")
55 if /darwin/ =~ RUBY_PLATFORM
57 assert_separately([{"SDKROOT" => "$(prefix)/SDKRoot"}], "#{<<~"begin;"}\n#{<<~'end;'}")
59 assert_equal RbConfig::CONFIG["prefix"]+"/SDKRoot", RbConfig::CONFIG["SDKROOT"]