- Timestamp:
- 10/21/10 10:23:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab/3.3/Tests/PluginDependenciesTest.cs
r4512 r4632 33 33 private static Dictionary<Assembly, Type> loadedPlugins; 34 34 private static Dictionary<string, string> pluginNames; 35 private static HashSet<string> extLibPluginNames; 35 36 36 37 // Use ClassInitialize to run code before running the first test in the class … … 38 39 public static void MyClassInitialize(TestContext testContext) { 39 40 loadedPlugins = PluginLoader.pluginAssemblies.ToDictionary(a => a, GetPluginFromAssembly); 40 pluginNames = loadedPlugins.ToDictionary(a => a.Key.GetName().FullName, 41 a => GetPluginName(a.Value)); 41 pluginNames = loadedPlugins.ToDictionary(a => a.Key.GetName().FullName, a => GetPluginName(a.Value)); 42 43 extLibPluginNames = new HashSet<string>(); 44 extLibPluginNames.Add("HeuristicLab.ALGLIB"); 45 extLibPluginNames.Add("HeuristicLab.LibSVM"); 46 extLibPluginNames.Add("HeuristicLab.log4net"); 47 extLibPluginNames.Add("HeuristicLab.Netron"); 48 extLibPluginNames.Add("HeuristicLab.ProtobufCS"); 49 extLibPluginNames.Add("HeuristicLab.SharpDevelop"); 50 extLibPluginNames.Add("HeuristicLab.WinFormsUI"); 42 51 } 43 52 … … 69 78 foreach (PluginDependencyAttribute attribute in pluginDependencies.Keys) { 70 79 string pluginDependencyName = pluginDependencies[attribute]; 71 if (pluginAssembly.GetReferencedAssemblies() 72 .All(a => pluginNames.ContainsKey(a.FullName) && pluginNames[a.FullName] != pluginDependencyName)) { 80 //do not check extlib plugins, because the transport assemblies are never referenced in the assemblies 81 if (extLibPluginNames.Contains(pluginDependencyName)) continue; 82 if (pluginAssembly.GetReferencedAssemblies().Where(a => pluginNames.ContainsKey(a.FullName)) 83 .All(a => pluginNames[a.FullName] != pluginDependencyName)) { 73 84 errorMessage.AppendLine("Unnecessary plugin dependency in " + GetPluginName(plugin) + " to " + pluginDependencyName + "."); 74 85 }
Note: See TracChangeset
for help on using the changeset viewer.