[ruby/prism] Rename librubyparser to libprism
librubyparser was an artifact of the prototype that was initially named ruby-parser. Instead, this renames it to libprism to be consistent with the actual name. https://github.com/ruby/prism/commit/8600b06811
This commit is contained in:
parent
80e379bda1
commit
ed75518192
@ -14,7 +14,7 @@ module Prism
|
|||||||
|
|
||||||
# Define the library that we will be pulling functions from. Note that this
|
# Define the library that we will be pulling functions from. Note that this
|
||||||
# must align with the build shared library from make/rake.
|
# must align with the build shared library from make/rake.
|
||||||
ffi_lib File.expand_path("../../build/librubyparser.#{RbConfig::CONFIG["SOEXT"]}", __dir__)
|
ffi_lib File.expand_path("../../build/libprism.#{RbConfig::CONFIG["SOEXT"]}", __dir__)
|
||||||
|
|
||||||
# Convert a native C type declaration into a symbol that FFI understands.
|
# Convert a native C type declaration into a symbol that FFI understands.
|
||||||
# For example:
|
# For example:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "prism/extension.h"
|
#include "prism/extension.h"
|
||||||
|
|
||||||
// NOTE: this file should contain only bindings. All non-trivial logic should be
|
// NOTE: this file should contain only bindings. All non-trivial logic should be
|
||||||
// in librubyparser so it can be shared its the various callers.
|
// in libprism so it can be shared its the various callers.
|
||||||
|
|
||||||
VALUE rb_cPrism;
|
VALUE rb_cPrism;
|
||||||
VALUE rb_cPrismNode;
|
VALUE rb_cPrismNode;
|
||||||
|
@ -13,8 +13,8 @@ module Prism
|
|||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
|
|
||||||
@librubyparser_a = File.expand_path("../../build/librubyparser.a", __dir__)
|
@libprism_a = File.expand_path("../../build/libprism.a", __dir__)
|
||||||
@librubyparser_so = File.expand_path("../../build/librubyparser.so", __dir__)
|
@libprism_so = File.expand_path("../../build/libprism.so", __dir__)
|
||||||
@prism_so = File.expand_path("../../lib/prism/prism.so", __dir__)
|
@prism_so = File.expand_path("../../lib/prism/prism.so", __dir__)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -56,34 +56,34 @@ module Prism
|
|||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# static archive - librubyparser.a
|
# static archive - libprism.a
|
||||||
#
|
#
|
||||||
def test_librubyparser_a_contains_nothing_globally_visible
|
def test_libprism_a_contains_nothing_globally_visible
|
||||||
omit("librubyparser.a is not built") unless File.exist?(@librubyparser_a)
|
omit("libprism.a is not built") unless File.exist?(@libprism_a)
|
||||||
|
|
||||||
assert_empty(names(visible_global_objdump_symbols(@librubyparser_a)))
|
assert_empty(names(visible_global_objdump_symbols(@libprism_a)))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_librubyparser_a_contains_hidden_pm_symbols
|
def test_libprism_a_contains_hidden_pm_symbols
|
||||||
omit("librubyparser.a is not built") unless File.exist?(@librubyparser_a)
|
omit("libprism.a is not built") unless File.exist?(@libprism_a)
|
||||||
|
|
||||||
names(hidden_global_objdump_symbols(@librubyparser_a)).tap do |symbols|
|
names(hidden_global_objdump_symbols(@libprism_a)).tap do |symbols|
|
||||||
assert_includes(symbols, "pm_parse")
|
assert_includes(symbols, "pm_parse")
|
||||||
assert_includes(symbols, "pm_version")
|
assert_includes(symbols, "pm_version")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
# shared object - librubyparser.so
|
# shared object - libprism.so
|
||||||
#
|
#
|
||||||
def test_librubyparser_so_exports_only_the_necessary_functions
|
def test_libprism_so_exports_only_the_necessary_functions
|
||||||
omit("librubyparser.so is not built") unless File.exist?(@librubyparser_so)
|
omit("libprism.so is not built") unless File.exist?(@libprism_so)
|
||||||
|
|
||||||
names(global_nm_symbols(@librubyparser_so)).tap do |symbols|
|
names(global_nm_symbols(@libprism_so)).tap do |symbols|
|
||||||
assert_includes(symbols, "pm_parse")
|
assert_includes(symbols, "pm_parse")
|
||||||
assert_includes(symbols, "pm_version")
|
assert_includes(symbols, "pm_version")
|
||||||
end
|
end
|
||||||
names(local_nm_symbols(@librubyparser_so)).tap do |symbols|
|
names(local_nm_symbols(@libprism_so)).tap do |symbols|
|
||||||
assert_includes(symbols, "pm_encoding_shift_jis_isupper_char")
|
assert_includes(symbols, "pm_encoding_shift_jis_isupper_char")
|
||||||
end
|
end
|
||||||
# TODO: someone who uses this library needs to finish this test
|
# TODO: someone who uses this library needs to finish this test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user