Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@345 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
20 changed files with 393 additions and 29 deletions
@ -1,11 +1,17 @@
@@ -1,11 +1,17 @@
|
||||
@echo off |
||||
echo Removing NUnit assemblies from the GAC |
||||
echo. |
||||
..\tools\gacutil2.exe /u ..\nunit.core.dll |
||||
echo Removing assemblies from the GAC |
||||
echo. |
||||
..\tools\gacutil2.exe /u ..\nunit.framework.dll |
||||
echo. |
||||
..\tools\gacutil2.exe /u ..\ICSharpCode.SharpZipLib.dll |
||||
echo. |
||||
..\tools\gacutil2.exe /u ..\tools\MbUnit\Refly.dll |
||||
..\tools\gacutil2.exe /u ..\tools\MbUnit\TestFu.dll |
||||
..\tools\gacutil2.exe /u ..\tools\MbUnit\QuickGraph.dll |
||||
..\tools\gacutil2.exe /u ..\tools\MbUnit\QuickGraph.Algorithms.dll |
||||
echo. |
||||
..\tools\gacutil2.exe /u ..\tools\MbUnit\MbUnit.Framework.dll |
||||
echo. |
||||
rem echo Uninstalling help system |
||||
rem cd help |
||||
rem call unregister.bat |
||||
|
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00 |
||||
# SharpDevelop 2.0.0.339 |
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MbUnitPad", "Project\MbUnitPad.csproj", "{B1CE28A0-04E8-490D-8256-E0C4D52C93C8}" |
||||
EndProject |
||||
Global |
||||
EndGlobal |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
using System.Reflection; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly: AssemblyTitle("MbUnitPad")] |
||||
[assembly: AssemblyDescription("Addin for SharpDevelop 2.0")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("SharpDevelop")] |
||||
[assembly: AssemblyCopyright("GNU General Public Licence")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly: AssemblyVersion("2.0.0.1")] |
||||
|
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
<AddIn name = "MbUnit-Addin" |
||||
author = "Daniel Grunwald" |
||||
copyright = "GNU General Public License" |
||||
url = "http://www.icsharpcode.net" |
||||
description = "Integrated MbUnit test runner for #Develop" |
||||
version = "1.0.0"> |
||||
|
||||
<Runtime> |
||||
<!-- MbUnit is not in the path, so we need to load it manually --> |
||||
<Import assembly = "../../../../bin/Tools/MbUnit/MbUnit.GUI.exe"/> |
||||
<Import assembly = "MbUnitPad.dll"/> |
||||
</Runtime> |
||||
|
||||
<Path name = "/SharpDevelop/Workbench/Pads"> |
||||
<Pad id = "MbUnitPad" |
||||
category = "Main" |
||||
title = "Unit Tests" |
||||
icon = "PadIcons.UnitTest" |
||||
shortcut = "Control|Alt|T" |
||||
class = "MbUnitPad.MbUnitPadContent"/> |
||||
</Path> |
||||
|
||||
<Path name = "/MbUnitPad/Toolbar"> |
||||
<Condition name = "CombineOpen" iscombineopen="True" action="Disable"> |
||||
<ToolbarItem id = "Reload" |
||||
icon = "Icons.16x16.BrowserRefresh" |
||||
tooltip = "${res:NUnitPad.NUnitPadContent.RefreshItem}" |
||||
class = "MbUnitPad.ReloadCommand"/> |
||||
<ToolbarItem id = "Run" |
||||
icon = "Icons.16x16.RunProgramIcon" |
||||
tooltip = "${res:NUnitPad.NUnitPadContent.RunItem}" |
||||
class = "MbUnitPad.RunTestsCommand"/> |
||||
</Condition> |
||||
</Path> |
||||
|
||||
<Path name = "/MbUnitPad/ContextMenu"> |
||||
</Path> |
||||
</AddIn> |
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>MbUnitPad</RootNamespace> |
||||
<AssemblyName>MbUnitPad</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{B1CE28A0-04E8-490D-8256-E0C4D52C93C8}</ProjectGuid> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\MbUnitPad\</OutputPath> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||
<OutputPath>bin\Release\</OutputPath> |
||||
<Optimize>true</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="MbUnit.Framework"> |
||||
<HintPath>..\..\..\..\Tools\MbUnit\MbUnit.Framework.dll</HintPath> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="MbUnit.GUI"> |
||||
<HintPath>..\..\..\..\Tools\MbUnit\MbUnit.GUI.exe</HintPath> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="MbUnitPad.addin"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<Compile Include="Src\MbUnitPad.cs" /> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<Compile Include="Src\MbUnitCommands.cs" /> |
||||
<Compile Include="Src\TestTreeView.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " /> |
||||
</Project> |
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using MbUnit.Forms; |
||||
|
||||
namespace MbUnitPad |
||||
{ |
||||
public class ReloadCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
MbUnitPadContent.Instance.ReloadAssemblyList(); |
||||
} |
||||
} |
||||
|
||||
public class RunTestsCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
MbUnitPadContent.Instance.TreeView.ThreadedRunTests(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,127 @@
@@ -0,0 +1,127 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using MbUnit.Forms; |
||||
|
||||
namespace MbUnitPad |
||||
{ |
||||
public class MbUnitPadContent : AbstractPadContent |
||||
{ |
||||
public static MbUnitPadContent Instance { |
||||
get { |
||||
PadDescriptor descriptor = WorkbenchSingleton.Workbench.GetPad(typeof(MbUnitPadContent)); |
||||
return (MbUnitPadContent)descriptor.PadContent; |
||||
} |
||||
} |
||||
|
||||
public static void BringToFront() |
||||
{ |
||||
WorkbenchSingleton.Workbench.GetPad(typeof(MbUnitPadContent)).BringPadToFront(); |
||||
} |
||||
|
||||
TestTreeView treeView; |
||||
Control ctl; |
||||
|
||||
public TestTreeView TreeView { |
||||
get { |
||||
return treeView; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Creates a new TestPad object
|
||||
/// </summary>
|
||||
public MbUnitPadContent() |
||||
{ |
||||
ctl = new Panel(); |
||||
treeView = new TestTreeView(); |
||||
treeView.Dock = DockStyle.Fill; |
||||
|
||||
ctl.Controls.Add(treeView); |
||||
ToolStrip toolStrip = ToolbarService.CreateToolStrip(this, "/MbUnitPad/Toolbar"); |
||||
toolStrip.GripStyle = ToolStripGripStyle.Hidden; |
||||
ctl.Controls.Add(toolStrip); |
||||
|
||||
ProjectService.SolutionClosed += OnSolutionClosed; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Cleans up all used resources
|
||||
/// </summary>
|
||||
public override void Dispose() |
||||
{ |
||||
ProjectService.SolutionClosed -= OnSolutionClosed; |
||||
ctl.Dispose(); |
||||
} |
||||
|
||||
void OnSolutionClosed(object sender, EventArgs e) |
||||
{ |
||||
LoggingService.Info("Solution closed"); |
||||
treeView.RemoveAssemblies(); |
||||
} |
||||
|
||||
public void ReloadAssemblyList() |
||||
{ |
||||
treeView.RemoveAssemblies(); |
||||
foreach (IProject project in ProjectService.OpenSolution.Projects) { |
||||
bool referenceFound = false; |
||||
foreach (ProjectItem item in project.Items) { |
||||
ReferenceProjectItem reference = item as ReferenceProjectItem; |
||||
if (reference != null) { |
||||
string include = reference.Include; |
||||
if (include.IndexOf(',') > 0) { |
||||
include = include.Substring(0, include.IndexOf(',')); |
||||
} |
||||
if (include.Length > 5) { |
||||
if (include.Substring(include.Length - 4).Equals(".dll", StringComparison.OrdinalIgnoreCase)) |
||||
include = include.Substring(0, include.Length - 4); |
||||
} |
||||
if (string.Equals(include, "nunit.framework", StringComparison.InvariantCultureIgnoreCase) |
||||
|| string.Equals(include, "mbunit.framework", StringComparison.InvariantCultureIgnoreCase)) |
||||
{ |
||||
referenceFound = true; |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
if (referenceFound) { |
||||
string outputAssembly = project.OutputAssemblyFullPath; |
||||
LoggingService.Debug("MbUnitPad: Load " + outputAssembly); |
||||
try { |
||||
treeView.AddAssembly(outputAssembly); |
||||
} catch (Exception e) { |
||||
LoggingService.Warn("MbUnitPad load error", e); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// The <see cref="System.Windows.Forms.Control"/> representing the pad
|
||||
/// </summary>
|
||||
public override Control Control { |
||||
get { |
||||
return ctl; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Refreshes the pad
|
||||
/// </summary>
|
||||
public override void RedrawContent() |
||||
{ |
||||
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
using MbUnit.Forms; |
||||
using MbUnit.Core.Remoting; |
||||
|
||||
namespace MbUnitPad |
||||
{ |
||||
public class TestTreeView : ReflectorTreeView |
||||
{ |
||||
public TestTreeView() |
||||
{ |
||||
TypeTree.ContextMenu = null; |
||||
TypeTree.ContextMenuStrip = MenuService.CreateContextMenu(this, "/MbUnitPad/ContextMenu"); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Default MbUnit-GUI doesn't use shadow copy, we have to override that behaviour.
|
||||
/// </summary>
|
||||
public new void AddAssembly(string file) |
||||
{ |
||||
if (this.TestDomains.ContainsTestAssembly(file)) { |
||||
throw new ApplicationException(string.Format("The file {0} is already loaded.", file)); |
||||
} else { |
||||
TreeTestDomain domain = this.TestDomains.Add(file); |
||||
domain.ShadowCopyFiles = true; |
||||
this.TestDomains.Watcher.Start(); |
||||
} |
||||
} |
||||
|
||||
protected override void MessageOnStatusBar(string message, object[] args) |
||||
{ |
||||
if (message.Length == 0) { |
||||
StatusBarService.SetMessage(null); |
||||
} else { |
||||
string msg = string.Format(message, args); |
||||
LoggingService.Debug(msg); |
||||
StatusBarService.SetMessage("MbUnit: " + msg); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<configuration> |
||||
<startup> |
||||
<supportedRuntime version="v2.0.50215" /> |
||||
</startup> |
||||
</configuration> |
Loading…
Reference in new issue