public UnitTest CreateUnitTest(CombineEntry entry)
 {
     if (entry is MonoProject) {
         MonoProject project = (MonoProject) entry;
         return project.GetTestSuite ();
     } else
         return null;
 }
 public CombineConfigurationEntry AddEntry(CombineEntry combine)
 {
     CombineConfigurationEntry conf = new CombineConfigurationEntry();
     conf.Entry = combine;
     conf.ConfigurationName = combine.ActiveConfiguration != null ? combine.ActiveConfiguration.Name : String.Empty;
     conf.Build = true;
     configurations.Add(conf);
     return conf;
 }
 public UnitTest CreateUnitTest(CombineEntry entry)
 {
     if (entry is Combine)
         return CombineTestGroup.CreateTest ((Combine)entry);
     if (entry is DotNetProject)
         return NUnitProjectTestSuite.CreateTest ((Project)entry);
     if (entry is NUnitAssemblyGroupProject)
         return ((NUnitAssemblyGroupProject)entry).RootTest;
     return null;
 }
Ejemplo n.º 4
0
 public void RemoveEntry(CombineEntry entry)
 {
     RemoveReferencesToProject (entry as Project);
     Entries.Remove (entry);
 }
Ejemplo n.º 5
0
 protected UnitTest(string name, CombineEntry ownerCombineEntry)
 {
     this.name = name;
     this.ownerCombineEntry = ownerCombineEntry;
     ownerCombineEntry.ActiveConfigurationChanged += new ConfigurationEventHandler (OnConfugurationChanged);
 }
        public void WriteFile(string file, CombineEntry entry, IProgressMonitor monitor)
        {
            IFileFormat format = entry.FileFormat;
            if (format == null) {
                if (entry is Project) format = defaultProjectFormat;
                else if (entry is Combine) format = defaultCombineFormat;
                else format = formatManager.GetFileFormatForObject (entry);

                if (format == null)
                    throw new InvalidOperationException ("FileFormat not provided for combine entry '" + entry.Name + "'");
                entry.FileName = format.GetValidFormatName (file);
            }
            entry.FileName = file;
            format.WriteFile (entry.FileName, entry, monitor);
        }
        public IAsyncOperation Rebuild(CombineEntry entry)
        {
            if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) return currentBuildOperation;

            entry.Clean ();
            return Build (entry);
        }
        public IAsyncOperation Debug(CombineEntry entry)
        {
            if (Runtime.DebuggingService == null) {
                return NullAsyncOperation.Failure;
            }

            if (currentRunOperation != null && !currentRunOperation.IsCompleted) return currentRunOperation;

            guiHelper.SetWorkbenchContext (WorkbenchContext.Debug);

            IProgressMonitor monitor = new MessageDialogProgressMonitor ();
            ExecutionContext context = new ExecutionContext (Runtime.DebuggingService.GetExecutionHandlerFactory (), Runtime.TaskService);

            Runtime.DispatchService.ThreadDispatch (new StatefulMessageHandler (DebugCombineEntryAsync), new object[] {entry, monitor, context});
            currentRunOperation = monitor.AsyncOperation;
            return currentRunOperation;
        }
 public bool Contains(CombineEntry entry)
 {
     return IndexOf (entry) != -1;
 }
 public void Load(CombineEntry entry)
 {
     if (entry is Project)
         LoadProjectDatabase ((Project)entry);
     else if (entry is Combine)
         LoadCombineDatabases ((Combine)entry);
 }
Ejemplo n.º 11
0
 protected UnitTestGroup(string name, CombineEntry ownerCombineEntry)
     : base(name, ownerCombineEntry)
 {
 }
Ejemplo n.º 12
0
 public UnitTest BuildTest(CombineEntry entry)
 {
     foreach (ITestProvider p in providers) {
         UnitTest t = p.CreateUnitTest (entry);
         if (t != null) return t;
     }
     return null;
 }
Ejemplo n.º 13
0
        void GetAllConfigurations(CombineEntry entry, ArrayList names)
        {
            foreach (IConfiguration conf in Configurations)
                if (!names.Contains (conf.Name))
                    names.Add (conf.Name);

            if (entry is Combine) {
                foreach (CombineEntry ce in ((Combine)entry).Entries)
                    GetAllConfigurations (ce, names);
            }
        }
Ejemplo n.º 14
0
        internal void NotifyEntryRemoved(CombineEntry entry)
        {
            Project pce = entry as Project;
            if (pce != null) {
                pce.FileRemovedFromProject -= fileRemovedFromProjectHandler;
                pce.FileAddedToProject -= fileAddedToProjectHandler;
                pce.FileChangedInProject -= fileChangedInProjectHandler;
                pce.FileRenamedInProject -= fileRenamedInProjectHandler;
                pce.ReferenceRemovedFromProject -= referenceRemovedFromProjectHandler;
                pce.ReferenceAddedToProject -= referenceAddedToProjectHandler;
            }
            else {
                Combine cce = entry as Combine;
                if (cce != null) {
                    cce.FileRemovedFromProject -= fileRemovedFromProjectHandler;
                    cce.FileAddedToProject -= fileAddedToProjectHandler;
                    cce.FileChangedInProject -= fileChangedInProjectHandler;
                    cce.FileRenamedInProject -= fileRenamedInProjectHandler;
                    cce.ReferenceRemovedFromProject -= referenceRemovedFromProjectHandler;
                    cce.ReferenceAddedToProject -= referenceAddedToProjectHandler;
                }
            }

            // remove execute definition
            CombineExecuteDefinition removeExDef = null;
            foreach (CombineExecuteDefinition exDef in CombineExecuteDefinitions) {
                if (exDef.Entry == entry) {
                    removeExDef = exDef;
                    break;
                }
            }
            CombineExecuteDefinitions.Remove (removeExDef);

            // remove configuration
            foreach (CombineConfiguration dentry in Configurations)
                dentry.RemoveEntry (entry);

            OnEntryRemoved (new CombineEntryEventArgs (entry));
        }
Ejemplo n.º 15
0
        internal void NotifyEntryAdded(CombineEntry entry)
        {
            if (StartupEntry == null)
                StartupEntry = entry;

            if (Configurations.Count == 0) {
                foreach (IConfiguration pconf in entry.Configurations) {
                    if (pconf.Name == null)
                        continue;
                    CombineConfiguration cconf = new CombineConfiguration (pconf.Name);
                    Configurations.Add (cconf);
                    if (ActiveConfiguration == null)
                        ActiveConfiguration = cconf;
                }
            }

            foreach (CombineConfiguration conf in Configurations)
                conf.AddEntry (entry);

            combineExecuteDefinitions.Add (new CombineExecuteDefinition (entry, EntryExecuteType.None));

            if (eventsAllowed)
                OnEntryAdded (new CombineEntryEventArgs (entry));

            if (entry is Project)
            {
                Project project = entry as Project;
                project.FileRemovedFromProject += fileRemovedFromProjectHandler;
                project.FileAddedToProject += fileAddedToProjectHandler;
                project.FileChangedInProject += fileChangedInProjectHandler;
                project.FileRenamedInProject += fileRenamedInProjectHandler;
                project.ReferenceRemovedFromProject += referenceRemovedFromProjectHandler;
                project.ReferenceAddedToProject += referenceAddedToProjectHandler;
            }
            else if (entry is Combine)
            {
                Combine combine = entry as Combine;
                combine.FileRemovedFromProject += fileRemovedFromProjectHandler;
                combine.FileAddedToProject += fileAddedToProjectHandler;
                combine.FileChangedInProject += fileChangedInProjectHandler;
                combine.FileRenamedInProject += fileRenamedInProjectHandler;
                combine.ReferenceRemovedFromProject += referenceRemovedFromProjectHandler;
                combine.ReferenceAddedToProject += referenceAddedToProjectHandler;
            }
        }
 public ConfigurationEventArgs(CombineEntry entry, IConfiguration configuration)
     : base(entry)
 {
     this.configuration = configuration;
 }
        public IAsyncOperation Build(CombineEntry entry)
        {
            if (currentBuildOperation != null && !currentBuildOperation.IsCompleted) return currentBuildOperation;

            BeforeCompile (entry);

            IProgressMonitor monitor = Runtime.TaskService.GetBuildProgressMonitor ();
            Runtime.DispatchService.ThreadDispatch (new StatefulMessageHandler (BuildCombineEntryAsync), new object[] {entry, monitor});
            currentBuildOperation = monitor.AsyncOperation;
            return currentBuildOperation;
        }
 public int IndexOf(CombineEntry entry)
 {
     return list.IndexOf (entry);
 }
        public IAsyncOperation Execute(CombineEntry entry)
        {
            if (currentRunOperation != null && !currentRunOperation.IsCompleted) return currentRunOperation;

            IProgressMonitor monitor = new MessageDialogProgressMonitor ();
            ExecutionContext context = new ExecutionContext (new DefaultExecutionHandlerFactory (), Runtime.TaskService);

            Runtime.DispatchService.ThreadDispatch (new StatefulMessageHandler (ExecuteCombineEntryAsync), new object[] {entry, monitor, context});
            currentRunOperation = monitor.AsyncOperation;
            return currentRunOperation;
        }
 public void Remove(CombineEntry entry)
 {
     list.Remove (entry);
     if (parentCombine != null) {
         entry.SetParentCombine (null);
         parentCombine.NotifyEntryRemoved (entry);
     }
 }
        public void ShowOptions(CombineEntry entry)
        {
            if (entry is Project) {
                Project selectedProject = (Project) entry;

                IAddInTreeNode generalOptionsNode          = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/ProjectOptions/GeneralOptions");
                IAddInTreeNode configurationPropertiesNode = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/ProjectOptions/ConfigurationProperties");

                ProjectOptionsDialog optionsDialog = new ProjectOptionsDialog ((Gtk.Window)WorkbenchSingleton.Workbench, selectedProject, generalOptionsNode, configurationPropertiesNode);
                if (optionsDialog.Run() == (int)Gtk.ResponseType.Ok) {
                    selectedProject.NeedsBuilding = true;
                }
            } else if (entry is Combine) {
                Combine combine = (Combine) entry;

                IAddInTreeNode generalOptionsNode          = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/CombineOptions/GeneralOptions");
                IAddInTreeNode configurationPropertiesNode = AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/CombineOptions/ConfigurationProperties");

                CombineOptionsDialog optionsDialog = new CombineOptionsDialog ((Gtk.Window)WorkbenchSingleton.Workbench, combine, generalOptionsNode, configurationPropertiesNode);
                optionsDialog.Run ();
            }

            SaveCombine ();
        }
 public void Add(CombineEntry entry)
 {
     list.Add (entry);
     if (parentCombine != null) {
         entry.SetParentCombine (parentCombine);
         parentCombine.NotifyEntryAdded (entry);
     }
 }
        void BeforeCompile(CombineEntry entry)
        {
            DoBeforeCompileAction();

            if (entry is Project) {
                Project project = (Project) entry;

                Runtime.StringParserService.Properties["Project"] = project.Name;

                string outputDir = ((AbstractProjectConfiguration)project.ActiveConfiguration).OutputDirectory;
                try {
                    DirectoryInfo directoryInfo = new DirectoryInfo(outputDir);
                    if (!directoryInfo.Exists) {
                        directoryInfo.Create();
                    }
                } catch (Exception e) {
                    throw new ApplicationException("Can't create project output directory " + outputDir + " original exception:\n" + e.ToString());
                }
            }
        }
 public CombineEntryRenamedEventArgs(CombineEntry node, string oldName, string newName)
     : base(node)
 {
     this.oldName = oldName;
     this.newName = newName;
 }
Ejemplo n.º 25
0
 void GetOwnerCombineEntry(UnitTest t, out CombineEntry c, out string path)
 {
     if (OwnerCombineEntry != null) {
         c = OwnerCombineEntry;
         path = "";
     } else if (parent != null) {
         parent.GetOwnerCombineEntry (t, out c, out path);
         if (c == null) return;
         if (path.Length > 0)
             path += "/" + t.Name;
         else
             path = t.Name;
     } else {
         c = null;
         path = null;
     }
 }
 protected override void Run()
 {
     entry = Runtime.ProjectService.CurrentSelectedCombineEntry;
     IAsyncOperation op = Runtime.ProjectService.Build (entry);
     op.Completed += new OperationHandler (ExecuteCombine);
 }
        public void RemoveEntry(CombineEntry entry)
        {
            CombineConfigurationEntry removeConfig = null;

            foreach (CombineConfigurationEntry config in configurations) {
                if (config.Entry == entry) {
                    removeConfig = config;
                    break;
                }
            }

            Debug.Assert(removeConfig != null);
            configurations.Remove(removeConfig);
        }
 void AddClasses(ITreeBuilder builder, CombineEntry entry)
 {
     if (entry is Combine) {
         foreach (CombineEntry e in ((Combine)entry).Entries)
             AddClasses (builder, e);
     } else if (entry is Project) {
         ProjectNodeBuilder.BuildChildNodes (builder, entry as Project);
     }
 }
 public NUnitAssemblyTestSuite(string name, CombineEntry ownerCombineEntry)
     : base(name, ownerCombineEntry)
 {
 }
 public CombineExecuteDefinition(CombineEntry entry, EntryExecuteType type)
 {
     Entry = entry;
     this.type  = type;
 }