`llvm-strip-7` is a sane valid strip command that LLVM 7 ships, albeit
it does not understand `--version`.  It is a bad idea to check that
option.  Instead just see if the command actually strips something.  A
copy of `/bin/sh` should suffice.  That file must be ubiquitous.
This commit is contained in:
卜部昌平 2020-08-21 22:25:44 +09:00
Родитель 44d25c6528
Коммит cc2caa6edf
1 изменённых файлов: 9 добавлений и 3 удалений

Просмотреть файл

@ -59,11 +59,17 @@ describe 'RbConfig::CONFIG' do
out.should_not be_empty
end
require 'tempfile'
it "['STRIP'] exists and can be executed" do
strip = RbConfig::CONFIG.fetch('STRIP')
out = `#{strip} --version`
$?.should.success?
out.should_not be_empty
Tempfile.open('sh') do |dst|
File.open('/bin/sh', 'rb') do |src|
IO.copy_stream(src, dst)
dst.flush
out =`#{strip} #{dst.to_path}`
$?.should.success?
end
end
end
end
end