Exemplo n.º 1
0
static Modules getModules(const string& libraryName, const string& moduleName)
{
  Modules modules;
  Modules::Library* library = modules.add_libraries();
  library->set_file(os::libraries::expandName(libraryName));
  library->add_modules(moduleName);
  return modules;
}
Exemplo n.º 2
0
 ModuleTest()
   : module(None())
 {
   Modules::Library* library = defaultModules.add_libraries();
   library->set_file(path::join(
       libraryDirectory,
       os::libraries::expandName(DEFAULT_MODULE_LIBRARY_NAME)));
   library->add_modules(DEFAULT_MODULE_NAME);
 }
Exemplo n.º 3
0
// Test that loading a duplicate module fails.
TEST_F(ModuleTest, DuplicateModule)
{
  // Add duplicate module.
  Modules::Library* library = defaultModules.add_libraries();
  library->set_name(DEFAULT_MODULE_LIBRARY_NAME);
  library->add_modules(DEFAULT_MODULE_NAME);

  EXPECT_ERROR(ModuleManager::load(defaultModules));
}
Exemplo n.º 4
0
// Test that a module library gets loaded with just library name if
// found in LD_LIBRARY_PATH.
TEST_F(ModuleTest, LibraryNameWithExtension)
{
  Modules modules;
  Modules::Library* library = modules.add_libraries();
  library->set_file(os::libraries::expandName(DEFAULT_MODULE_LIBRARY_NAME));
  library->add_modules(DEFAULT_MODULE_NAME);

  EXPECT_SOME(ModuleManager::load(modules));
}