libphobos/testsuite/libphobos.shared/libloaddep.d
raw| 1 | import core.runtime, core.sys.posix.dlfcn; |
| 2 | |
| 3 | extern(C) alias RunTests = int function(); |
| 4 | |
| 5 | extern(C) int runDepTests(const char* name) |
| 6 | { |
| 7 | auto h = rt_loadLibrary(name); |
| 8 | if (h is null) return false; |
| 9 | auto runTests = cast(RunTests).dlsym(h, "runTests"); |
| 10 | assert(runTests !is null); |
| 11 | if (!runTests()) return false; |
| 12 | return rt_unloadLibrary(h); |
| 13 | } |