I've written some unit tests to make sure that the drivers work when libdbi is loaded via a plugin of any time that is linked to it.
I hope they will find their way into a release of libdbi-drivers. They will likely be included as part of the packaging of libdbi-drivers in Ubuntu and Debian soon.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
I'd be happy to include such tests. However, which version are your tests based on? libdbi has changed quite a bit since the last official release, and libdbi-drivers has an entirely new test kit. Unless your tests already reflect these changes, would you be willing to update your tests for the current cvs revisions? Only then we'd be able to include them in the upcoming (real soon now, TM) releases.
regards,
Markus
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hi Markus, the code I wrote was actually just a little C program that loads the libdbi linked binary as a plugin. I'll take a look at the new test suite refactor and try to get you a full patch ASAP.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Ok, I spent some time on this, and essentially the desire is to test to make sure that when the build is done with libdbi linked to the drivers (the default build mode), dlopen() with RTLD_GLOBAL works, and to report on whether or not RTLD_NOW works (but not fail the build if it fails, as this may vary depending on system linking behavior).
My automake-fu is pretty weak, so I don't know how portable the patch is, but here is what I've got. One thing that was broken was compiling against a libdbi that is not in the regular system include/lib dirs. So this also fixes some of that, though I think that should probably be reported/fixed in another bug ticket. It still doesn't work right with --disable-libdbi , which is, I think, an issue with configure.in, I'll try and report if I have more time later on.
View and moderate all "feature-requests Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Feature Requests"
Hrm, I am not sure how to attach another file to this issue.
http://spamaps.org/files/libdbi-drivers-add-dlopen-checks.patch
Is the patch.
You must also do
chmod +x tests/test_libdbi.sh
I'm sorry that it took so long to get back to this patch, but now I finally managed to test your code. I had to make a minor adjustment though, so please check whether this still works on Debian/Ubuntu. The change is in tests/Makefile.am. You used:
test_dbi_dlopen_LDFLAGS = -ldl
I had to change this to:
test_dbi_dlopen_LDFLAGS = @LIBADD_LIBDBI@
FreeBSD's C library provides the dlopen functionality, so there is no separate libdl on this platform. LIBADD_LIBDBI should, in theory, take care of this.
regards,
Markus