Home | History | Annotate | Line # | Download | only in libphobos.shared
libloaddep.d revision 1.1
      1  1.1  mrg import core.runtime, core.sys.posix.dlfcn;
      2  1.1  mrg 
      3  1.1  mrg extern(C) alias RunTests = int function();
      4  1.1  mrg 
      5  1.1  mrg extern(C) int runDepTests(const char* name)
      6  1.1  mrg {
      7  1.1  mrg     auto h = rt_loadLibrary(name);
      8  1.1  mrg     if (h is null) return false;
      9  1.1  mrg     auto runTests = cast(RunTests).dlsym(h, "runTests");
     10  1.1  mrg     assert(runTests !is null);
     11  1.1  mrg     if (!runTests()) return false;
     12  1.1  mrg     return rt_unloadLibrary(h);
     13  1.1  mrg }
     14