xref: /netbsd-src/external/gpl3/gcc.old/dist/libphobos/testsuite/libphobos.shared/libloaddep.d (revision 627f7eb200a4419d89b531d55fccd2ee3ffdcde0)
1 import core.runtime, core.sys.posix.dlfcn;
2 
3 extern(C) alias RunTests = int function();
4 
runDepTests(const char * name)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 }
14