ros / class_loader

ROS-independent library for dynamic class (i.e. plugin) introspection and loading from runtime libraries
http://www.ros.org/wiki/class_loader
35 stars 95 forks source link

Increase coverage with a graveyard behavior test and unmanaged instance test #159

Closed brawner closed 4 years ago

brawner commented 4 years ago

Reviving symbols from the graveyard is currently not covered in unit tests, at least on linux and Windows. It may be covered on OSX. I think this is mostly due to the fact that RTLD_LOCAL is the default for dlopen() on linux according to https://linux.die.net/man/3/dlopen. On OSX it appears the default is [RTLD_GLOBAL] (http://mirror.informatimago.com/next/developer.apple.com/documentation/Darwin/Reference/ManPages/man3/dlopen.3.html). This utility does not exist on Windows, so this feature will remain unused/untested on Windows.

The added test, just forces it to be loaded using RTLD_GLOBAL before it is loaded by class_loader. Because I use dlopen directly, I have separated the namespace of the test to force the static initialization of ClassLoader to be isolated from other tests. Likewise, I use a new test plugin library so that it is isolated from other tests.

Signed-off-by: Stephen Brawner brawner@gmail.com

brawner commented 4 years ago

Running tests again:

brawner commented 4 years ago

Just updating the QD

nuclearsandwich commented 4 years ago

Merging this PR based on the approvals above. I haven't had the time to review myself but I don't feel the need to based on the trust I have in the contributors and reviewers.