-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Describe the problem you are trying to solve
The integration test for my cdylib doesn't have a clean way to know where to find the library file itself. My cdylib is actually a PostgreSQL extension (essentially a plugin), so the only way to test it is by actually running PostgreSQL and loading the library. To do that, the integration test needs to know the location of the library file (e.g. ...../target/debug/libxyz.so).
Describe the solution you'd like
I want cargo to set a new environment variable, CARGO_LIB_CDYLIB_<name>, similar to CARGO_BIN_EXE_<name>, that would allow the integration test to find the library in a platform-independent way (and that works regardless of the profile used to build it).
I would like this variable always available, not just for test runs. The reason is that I also have a [[bin]] target that installs the library into PostgreSQL's lib directory (kind of like doing make install for a postgresql extension written in C), so that it can be easily installed.
Notes
Unit tests are not practical in my case, because the plugin accesses lots of Postgres APIs that require a running server.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status