Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4632


Ignore:
Timestamp:
10/21/10 10:23:14 (14 years ago)
Author:
mkommend
Message:

Corrected PluginDependenciesTest to check unnecessary dependencies (ticket #1239).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab/3.3/Tests/PluginDependenciesTest.cs

    r4512 r4632  
    3333    private static Dictionary<Assembly, Type> loadedPlugins;
    3434    private static Dictionary<string, string> pluginNames;
     35    private static HashSet<string> extLibPluginNames;
    3536
    3637    // Use ClassInitialize to run code before running the first test in the class
     
    3839    public static void MyClassInitialize(TestContext testContext) {
    3940      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");
    4251    }
    4352
     
    6978        foreach (PluginDependencyAttribute attribute in pluginDependencies.Keys) {
    7079          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)) {
    7384            errorMessage.AppendLine("Unnecessary plugin dependency in " + GetPluginName(plugin) + " to " + pluginDependencyName + ".");
    7485          }
Note: See TracChangeset for help on using the changeset viewer.