Skip to content

Commit d99391b

Browse files
committed
Add a test for disabled rpath
1 parent aec09e2 commit d99391b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/rcd_test/test/test_basic.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,15 @@ def test_largefile_op_removed_from_musl
3535
is_linux = RUBY_PLATFORM.include?("linux")
3636
assert_equal(is_linux, RcdTest.largefile_op_removed_from_musl)
3737
end
38+
39+
def test_disabled_rpath
40+
skip("jruby uses jar files without rpath") if RUBY_ENGINE == "jruby"
41+
42+
cext_fname = $LOADED_FEATURES.grep(/rcd_test_ext/).first
43+
refute_nil(cext_fname, "the C-ext should be loaded")
44+
cext_text = File.binread(cext_fname)
45+
assert_match(/Init_rcd_test_ext/, cext_text, "C-ext shoud contain the init function")
46+
refute_match(/usr\/local/, cext_text, "there should be no rpath to /usr/local/rake-compiler/ruby/x86_64-unknown-linux-musl/ruby-3.4.5/lib or so")
47+
refute_match(/home\//, cext_text, "there should be no path to /home/ or so")
48+
end
3849
end

0 commit comments

Comments
 (0)