Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/vbnet@5955 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
772 changed files with 41585 additions and 18632 deletions
@ -1,32 +1,56 @@ |
|||||||
<DockingManager version="1.2.1"> |
<DockingManager version="1.3.0"> |
||||||
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1076,904.08" Orientation="Vertical"> |
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="0,0" Orientation="Vertical"> |
||||||
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1257.04,717.08" Orientation="Horizontal"> |
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1280,670" Orientation="Horizontal"> |
||||||
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,717.08" Anchor="Left"> |
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,670" ID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" Anchor="Left" IsAutoHidden="false" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Project_ProjectBrowserPad" AutoHide="false" /> |
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1280,670" Orientation="Vertical"> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ToolsPad" AutoHide="false" /> |
<ResizingPanel ResizeWidth="0.5*" ResizeHeight="*" EffectiveSize="1280,476" Orientation="Horizontal"> |
||||||
</DockablePane> |
<DockablePane ResizeWidth="211" ResizeHeight="*" EffectiveSize="211,476" ID="58b37d24-baec-4f73-9fc9-9d65d0e17d4f" Anchor="Left" IsAutoHidden="false"> |
||||||
<DocumentPanePlaceHolder /> |
<DockableContent Name="ICSharpCode_SharpDevelop_Project_ProjectBrowserPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Left" State="Docked" ContainerPaneID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" /> |
||||||
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,717.08" Anchor="Right"> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ToolsPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Left" State="Docked" ContainerPaneID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ClassBrowser_ClassBrowserPad" AutoHide="true" /> |
</DockablePane> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_PropertyPad" AutoHide="true" /> |
<DocumentPaneResizingPanel ResizeWidth="0.142857142857143*" ResizeHeight="*" EffectiveSize="807,476" Orientation="Vertical"> |
||||||
</DockablePane> |
<DocumentPane IsMain="true" /> |
||||||
</ResizingPanel> |
</DocumentPaneResizingPanel> |
||||||
<ResizingPanel ResizeWidth="*" ResizeHeight="183" EffectiveSize="1257.04,183" Orientation="Horizontal"> |
<DockablePane ResizeWidth="250" ResizeHeight="*" EffectiveSize="250,476" ID="561f0563-1c7e-4618-a813-871b21848f4e" Anchor="Right" IsAutoHidden="false"> |
||||||
<DockablePane ResizeWidth="0.516044590840343*" ResizeHeight="150" EffectiveSize="646.624514106583,183" Anchor="Bottom"> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ClassBrowser_ClassBrowserPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Right" State="Docked" ContainerPaneID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ErrorListPad" AutoHide="false" FloatingWindowSize="1280,150" /> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_PropertyPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Right" State="Docked" ContainerPaneID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_CompilerMessageView" AutoHide="false" FloatingWindowSize="1280,150" /> |
</DockablePane> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_RunningThreadsPad" AutoHide="false" FloatingWindowSize="128,904.08" /> |
</ResizingPanel> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_LocalVarPad" AutoHide="false" FloatingWindowSize="123,904.08" /> |
<ResizingPanel ResizeWidth="*" ResizeHeight="188" EffectiveSize="1280,188" Orientation="Horizontal"> |
||||||
</DockablePane> |
<DockablePane ResizeWidth="0.244949068363451*" ResizeHeight="188" EffectiveSize="624.130226190072,188" ID="77255f09-b21a-490d-83a7-af0d08551048" Anchor="Bottom" IsAutoHidden="false"> |
||||||
<DockablePane ResizeWidth="0.483955409159657*" ResizeHeight="*" EffectiveSize="606.415485893417,183" Anchor="Bottom"> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_CompilerMessageView" FloatingWindowSize="250,400" ChildIndex="1" Width="650" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="3963d998-99b8-4c60-9211-f99636755607" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_CallStackPad" AutoHide="false" FloatingWindowSize="640,904.08" /> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ErrorListPad" FloatingWindowSize="250,400" ChildIndex="0" Width="1280" Height="147" Anchor="Bottom" State="Docked" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_ConsolePad" AutoHide="false" FloatingWindowSize="175,904.08" /> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_RunningThreadsPad" FloatingWindowSize="250,400" ChildIndex="2" Width="624" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_WatchPad" AutoHide="false" FloatingWindowSize="200,904.08" /> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_LocalVarPad" FloatingWindowSize="250,400" ChildIndex="3" Width="624" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
</DockablePane> |
</DockablePane> |
||||||
|
<DockablePane ResizeWidth="0.255050931636549*" ResizeHeight="*" EffectiveSize="649.869773809928,188" ID="3963d998-99b8-4c60-9211-f99636755607" Anchor="Bottom" IsAutoHidden="false"> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_CallStackPad" FloatingWindowSize="250,400" ChildIndex="3" Width="1074" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_WatchPad" FloatingWindowSize="250,400" ChildIndex="4" Width="624" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_ConsolePad" FloatingWindowSize="250,400" ChildIndex="4" Width="624" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
|
</DockablePane> |
||||||
|
</ResizingPanel> |
||||||
|
</ResizingPanel> |
||||||
|
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,670" ID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" Anchor="Right" IsAutoHidden="false" /> |
||||||
</ResizingPanel> |
</ResizingPanel> |
||||||
</ResizingPanel> |
</ResizingPanel> |
||||||
<Hidden> |
<Hidden> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_TaskListPad" AutoHide="false"/> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_OutlinePad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Left" State="Docked" ContainerPaneID="c22bd528-c3d5-45c7-a0bd-729b614beb3f" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_FileScout" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Left" State="Docked" ContainerPaneID="c22bd528-c3d5-45c7-a0bd-729b614beb3f" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Editor_Search_SearchResultsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Bookmarks_BookmarkPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_PythonBinding_PythonConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_RubyBinding_RubyConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_CodeCoverage_CodeCoveragePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_DefinitionViewPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="Grunwald_BooBinding_InteractiveInterpreterPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="FSharpBinding_FSharpInteractive" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_WixBinding_SetupDialogListPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_BreakPointsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_LoadedModulesPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_Data_Addin_Pad_DatabasesTreeViewPad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Right" State="Docked" ContainerPaneID="d9952f44-e5ad-47c0-add8-beb79f601550" /> |
||||||
|
<DockableContent Name="ICSharpCode_UnitTesting_UnitTestsPad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Right" State="Docked" ContainerPaneID="d9952f44-e5ad-47c0-add8-beb79f601550" /> |
||||||
|
<DockableContent Name="ICSharpCode_XmlEditor_XPathQueryPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="ae0442d7-e21f-4495-ba4a-45949a882be3" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_TaskListPad" FloatingWindowSize="250,400" ChildIndex="1" Width="624" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
</Hidden> |
</Hidden> |
||||||
<Windows /> |
<Windows /> |
||||||
</DockingManager> |
</DockingManager> |
@ -1,22 +1,49 @@ |
|||||||
<DockingManager version="1.2.1"> |
<DockingManager version="1.3.0"> |
||||||
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="0,0" Orientation="Horizontal"> |
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="0,0" Orientation="Vertical"> |
||||||
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,904.08" Anchor="Left"> |
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1280,670" Orientation="Horizontal"> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Project_ProjectBrowserPad" AutoHide="false" /> |
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,670" ID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" Anchor="Left" IsAutoHidden="false"> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ToolsPad" AutoHide="false" /> |
<DockableContent Name="ICSharpCode_SharpDevelop_Project_ProjectBrowserPad" FloatingWindowSize="250,400" /> |
||||||
</DockablePane> |
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ToolsPad" FloatingWindowSize="250,400" /> |
||||||
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="872,904.08" Orientation="Vertical"> |
</DockablePane> |
||||||
<DocumentPanePlaceHolder /> |
<ResizingPanel ResizeWidth="0.142857142857143*" ResizeHeight="*" EffectiveSize="868,670" Orientation="Vertical"> |
||||||
<DockablePane ResizeWidth="*" ResizeHeight="150" EffectiveSize="872,150" Anchor="Bottom"> |
<DocumentPaneResizingPanel ResizeWidth="0.5*" ResizeHeight="*" EffectiveSize="868,476" Orientation="Vertical"> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ErrorListPad" AutoHide="false" FloatingWindowSize="1280,150" /> |
<DocumentPane IsMain="true" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_TaskListPad" AutoHide="false" FloatingWindowSize="1280,150" /> |
</DocumentPaneResizingPanel> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_CompilerMessageView" AutoHide="false" FloatingWindowSize="1280,150" /> |
<DockablePane ResizeWidth="*" ResizeHeight="188" EffectiveSize="868,188" ID="77255f09-b21a-490d-83a7-af0d08551048" Anchor="Bottom" IsAutoHidden="false"> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ErrorListPad" FloatingWindowSize="250,400" ChildIndex="0" Width="1280" Height="147" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_TaskListPad" FloatingWindowSize="250,400" ChildIndex="0" Width="1280" Height="147" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_CompilerMessageView" FloatingWindowSize="250,400" ChildIndex="0" Width="1280" Height="147" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
</DockablePane> |
||||||
|
</ResizingPanel> |
||||||
|
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,670" ID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" Anchor="Right" IsAutoHidden="false"> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ClassBrowser_ClassBrowserPad" FloatingWindowSize="250,400" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_PropertyPad" FloatingWindowSize="250,400" /> |
||||||
</DockablePane> |
</DockablePane> |
||||||
</ResizingPanel> |
</ResizingPanel> |
||||||
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,904.08" Anchor="Right"> |
<DockablePane ResizeWidth="*" ResizeHeight="147" EffectiveSize="1280,147" ID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" Anchor="Bottom" IsAutoHidden="false" /> |
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ClassBrowser_ClassBrowserPad" AutoHide="false" /> |
|
||||||
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_PropertyPad" AutoHide="false" /> |
|
||||||
</DockablePane> |
|
||||||
</ResizingPanel> |
</ResizingPanel> |
||||||
<Hidden /> |
<Hidden> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_OutlinePad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Left" State="Docked" ContainerPaneID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_FileScout" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Left" State="Docked" ContainerPaneID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Editor_Search_SearchResultsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Bookmarks_BookmarkPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_PythonBinding_PythonConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_RubyBinding_RubyConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_CodeCoverage_CodeCoveragePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_DefinitionViewPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="Grunwald_BooBinding_InteractiveInterpreterPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="FSharpBinding_FSharpInteractive" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_WixBinding_SetupDialogListPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_BreakPointsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_CallStackPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_LoadedModulesPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_RunningThreadsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_LocalVarPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_ConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_WatchPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
<DockableContent Name="ICSharpCode_Data_Addin_Pad_DatabasesTreeViewPad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Right" State="Docked" ContainerPaneID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" /> |
||||||
|
<DockableContent Name="ICSharpCode_UnitTesting_UnitTestsPad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Right" State="Docked" ContainerPaneID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" /> |
||||||
|
<DockableContent Name="ICSharpCode_XmlEditor_XPathQueryPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="5c97c37d-9f06-41e7-80f1-e2894cbbb501" /> |
||||||
|
</Hidden> |
||||||
<Windows /> |
<Windows /> |
||||||
</DockingManager> |
</DockingManager> |
@ -1,5 +1,43 @@ |
|||||||
<DockingManager version="1.2.1"> |
<DockingManager version="1.3.0"> |
||||||
<DocumentPanePlaceHolder /> |
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1280,670" Orientation="Horizontal"> |
||||||
<Hidden /> |
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,670" ID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" Anchor="Left" IsAutoHidden="false" /> |
||||||
|
<ResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1280,670" Orientation="Vertical"> |
||||||
|
<DocumentPaneResizingPanel ResizeWidth="*" ResizeHeight="*" EffectiveSize="1280,670" Orientation="Vertical"> |
||||||
|
<DocumentPane IsMain="true" /> |
||||||
|
</DocumentPaneResizingPanel> |
||||||
|
<DockablePane ResizeWidth="*" ResizeHeight="188" EffectiveSize="1074,188" ID="77255f09-b21a-490d-83a7-af0d08551048" Anchor="Bottom" IsAutoHidden="false" /> |
||||||
|
</ResizingPanel> |
||||||
|
<DockablePane ResizeWidth="200" ResizeHeight="*" EffectiveSize="200,670" ID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" Anchor="Right" IsAutoHidden="false" /> |
||||||
|
</ResizingPanel> |
||||||
|
<Hidden> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_OutlinePad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Left" State="Docked" ContainerPaneID="9f120566-38aa-4659-bebb-c206e105433c" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_FileScout" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Left" State="Docked" ContainerPaneID="9f120566-38aa-4659-bebb-c206e105433c" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Editor_Search_SearchResultsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Bookmarks_BookmarkPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_PythonBinding_PythonConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_RubyBinding_RubyConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_CodeCoverage_CodeCoveragePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_DefinitionViewPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="Grunwald_BooBinding_InteractiveInterpreterPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="FSharpBinding_FSharpInteractive" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_WixBinding_SetupDialogListPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_BreakPointsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_CallStackPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_LoadedModulesPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_RunningThreadsPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_LocalVarPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_ConsolePad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_Pads_WatchPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_Data_Addin_Pad_DatabasesTreeViewPad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Right" State="Docked" ContainerPaneID="d097e079-2391-47cc-b140-4d53b775ce6e" /> |
||||||
|
<DockableContent Name="ICSharpCode_UnitTesting_UnitTestsPad" FloatingWindowSize="250,400" ChildIndex="2" Width="100" Height="100" Anchor="Right" State="Docked" ContainerPaneID="d097e079-2391-47cc-b140-4d53b775ce6e" /> |
||||||
|
<DockableContent Name="ICSharpCode_XmlEditor_XPathQueryPad" FloatingWindowSize="250,400" ChildIndex="3" Width="100" Height="100" Anchor="Bottom" State="Docked" ContainerPaneID="43258c58-277d-45a4-b3b6-148958df7e55" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Project_ProjectBrowserPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Left" State="Docked" ContainerPaneID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ToolsPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Left" State="Docked" ContainerPaneID="4b6a1236-66d8-480d-80c2-5fb4e6236fef" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ErrorListPad" FloatingWindowSize="250,400" ChildIndex="0" Width="1074" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_TaskListPad" FloatingWindowSize="250,400" ChildIndex="0" Width="1074" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_CompilerMessageView" FloatingWindowSize="250,400" ChildIndex="0" Width="1074" Height="188" Anchor="Bottom" State="Docked" ContainerPaneID="77255f09-b21a-490d-83a7-af0d08551048" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_ClassBrowser_ClassBrowserPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Right" State="Docked" ContainerPaneID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" /> |
||||||
|
<DockableContent Name="ICSharpCode_SharpDevelop_Gui_PropertyPad" FloatingWindowSize="250,400" ChildIndex="0" Width="200" Height="670" Anchor="Right" State="Docked" ContainerPaneID="9bb68751-4ad1-4e6e-8f46-a9830486c40f" /> |
||||||
|
</Hidden> |
||||||
<Windows /> |
<Windows /> |
||||||
</DockingManager> |
</DockingManager> |
@ -0,0 +1,66 @@ |
|||||||
|
<?xml version="1.0"?> |
||||||
|
<Template author="Martin Konicek" version="1.0.0"> |
||||||
|
|
||||||
|
<Config |
||||||
|
name = "${res:Templates.File.Exception.Name}" |
||||||
|
icon = "C#.File.NewClass" |
||||||
|
category = "C#" |
||||||
|
defaultname = "Exception.cs" |
||||||
|
language = "C#"/> |
||||||
|
|
||||||
|
<Description>${res:Templates.File.Exception.Description}</Description> |
||||||
|
|
||||||
|
<!-- |
||||||
|
Special new file templates: |
||||||
|
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension |
||||||
|
${FullName} -> Full generated path name |
||||||
|
${FileName} -> File name with extension |
||||||
|
${FileNameWithoutExtension} -> File name without extension |
||||||
|
${Extension} -> Extension in the form ".cs" |
||||||
|
${Path} -> Full path of the file |
||||||
|
--> |
||||||
|
<!--<Properties> |
||||||
|
<Property |
||||||
|
name = "IsSealed" |
||||||
|
localizedName = "${res:Templates.File.Properties.IsSealed}" |
||||||
|
type = "System.Boolean" |
||||||
|
defaultValue = "False" |
||||||
|
category = "${res:Templates.File.Properties.ContextCategory}" |
||||||
|
description = "${res:Templates.File.Properties.IsSealed.Description}" |
||||||
|
/> |
||||||
|
</Properties>--> |
||||||
|
|
||||||
|
<Files> |
||||||
|
<File name="${FullName}" language="C#"><![CDATA[${StandardHeader.C#} |
||||||
|
using System; |
||||||
|
using System.Runtime.Serialization; |
||||||
|
|
||||||
|
namespace ${StandardNamespace} |
||||||
|
{ |
||||||
|
/// <summary> |
||||||
|
/// Desctiption of ${ClassName}. |
||||||
|
/// </summary> |
||||||
|
public class ${ClassName} : Exception, ISerializable |
||||||
|
{ |
||||||
|
public ${ClassName}() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public ${ClassName}(string message) : base(message) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public ${ClassName}(string message, Exception innerException) : base(message, innerException) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
// This constructor is needed for serialization. |
||||||
|
protected ${ClassName}(SerializationInfo info, StreamingContext context) : base(info, context) |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
}]]></File> |
||||||
|
</Files> |
||||||
|
|
||||||
|
<AdditionalOptions/> |
||||||
|
</Template> |
@ -0,0 +1,60 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> |
||||||
|
<PropertyGroup> |
||||||
|
<ProjectGuid>{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}</ProjectGuid> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||||
|
<OutputType>Library</OutputType> |
||||||
|
<RootNamespace>Gallio.Extension</RootNamespace> |
||||||
|
<AssemblyName>Gallio.Extension</AssemblyName> |
||||||
|
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||||
|
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||||
|
<NoStdLib>False</NoStdLib> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> |
||||||
|
<PlatformTarget>x86</PlatformTarget> |
||||||
|
<RegisterForComInterop>False</RegisterForComInterop> |
||||||
|
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||||
|
<BaseAddress>4194304</BaseAddress> |
||||||
|
<FileAlignment>4096</FileAlignment> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||||
|
<OutputPath>bin\Debug\</OutputPath> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>Full</DebugType> |
||||||
|
<Optimize>False</Optimize> |
||||||
|
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||||
|
<OutputPath>bin\Release\</OutputPath> |
||||||
|
<DebugSymbols>False</DebugSymbols> |
||||||
|
<DebugType>None</DebugType> |
||||||
|
<Optimize>True</Optimize> |
||||||
|
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||||
|
<DefineConstants>TRACE</DefineConstants> |
||||||
|
</PropertyGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Reference Include="Gallio"> |
||||||
|
<HintPath>..\Gallio\bin\Gallio.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="System" /> |
||||||
|
<Reference Include="System.Xml" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Compile Include="GallioTestStepConverter.cs" /> |
||||||
|
<Compile Include="ITestResultsWriter.cs" /> |
||||||
|
<Compile Include="ITestResultsWriterFactory.cs" /> |
||||||
|
<Compile Include="MultiLineTestResultText.cs" /> |
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||||
|
<Compile Include="SharpDevelopTagFormatter.cs" /> |
||||||
|
<Compile Include="SharpDevelopTestRunnerExtension.cs" /> |
||||||
|
<Compile Include="TestResult.cs" /> |
||||||
|
<Compile Include="TestResultsWriter.cs" /> |
||||||
|
<Compile Include="TestResultsWriterFactory.cs" /> |
||||||
|
</ItemGroup> |
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||||
|
</Project> |
@ -0,0 +1,78 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using Model = Gallio.Model; |
||||||
|
using Gallio.Common.Markup; |
||||||
|
using Gallio.Runner.Events; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public class GallioTestStepConverter |
||||||
|
{ |
||||||
|
TestStepEventArgs eventArgs; |
||||||
|
TestResult testResult; |
||||||
|
SharpDevelopTagFormatter tagFormatter; |
||||||
|
|
||||||
|
public GallioTestStepConverter(TestStepEventArgs eventArgs) |
||||||
|
{ |
||||||
|
this.eventArgs = eventArgs; |
||||||
|
Convert(); |
||||||
|
} |
||||||
|
|
||||||
|
void Convert() |
||||||
|
{ |
||||||
|
CreateTestResult(); |
||||||
|
ConvertTestOutcome(); |
||||||
|
ConvertTestMessages(); |
||||||
|
} |
||||||
|
|
||||||
|
void CreateTestResult() |
||||||
|
{ |
||||||
|
string name = GetTestName(); |
||||||
|
testResult = new TestResult(name); |
||||||
|
} |
||||||
|
|
||||||
|
string GetTestName() |
||||||
|
{ |
||||||
|
return eventArgs.Test.FullName.Replace('/', '.'); |
||||||
|
} |
||||||
|
|
||||||
|
void ConvertTestOutcome() |
||||||
|
{ |
||||||
|
testResult.ResultType = GetTestResultType(eventArgs.TestStepRun.Result.Outcome.Status); |
||||||
|
} |
||||||
|
|
||||||
|
TestResultType GetTestResultType(Model.TestStatus status) |
||||||
|
{ |
||||||
|
switch (status) { |
||||||
|
case Model.TestStatus.Passed: |
||||||
|
return TestResultType.Success; |
||||||
|
case Model.TestStatus.Skipped: |
||||||
|
case Model.TestStatus.Inconclusive: |
||||||
|
return TestResultType.Ignored; |
||||||
|
case Model.TestStatus.Failed: |
||||||
|
return TestResultType.Failure; |
||||||
|
} |
||||||
|
return TestResultType.None; |
||||||
|
} |
||||||
|
|
||||||
|
void ConvertTestMessages() |
||||||
|
{ |
||||||
|
tagFormatter = new SharpDevelopTagFormatter(); |
||||||
|
tagFormatter.Visit(eventArgs.TestStepRun); |
||||||
|
testResult.Message = tagFormatter.TestResultMessage; |
||||||
|
testResult.StackTrace = tagFormatter.GetStackTrace(); |
||||||
|
} |
||||||
|
|
||||||
|
public TestResult GetTestResult() |
||||||
|
{ |
||||||
|
return testResult; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public interface ITestResultsWriter : IDisposable |
||||||
|
{ |
||||||
|
void Write(TestResult testResult); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public interface ITestResultsWriterFactory |
||||||
|
{ |
||||||
|
ITestResultsWriter Create(string fileName); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,54 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public class MultiLineTestResultText |
||||||
|
{ |
||||||
|
StringBuilder textBuilder = new StringBuilder(); |
||||||
|
|
||||||
|
public MultiLineTestResultText(string text) |
||||||
|
{ |
||||||
|
EncodeText(text); |
||||||
|
} |
||||||
|
|
||||||
|
public override string ToString() |
||||||
|
{ |
||||||
|
return textBuilder.ToString(); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replaces the first character on each new line with a space.
|
||||||
|
/// The first line does not have the extra space added.
|
||||||
|
/// </summary>
|
||||||
|
void EncodeText(string text) |
||||||
|
{ |
||||||
|
if (String.IsNullOrEmpty(text)) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
text = text.TrimEnd(Environment.NewLine.ToCharArray()); |
||||||
|
|
||||||
|
foreach (char ch in text) { |
||||||
|
switch (ch) { |
||||||
|
case '\n': |
||||||
|
textBuilder.Append("\r\n "); |
||||||
|
break; |
||||||
|
case '\r': |
||||||
|
// Ignore.
|
||||||
|
break; |
||||||
|
default: |
||||||
|
textBuilder.Append(ch); |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
#region Using directives
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Reflection; |
||||||
|
using System.Runtime.InteropServices; |
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Gallio.Extension")] |
||||||
|
[assembly: AssemblyDescription("")] |
||||||
|
[assembly: AssemblyConfiguration("")] |
||||||
|
[assembly: AssemblyCompany("")] |
||||||
|
[assembly: AssemblyProduct("Gallio.Extension")] |
||||||
|
[assembly: AssemblyCopyright("Copyright 2010")] |
||||||
|
[assembly: AssemblyTrademark("")] |
||||||
|
[assembly: AssemblyCulture("")] |
||||||
|
|
||||||
|
// This sets the default COM visibility of types in the assembly to invisible.
|
||||||
|
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||||
|
[assembly: ComVisible(false)] |
||||||
|
|
||||||
|
// The assembly version has following format :
|
||||||
|
//
|
||||||
|
// Major.Minor.Build.Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can use the default the Revision and
|
||||||
|
// Build Numbers by using the '*' as shown below:
|
||||||
|
[assembly: AssemblyVersion("1.0.*")] |
@ -0,0 +1,68 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Text; |
||||||
|
using Gallio.Common.Markup; |
||||||
|
using Gallio.Common.Markup.Tags; |
||||||
|
using Gallio.Runner.Reports.Schema; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public class SharpDevelopTagFormatter : ITagVisitor |
||||||
|
{ |
||||||
|
StringBuilder textBuilder = new StringBuilder(); |
||||||
|
string testResultMessage = String.Empty; |
||||||
|
|
||||||
|
public void Visit(TestStepRun testStepRun) |
||||||
|
{ |
||||||
|
foreach (StructuredStream stream in testStepRun.TestLog.Streams) { |
||||||
|
VisitBodyTag(stream.Body); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void VisitBodyTag(BodyTag tag) |
||||||
|
{ |
||||||
|
foreach (Tag childTag in tag.Contents) { |
||||||
|
childTag.Accept(this); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void VisitSectionTag(SectionTag tag) |
||||||
|
{ |
||||||
|
textBuilder.Append(tag.Name + " "); |
||||||
|
tag.AcceptContents(this); |
||||||
|
} |
||||||
|
|
||||||
|
public void VisitMarkerTag(MarkerTag tag) |
||||||
|
{ |
||||||
|
if (tag.Class == Marker.StackTraceClass) { |
||||||
|
testResultMessage = textBuilder.ToString(); |
||||||
|
textBuilder = new StringBuilder(); |
||||||
|
} |
||||||
|
tag.AcceptContents(this); |
||||||
|
} |
||||||
|
|
||||||
|
public void VisitEmbedTag(EmbedTag tag) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public void VisitTextTag(TextTag tag) |
||||||
|
{ |
||||||
|
textBuilder.Append(tag.Text); |
||||||
|
} |
||||||
|
|
||||||
|
public string TestResultMessage { |
||||||
|
get { return testResultMessage; } |
||||||
|
} |
||||||
|
|
||||||
|
public string GetStackTrace() |
||||||
|
{ |
||||||
|
return textBuilder.ToString(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using Gallio.Runner.Events; |
||||||
|
using Gallio.Runner.Extensions; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public class SharpDevelopTestRunnerExtension : TestRunnerExtension |
||||||
|
{ |
||||||
|
ITestResultsWriterFactory factory; |
||||||
|
ITestResultsWriter writer; |
||||||
|
|
||||||
|
public SharpDevelopTestRunnerExtension(ITestResultsWriterFactory factory) |
||||||
|
{ |
||||||
|
this.factory = factory; |
||||||
|
} |
||||||
|
|
||||||
|
public SharpDevelopTestRunnerExtension() |
||||||
|
: this(new TestResultsWriterFactory()) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
protected override void Initialize() |
||||||
|
{ |
||||||
|
writer = factory.Create(Parameters); |
||||||
|
Events.TestStepFinished += TestStepFinished; |
||||||
|
Events.DisposeStarted += DisposeStarted; |
||||||
|
} |
||||||
|
|
||||||
|
void TestStepFinished(object source, TestStepFinishedEventArgs e) |
||||||
|
{ |
||||||
|
if (e.Test.IsTestCase) { |
||||||
|
GallioTestStepConverter testStep = new GallioTestStepConverter(e); |
||||||
|
TestResult testResult = testStep.GetTestResult(); |
||||||
|
writer.Write(testResult); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void DisposeStarted(object source, DisposeStartedEventArgs e) |
||||||
|
{ |
||||||
|
writer.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,80 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public enum TestResultType { |
||||||
|
/// <summary>
|
||||||
|
/// The test has not been run.
|
||||||
|
/// </summary>
|
||||||
|
None = 0, |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The test passed.
|
||||||
|
/// </summary>
|
||||||
|
Success = 1, |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The test failed.
|
||||||
|
/// </summary>
|
||||||
|
Failure = 2, |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The test was ignored.
|
||||||
|
/// </summary>
|
||||||
|
Ignored = 3 |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Holds the information about a single test result.
|
||||||
|
/// </summary>
|
||||||
|
public class TestResult |
||||||
|
{ |
||||||
|
string name = String.Empty; |
||||||
|
string message = String.Empty; |
||||||
|
string stackTrace = String.Empty; |
||||||
|
TestResultType resultType = TestResultType.None; |
||||||
|
|
||||||
|
public TestResult(string name) |
||||||
|
{ |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
|
||||||
|
public string Name { |
||||||
|
get { return name; } |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsSuccess { |
||||||
|
get { return resultType == TestResultType.Success; } |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsFailure { |
||||||
|
get { return resultType == TestResultType.Failure; } |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsIgnored { |
||||||
|
get { return resultType == TestResultType.Ignored; } |
||||||
|
} |
||||||
|
|
||||||
|
public TestResultType ResultType { |
||||||
|
get { return resultType; } |
||||||
|
set { resultType = value; } |
||||||
|
} |
||||||
|
|
||||||
|
public string Message { |
||||||
|
get { return message; } |
||||||
|
set { message = value; } |
||||||
|
} |
||||||
|
|
||||||
|
public string StackTrace { |
||||||
|
get { return stackTrace; } |
||||||
|
set { stackTrace = value; } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,90 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.IO; |
||||||
|
using System.Text; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public class TestResultsWriter : ITestResultsWriter, IDisposable |
||||||
|
{ |
||||||
|
TextWriter writer; |
||||||
|
|
||||||
|
public TestResultsWriter(string fileName) |
||||||
|
: this(new StreamWriter(fileName, false, Encoding.UTF8)) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public TestResultsWriter(TextWriter writer) |
||||||
|
{ |
||||||
|
this.writer = writer; |
||||||
|
} |
||||||
|
|
||||||
|
public void Write(TestResult testResult) |
||||||
|
{ |
||||||
|
WriteTestName(testResult.Name); |
||||||
|
WriteResult(testResult.ResultType); |
||||||
|
|
||||||
|
if (testResult.ResultType == TestResultType.Failure) { |
||||||
|
WriteTestFailureResult(testResult); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void WriteTestName(string name) |
||||||
|
{ |
||||||
|
WriteNameAndValue("Name", name); |
||||||
|
} |
||||||
|
|
||||||
|
void WriteResult(TestResultType resultType) |
||||||
|
{ |
||||||
|
string result = GetResult(resultType); |
||||||
|
WriteNameAndValue("Result", result); |
||||||
|
} |
||||||
|
|
||||||
|
void WriteTestFailureResult(TestResult testResult) |
||||||
|
{ |
||||||
|
WriteNameAndMultiLineValue("Message", testResult.Message); |
||||||
|
WriteNameAndMultiLineValue("StackTrace", testResult.StackTrace); |
||||||
|
} |
||||||
|
|
||||||
|
void WriteNameAndValue(string name, string value) |
||||||
|
{ |
||||||
|
string nameAndValue = String.Format("{0}: {1}", name, value); |
||||||
|
WriteLine(nameAndValue); |
||||||
|
} |
||||||
|
|
||||||
|
string GetResult(TestResultType resultType) |
||||||
|
{ |
||||||
|
switch (resultType) { |
||||||
|
case TestResultType.Success: |
||||||
|
return "Success"; |
||||||
|
case TestResultType.Ignored: |
||||||
|
return "Ignored"; |
||||||
|
case TestResultType.Failure: |
||||||
|
return "Failure"; |
||||||
|
} |
||||||
|
return String.Empty; |
||||||
|
} |
||||||
|
|
||||||
|
void WriteNameAndMultiLineValue(string name, string value) |
||||||
|
{ |
||||||
|
MultiLineTestResultText multiLineText = new MultiLineTestResultText(value); |
||||||
|
WriteNameAndValue(name, multiLineText.ToString()); |
||||||
|
} |
||||||
|
|
||||||
|
void WriteLine(string text) |
||||||
|
{ |
||||||
|
writer.WriteLine(text); |
||||||
|
} |
||||||
|
|
||||||
|
public void Dispose() |
||||||
|
{ |
||||||
|
writer.Dispose(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Gallio.Extension |
||||||
|
{ |
||||||
|
public class TestResultsWriterFactory : ITestResultsWriterFactory |
||||||
|
{ |
||||||
|
public ITestResultsWriter Create(string fileName) |
||||||
|
{ |
||||||
|
return new TestResultsWriter(fileName); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,99 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||||
|
<PropertyGroup> |
||||||
|
<ProjectGuid>{3F6C539D-DB38-41B4-A5B3-B9A52AE607CD}</ProjectGuid> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||||
|
<OutputType>Library</OutputType> |
||||||
|
<RootNamespace>Gallio.SharpDevelop.Tests</RootNamespace> |
||||||
|
<AssemblyName>Gallio.SharpDevelop.Tests</AssemblyName> |
||||||
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
||||||
|
<SourceAnalysisOverrideSettingsFile>C:\Users\Matt\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile> |
||||||
|
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||||
|
<NoStdLib>False</NoStdLib> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> |
||||||
|
<PlatformTarget>x86</PlatformTarget> |
||||||
|
<RegisterForComInterop>False</RegisterForComInterop> |
||||||
|
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||||
|
<BaseAddress>4194304</BaseAddress> |
||||||
|
<FileAlignment>4096</FileAlignment> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||||
|
<OutputPath>bin\Debug\</OutputPath> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>Full</DebugType> |
||||||
|
<Optimize>False</Optimize> |
||||||
|
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||||
|
<OutputPath>bin\Release\</OutputPath> |
||||||
|
<DebugSymbols>False</DebugSymbols> |
||||||
|
<DebugType>None</DebugType> |
||||||
|
<Optimize>True</Optimize> |
||||||
|
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||||
|
<DefineConstants>TRACE</DefineConstants> |
||||||
|
</PropertyGroup> |
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||||
|
<ItemGroup> |
||||||
|
<Reference Include="Gallio"> |
||||||
|
<HintPath>..\Gallio\bin\Gallio.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.Core"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.SharpDevelop"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.SharpDevelop.Dom"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.SharpDevelop.Dom"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="nunit.framework"> |
||||||
|
<HintPath>..\..\..\bin\Tools\NUnit\nunit.framework.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="System" /> |
||||||
|
<Reference Include="System.Xml" /> |
||||||
|
<Reference Include="UnitTesting"> |
||||||
|
<HintPath>..\..\..\AddIns\AddIns\Misc\UnitTesting\UnitTesting.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="UnitTesting.Tests"> |
||||||
|
<HintPath>..\..\..\bin\UnitTests\UnitTesting.Tests.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<ProjectReference Include="..\Gallio.Extension\Gallio.Extension.csproj"> |
||||||
|
<Project>{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}</Project> |
||||||
|
<Name>Gallio.Extension</Name> |
||||||
|
</ProjectReference> |
||||||
|
<ProjectReference Include="..\Gallio.SharpDevelop\Gallio.SharpDevelop.csproj"> |
||||||
|
<Project>{88D3DC5E-8A91-4DCE-A785-CC37DE0AA0EC}</Project> |
||||||
|
<Name>Gallio.SharpDevelop</Name> |
||||||
|
</ProjectReference> |
||||||
|
<Compile Include="GallioEchoApplicationFileNameTestFixture.cs" /> |
||||||
|
<Compile Include="GallioEchoCommandLineTests.cs" /> |
||||||
|
<Compile Include="GallioEchoConsoleProcessStartInfoTestFixture.cs" /> |
||||||
|
<Compile Include="GallioTestFailureTestFixture.cs" /> |
||||||
|
<Compile Include="GallioTestFrameworkIsTestClassTests.cs" /> |
||||||
|
<Compile Include="GallioTestFrameworkIsTestMethodTests.cs" /> |
||||||
|
<Compile Include="GallioTestFrameworkIsTestProjectTests.cs" /> |
||||||
|
<Compile Include="GallioTestToSharpDevelopTestResultConversionTests.cs" /> |
||||||
|
<Compile Include="TestResultsWriterTestFixture.cs" /> |
||||||
|
<Compile Include="TestRunnerExtensionTestFixture.cs" /> |
||||||
|
<Compile Include="Utils\GallioBodyTagFactory.cs" /> |
||||||
|
<Compile Include="Utils\MockTestResultsWriter.cs" /> |
||||||
|
<Compile Include="Utils\MockTestResultsWriterFactory.cs" /> |
||||||
|
<Compile Include="Utils\MockTestRunnerEvents.cs" /> |
||||||
|
<Compile Include="Utils\GallioTestStepFinishedEventArgsFactory.cs" /> |
||||||
|
<Compile Include="Utils\Tests\CreateAssertionFailureBodyTagTestFixture.cs" /> |
||||||
|
<Compile Include="Utils\Tests\MockTestResultsWriterFactoryTests.cs" /> |
||||||
|
<Compile Include="Utils\Tests\MockTestRunnerEventsTestFixture.cs" /> |
||||||
|
<Folder Include="Utils" /> |
||||||
|
<Folder Include="Utils\Tests" /> |
||||||
|
</ItemGroup> |
||||||
|
</Project> |
@ -0,0 +1,62 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
using NUnit.Framework; |
||||||
|
using UnitTesting.Tests.Utils; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioEchoApplicationFileNameTestFixture |
||||||
|
{ |
||||||
|
GallioEchoConsoleApplication app; |
||||||
|
string gallioEchoConsoleFileName; |
||||||
|
MockAddInTree addinTree; |
||||||
|
string addinTreePath; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
MockCSharpProject project = new MockCSharpProject(); |
||||||
|
SelectedTests tests = new SelectedTests(project); |
||||||
|
|
||||||
|
gallioEchoConsoleFileName = @"d:\gallio\bin\Gallio.Echo.exe"; |
||||||
|
addinTreePath = GallioEchoConsoleApplicationFactory.AddInTreePath; |
||||||
|
|
||||||
|
addinTree = new MockAddInTree(); |
||||||
|
List<string> items = new List<string>(); |
||||||
|
items.Add(gallioEchoConsoleFileName); |
||||||
|
|
||||||
|
addinTree.AddItems<string>(addinTreePath, items); |
||||||
|
|
||||||
|
GallioEchoConsoleApplicationFactory factory = new GallioEchoConsoleApplicationFactory(addinTree); |
||||||
|
app = factory.Create(tests); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void AddInTreeBuildItemsReturnsGallioEchoConsoleFileName() |
||||||
|
{ |
||||||
|
List<string> items = addinTree.BuildItems<string>(addinTreePath, null); |
||||||
|
|
||||||
|
List<string> expectedItems = new List<string>(); |
||||||
|
expectedItems.Add(gallioEchoConsoleFileName); |
||||||
|
|
||||||
|
Assert.AreEqual(expectedItems.ToArray(), items.ToArray()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void ApplicationFileNameIsTakenFromAddInTree() |
||||||
|
{ |
||||||
|
string expectedFileName = gallioEchoConsoleFileName; |
||||||
|
Assert.AreEqual(expectedFileName, app.FileName); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,76 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using NUnit.Framework; |
||||||
|
using UnitTesting.Tests.Utils; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioEchoCommandLineTests |
||||||
|
{ |
||||||
|
MockCSharpProject project; |
||||||
|
SelectedTests selectedTests; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
project = new MockCSharpProject(); |
||||||
|
selectedTests = new SelectedTests(project); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void CommandLineIncludesProjectOutputAssembly() |
||||||
|
{ |
||||||
|
GallioEchoConsoleApplication app = new GallioEchoConsoleApplication(selectedTests); |
||||||
|
|
||||||
|
string expectedArgs = |
||||||
|
"/rv:v4.0.30319 " + |
||||||
|
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\""; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedArgs, app.GetArguments()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void SharpDevelopTestRunnerExtensionAddedToCommandLine() |
||||||
|
{ |
||||||
|
SharpDevelopTestRunnerExtensionCommandLineArgument arg = |
||||||
|
new SharpDevelopTestRunnerExtensionCommandLineArgument(); |
||||||
|
arg.TestResultsFileName = @"c:\temp\tmp66.tmp"; |
||||||
|
|
||||||
|
GallioEchoConsoleApplication app = new GallioEchoConsoleApplication(selectedTests); |
||||||
|
app.TestRunnerExtensions.Add(arg); |
||||||
|
|
||||||
|
string expectedArgs = |
||||||
|
"/rv:v4.0.30319 " + |
||||||
|
"/re:\"Gallio.Extension.SharpDevelopTestRunnerExtension,Gallio.Extension.dll;c:\\temp\\tmp66.tmp\" " + |
||||||
|
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\""; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedArgs, app.GetArguments()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestRunnerExtensionWithoutParametersAddedToCommandLine() |
||||||
|
{ |
||||||
|
TestRunnerExtensionCommandLineArgument arg = |
||||||
|
new TestRunnerExtensionCommandLineArgument("MyNamespace.MyTestExtension,MyTestRunner.dll"); |
||||||
|
|
||||||
|
GallioEchoConsoleApplication app = new GallioEchoConsoleApplication(selectedTests); |
||||||
|
app.TestRunnerExtensions.Add(arg); |
||||||
|
|
||||||
|
string expectedArgs = |
||||||
|
"/rv:v4.0.30319 " + |
||||||
|
"/re:\"MyNamespace.MyTestExtension,MyTestRunner.dll\" " + |
||||||
|
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\""; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedArgs, app.GetArguments()); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,85 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using System.IO; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
using Gallio.SharpDevelop.Tests.Utils; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using NUnit.Framework; |
||||||
|
using UnitTesting.Tests.Utils; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioEchoConsoleProcessStartInfoTestFixture |
||||||
|
{ |
||||||
|
ProcessStartInfo info; |
||||||
|
|
||||||
|
[TestFixtureSetUp] |
||||||
|
public void SetUpFixture() |
||||||
|
{ |
||||||
|
string xml = |
||||||
|
"<AddIn name='Unit Testing Addin'\r\n" + |
||||||
|
" author='Matt Ward'\r\n" + |
||||||
|
" copyright='prj:///doc/copyright.txt'\r\n" + |
||||||
|
" description='Runs unit tests with Gallio inside SharpDevelop'\r\n" + |
||||||
|
" addInManagerHidden='preinstalled'>\r\n" + |
||||||
|
" <Manifest>\r\n" + |
||||||
|
" <Identity name='ICSharpCode.Gallio'/>\r\n" + |
||||||
|
" </Manifest>\r\n" + |
||||||
|
"</AddIn>"; |
||||||
|
AddIn addin = AddIn.Load(new StringReader(xml)); |
||||||
|
addin.Enabled = false; |
||||||
|
addin.FileName = @"d:\sharpdevelop\addins\gallio\Gallio.SharpDevelop.dll"; |
||||||
|
AddInTree.InsertAddIn(addin); |
||||||
|
} |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
MockCSharpProject project = new MockCSharpProject(); |
||||||
|
SelectedTests selectedTests = new SelectedTests(project); |
||||||
|
GallioEchoConsoleApplication app = new GallioEchoConsoleApplication(selectedTests, @"d:\gallio\Gallio.Echo.exe"); |
||||||
|
info = app.GetProcessStartInfo(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioAddInPathIsConvertedByStringParser() |
||||||
|
{ |
||||||
|
string expectedDirectory = @"d:\sharpdevelop\addins\gallio"; |
||||||
|
string actualDirectory = StringParser.Parse("${addinpath:ICSharpCode.Gallio}"); |
||||||
|
Assert.AreEqual(expectedDirectory, actualDirectory); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void WorkingDirectoryIsGallioAddInDirectory() |
||||||
|
{ |
||||||
|
string expectedDirectory = @"d:\sharpdevelop\addins\gallio"; |
||||||
|
Assert.AreEqual(expectedDirectory, info.WorkingDirectory); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FileNameIsNUnitConsoleExe() |
||||||
|
{ |
||||||
|
string expectedFileName = @"d:\gallio\Gallio.Echo.exe"; |
||||||
|
Assert.AreEqual(expectedFileName, info.FileName); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void CommandLineArgumentsAreNUnitConsoleExeCommandLineArguments() |
||||||
|
{ |
||||||
|
string expectedCommandLine = |
||||||
|
"/rv:v4.0.30319 " + |
||||||
|
"\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\""; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedCommandLine, info.Arguments); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,85 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using NUnit.Framework; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioTestFailureTestFixture |
||||||
|
{ |
||||||
|
GallioTestResult gallioTestResult; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
TestResult testResult = new TestResult("MyNamespace.MyTests"); |
||||||
|
testResult.ResultType = TestResultType.Failure; |
||||||
|
testResult.Message = "Test failed"; |
||||||
|
testResult.StackTrace = |
||||||
|
@" at GallioTest.MyClass.AssertWithFailureMessage() in d:\temp\test\..\GallioTest\MyClass.cs:line 46"; |
||||||
|
gallioTestResult = new GallioTestResult(testResult); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultTypeIsFailure() |
||||||
|
{ |
||||||
|
Assert.AreEqual(TestResultType.Failure, gallioTestResult.ResultType); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultMessageIsTestFailed() |
||||||
|
{ |
||||||
|
Assert.AreEqual("Test failed", gallioTestResult.Message); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultHasStackTrace() |
||||||
|
{ |
||||||
|
string expectedStackTrace = |
||||||
|
@" at GallioTest.MyClass.AssertWithFailureMessage() in d:\temp\test\..\GallioTest\MyClass.cs:line 46"; |
||||||
|
Assert.AreEqual(expectedStackTrace, gallioTestResult.StackTrace); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultHasExpectedName() |
||||||
|
{ |
||||||
|
Assert.AreEqual("MyNamespace.MyTests", gallioTestResult.Name); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void StackTraceFilePositionFileNameMatchesLastFileNameInStackTrace() |
||||||
|
{ |
||||||
|
string expectedFileName = @"d:\temp\GallioTest\MyClass.cs"; |
||||||
|
Assert.AreEqual(expectedFileName, gallioTestResult.StackTraceFilePosition.FileName); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void StackTraceFilePositionLineNumberIs46WhichIsEqualToReportedErrorLine() |
||||||
|
{ |
||||||
|
Assert.AreEqual(46, gallioTestResult.StackTraceFilePosition.Line); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void StackTraceFilePositionColumnNumberIsOne() |
||||||
|
{ |
||||||
|
Assert.AreEqual(1, gallioTestResult.StackTraceFilePosition.Column); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void ChangingStackTraceToEmptyStringSetsStackTraceFilePositionToEmpty() |
||||||
|
{ |
||||||
|
gallioTestResult.StackTraceFilePosition = new FilePosition("test.cs", 10, 2); |
||||||
|
gallioTestResult.StackTrace = String.Empty; |
||||||
|
Assert.IsTrue(gallioTestResult.StackTraceFilePosition.IsEmpty); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,91 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using NUnit.Framework; |
||||||
|
using UnitTesting.Tests.Utils; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioTestFrameworkIsTestClassTests |
||||||
|
{ |
||||||
|
GallioTestFramework testFramework; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
testFramework = new GallioTestFramework(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestClassReturnsFalseHasClassHasNoAttributes() |
||||||
|
{ |
||||||
|
MockClass mockClass = MockClass.CreateMockClassWithoutAnyAttributes(); |
||||||
|
Assert.IsFalse(testFramework.IsTestClass(mockClass)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestClassReturnsTrueHasClassHasTestFixtureAttributeMissingAttributePart() |
||||||
|
{ |
||||||
|
MockAttribute testAttribute = new MockAttribute("TestFixture"); |
||||||
|
MockClass mockClass = MockClass.CreateMockClassWithAttribute(testAttribute); |
||||||
|
Assert.IsTrue(testFramework.IsTestClass(mockClass)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestClassReturnsTrueHasClassHasTestFixtureAttribute() |
||||||
|
{ |
||||||
|
MockAttribute testFixtureAttribute = new MockAttribute("TestFixtureAttribute"); |
||||||
|
MockClass mockClass = MockClass.CreateMockClassWithAttribute(testFixtureAttribute); |
||||||
|
Assert.IsTrue(testFramework.IsTestClass(mockClass)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestClassReturnsTrueHasClassHasFullyQualifiedNUnitTestFixtureAttribute() |
||||||
|
{ |
||||||
|
MockAttribute testFixtureAttribute = new MockAttribute("MbUnit.Framework.TestFixtureAttribute"); |
||||||
|
MockClass mockClass = MockClass.CreateMockClassWithAttribute(testFixtureAttribute); |
||||||
|
Assert.IsTrue(testFramework.IsTestClass(mockClass)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestClassReturnsFalseWhenClassIsNull() |
||||||
|
{ |
||||||
|
Assert.IsFalse(testFramework.IsTestClass(null)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestClassReturnsFalseWhenProjectContentLanguageIsNull() |
||||||
|
{ |
||||||
|
IProject project = new MockCSharpProject(); |
||||||
|
MockProjectContent mockProjectContent = new MockProjectContent(); |
||||||
|
mockProjectContent.Project = project; |
||||||
|
MockClass mockClass = new MockClass(mockProjectContent); |
||||||
|
|
||||||
|
Assert.IsFalse(testFramework.IsTestClass(mockClass)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestClassReturnsFalseWhenProjectContentLanguageNameComparerIsNull() |
||||||
|
{ |
||||||
|
IProject project = new MockCSharpProject(); |
||||||
|
MockProjectContent mockProjectContent = new MockProjectContent(); |
||||||
|
mockProjectContent.Project = project; |
||||||
|
mockProjectContent.Language = new LanguageProperties(null); |
||||||
|
MockClass mockClass = new MockClass(mockProjectContent); |
||||||
|
mockClass.Attributes.Add(new MockAttribute("Test")); |
||||||
|
|
||||||
|
Assert.IsFalse(testFramework.IsTestClass(mockClass)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,127 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using NUnit.Framework; |
||||||
|
using UnitTesting.Tests.Utils; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioTestFrameworkIsTestMethodTests |
||||||
|
{ |
||||||
|
GallioTestFramework testFramework; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
testFramework = new GallioTestFramework(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsFalseWhenMethodHasNoAttributes() |
||||||
|
{ |
||||||
|
MockMethod mockMethod = MockMethod.CreateMockMethodWithoutAnyAttributes(); |
||||||
|
Assert.IsFalse(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsTrueWhenMethodHasTestAttributeWithoutAttributePart() |
||||||
|
{ |
||||||
|
MockAttribute testAttribute = new MockAttribute("Test"); |
||||||
|
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); |
||||||
|
Assert.IsTrue(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsTrueWhenMethodHasTestAttributeAttribute() |
||||||
|
{ |
||||||
|
MockAttribute testAttribute = new MockAttribute("TestAttribute"); |
||||||
|
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); |
||||||
|
Assert.IsTrue(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsTrueWhenMethodHasFullyQualifiedNUnitTestAttribute() |
||||||
|
{ |
||||||
|
MockAttribute testAttribute = new MockAttribute("MbUnit.Framework.TestAttribute"); |
||||||
|
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); |
||||||
|
Assert.IsTrue(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsFalseWhenMethodIsNull() |
||||||
|
{ |
||||||
|
Assert.IsFalse(testFramework.IsTestMethod(null)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsFalseWhenProjectContentLanguageHasNullNameComparer() |
||||||
|
{ |
||||||
|
IProject project = new MockCSharpProject(); |
||||||
|
MockProjectContent mockProjectContent = new MockProjectContent(); |
||||||
|
mockProjectContent.Project = project; |
||||||
|
mockProjectContent.Language = new LanguageProperties(null); |
||||||
|
MockClass mockClass = new MockClass(mockProjectContent); |
||||||
|
MockMethod mockMethod = new MockMethod(mockClass); |
||||||
|
mockMethod.Attributes.Add(new MockAttribute("Test")); |
||||||
|
|
||||||
|
Assert.IsFalse(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Even if the project is null the method should be
|
||||||
|
/// flagged as a TestMethod.
|
||||||
|
/// </summary>
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsTrueWhenProjectIsNull() |
||||||
|
{ |
||||||
|
MockAttribute testAttribute = new MockAttribute("Test"); |
||||||
|
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); |
||||||
|
MockProjectContent mockProjectContent = (MockProjectContent)mockMethod.DeclaringType.ProjectContent; |
||||||
|
mockProjectContent.Project = null; |
||||||
|
|
||||||
|
Assert.IsTrue(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsFalseWhenMethodHasNullDeclaringType() |
||||||
|
{ |
||||||
|
MockMethod mockMethod = new MockMethod(new MockClass()); |
||||||
|
|
||||||
|
Assert.IsFalse(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsFalseWhenMethodHasNullLanguage() |
||||||
|
{ |
||||||
|
IProject project = new MockCSharpProject(); |
||||||
|
MockProjectContent mockProjectContent = new MockProjectContent(); |
||||||
|
mockProjectContent.Project = project; |
||||||
|
MockClass mockClass = new MockClass(mockProjectContent); |
||||||
|
MockMethod mockMethod = new MockMethod(mockClass); |
||||||
|
|
||||||
|
Assert.IsFalse(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestMethodReturnsFalseWhenMethodHasHasParameters() |
||||||
|
{ |
||||||
|
MockAttribute testAttribute = new MockAttribute("Test"); |
||||||
|
MockMethod mockMethod = MockMethod.CreateMockMethodWithAttribute(testAttribute); |
||||||
|
MockParameter mockParameter = new MockParameter(); |
||||||
|
mockMethod.Parameters.Add(mockParameter); |
||||||
|
|
||||||
|
Assert.IsFalse(testFramework.IsTestMethod(mockMethod)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,97 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using NUnit.Framework; |
||||||
|
using UnitTesting.Tests.Utils; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioTestFrameworkIsTestProjectTests |
||||||
|
{ |
||||||
|
GallioTestFramework testFramework; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
testFramework = new GallioTestFramework(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioTestFrameworkImplementsITestFramework() |
||||||
|
{ |
||||||
|
Assert.IsNotNull(testFramework as ITestFramework); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestProjectReturnsFalseForNullProject() |
||||||
|
{ |
||||||
|
Assert.IsFalse(testFramework.IsTestProject(null)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestProjectReturnsTrueForProjectWithMbUnitFrameworkAssemblyReference() |
||||||
|
{ |
||||||
|
MockCSharpProject project = new MockCSharpProject(); |
||||||
|
|
||||||
|
ReferenceProjectItem systemRef = new ReferenceProjectItem(project, "System"); |
||||||
|
ProjectService.AddProjectItem(project, systemRef); |
||||||
|
|
||||||
|
ReferenceProjectItem nunitFrameworkRef = new ReferenceProjectItem(project, "MbUnit"); |
||||||
|
ProjectService.AddProjectItem(project, nunitFrameworkRef); |
||||||
|
|
||||||
|
Assert.IsTrue(testFramework.IsTestProject(project)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestProjectReturnsFalseForProjectWithoutMbUnitFrameworkAssemblyReference() |
||||||
|
{ |
||||||
|
MockCSharpProject project = new MockCSharpProject(); |
||||||
|
Assert.IsFalse(testFramework.IsTestProject(project)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestProjectReturnsTrueForProjectWithMbUnitFrameworkAssemblyReferenceIgnoringCase() |
||||||
|
{ |
||||||
|
MockCSharpProject project = new MockCSharpProject(); |
||||||
|
|
||||||
|
ReferenceProjectItem nunitFrameworkRef = new ReferenceProjectItem(project, "MBUNIT"); |
||||||
|
ProjectService.AddProjectItem(project, nunitFrameworkRef); |
||||||
|
|
||||||
|
Assert.IsTrue(testFramework.IsTestProject(project)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestProjectReturnsTrueForProjectWithMbUnitFrameworkAssemblyReferenceIgnoringNonReferenceProjectItems() |
||||||
|
{ |
||||||
|
MockCSharpProject project = new MockCSharpProject(); |
||||||
|
|
||||||
|
FileProjectItem fileItem = new FileProjectItem(project, ItemType.Compile, "test.cs"); |
||||||
|
ProjectService.AddProjectItem(project, fileItem); |
||||||
|
|
||||||
|
ReferenceProjectItem nunitFrameworkRef = new ReferenceProjectItem(project, "mbunit"); |
||||||
|
ProjectService.AddProjectItem(project, nunitFrameworkRef); |
||||||
|
|
||||||
|
Assert.IsTrue(testFramework.IsTestProject(project)); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsTestProjectReturnsTrueForProjectWithMbUnitFrameworkAssemblyReferenceUsingFullName() |
||||||
|
{ |
||||||
|
MockCSharpProject project = new MockCSharpProject(); |
||||||
|
string assemblyName = "mbunit, Version=2.5.3.9345, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77"; |
||||||
|
ReferenceProjectItem mbunitFrameworkRef = new ReferenceProjectItem(project, assemblyName); |
||||||
|
ProjectService.AddProjectItem(project, mbunitFrameworkRef); |
||||||
|
|
||||||
|
Assert.IsTrue(testFramework.IsTestProject(project)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,155 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Model = Gallio.Model; |
||||||
|
using Gallio.Extension; |
||||||
|
using Gallio.Runner.Events; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
using Gallio.SharpDevelop.Tests.Utils; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class GallioTestToSharpDevelopTestResultConversionTests |
||||||
|
{ |
||||||
|
GallioTestStepFinishedEventArgsFactory factory; |
||||||
|
TestStepFinishedEventArgs testStepEventArgs; |
||||||
|
GallioTestStepConverter converter; |
||||||
|
TestResult testResult; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
factory = new GallioTestStepFinishedEventArgsFactory(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioTestNameIsConvertedToSharpDevelopTestName() |
||||||
|
{ |
||||||
|
string gallioTestName = "MyNamespace/MyClass/MyTestMethod"; |
||||||
|
CreateGallioTestStepEventArgs(gallioTestName); |
||||||
|
ConvertToSharpDevelopTestResult(); |
||||||
|
|
||||||
|
string expectedTestName = "MyNamespace.MyClass.MyTestMethod"; |
||||||
|
Assert.AreEqual(expectedTestName, testResult.Name); |
||||||
|
} |
||||||
|
|
||||||
|
void CreateGallioTestStepEventArgs(string testName) |
||||||
|
{ |
||||||
|
testStepEventArgs = factory.Create(testName); |
||||||
|
} |
||||||
|
|
||||||
|
void ConvertToSharpDevelopTestResult() |
||||||
|
{ |
||||||
|
converter = new GallioTestStepConverter(testStepEventArgs); |
||||||
|
testResult = converter.GetTestResult(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioTestOutcomePassedIsConvertedToSharpDevelopTestSuccess() |
||||||
|
{ |
||||||
|
CreateGallioTestStepEventArgs(); |
||||||
|
UpdateGallioTestOutcomeToPassed(); |
||||||
|
ConvertToSharpDevelopTestResult(); |
||||||
|
|
||||||
|
Assert.AreEqual(TestResultType.Success, testResult.ResultType); |
||||||
|
} |
||||||
|
|
||||||
|
void CreateGallioTestStepEventArgs() |
||||||
|
{ |
||||||
|
CreateGallioTestStepEventArgs("MyNamespace.MyClass.MyTest"); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateGallioTestOutcomeToPassed() |
||||||
|
{ |
||||||
|
UpdateGallioTestOutcome(Model.TestOutcome.Passed); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateGallioTestOutcome(Model.TestOutcome testOutcome) |
||||||
|
{ |
||||||
|
testStepEventArgs.TestStepRun.Result.Outcome = testOutcome; |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioTestOutcomeErrorIsConvertedToSharpDevelopTestFailure() |
||||||
|
{ |
||||||
|
CreateGallioTestStepEventArgs(); |
||||||
|
UpdateGallioTestOutcomeToError(); |
||||||
|
ConvertToSharpDevelopTestResult(); |
||||||
|
|
||||||
|
Assert.AreEqual(TestResultType.Failure, testResult.ResultType); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateGallioTestOutcomeToError() |
||||||
|
{ |
||||||
|
UpdateGallioTestOutcome(Model.TestOutcome.Error); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioTestOutcomeSkippedIsConvertedToSharpDevelopTestIgnored() |
||||||
|
{ |
||||||
|
CreateGallioTestStepEventArgs(); |
||||||
|
UpdateGallioTestOutcomeToSkipped(); |
||||||
|
ConvertToSharpDevelopTestResult(); |
||||||
|
|
||||||
|
Assert.AreEqual(TestResultType.Ignored, testResult.ResultType); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateGallioTestOutcomeToSkipped() |
||||||
|
{ |
||||||
|
UpdateGallioTestOutcome(Model.TestOutcome.Skipped); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioTestOutcomeInconclusiveIsConvertedToSharpDevelopTestIgnored() |
||||||
|
{ |
||||||
|
CreateGallioTestStepEventArgs(); |
||||||
|
UpdateGallioTestOutcomeToInconclusive(); |
||||||
|
ConvertToSharpDevelopTestResult(); |
||||||
|
|
||||||
|
Assert.AreEqual(TestResultType.Ignored, testResult.ResultType); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateGallioTestOutcomeToInconclusive() |
||||||
|
{ |
||||||
|
UpdateGallioTestOutcome(Model.TestOutcome.Inconclusive); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioAssertionFailureMessageIsConvertedToSharpDevelopTestResultMessage() |
||||||
|
{ |
||||||
|
CreateGallioTestStepEventArgs(); |
||||||
|
UpdateGallioTestOutcomeToError(); |
||||||
|
UpdateGallioTestLogWithAssertionFailure(); |
||||||
|
ConvertToSharpDevelopTestResult(); |
||||||
|
|
||||||
|
string expectedMessage = "Expected value to be true. User assertion message."; |
||||||
|
Assert.AreEqual(expectedMessage, testResult.Message); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateGallioTestLogWithAssertionFailure() |
||||||
|
{ |
||||||
|
GallioBodyTagFactory factory = new GallioBodyTagFactory(); |
||||||
|
testStepEventArgs.TestStepRun.TestLog.Streams.Add(factory.CreateAssertionFailureStructuredStream()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void GallioAssertionFailureStackTraceIsConvertedToSharpDevelopTestResultStackTrace() |
||||||
|
{ |
||||||
|
CreateGallioTestStepEventArgs(); |
||||||
|
UpdateGallioTestOutcomeToError(); |
||||||
|
UpdateGallioTestLogWithAssertionFailure(); |
||||||
|
ConvertToSharpDevelopTestResult(); |
||||||
|
|
||||||
|
string expectedStackTrace = |
||||||
|
@" at GallioTest.MyClass.AssertWithFailureMessage() in d:\temp\test\GallioTest\MyClass.cs:line 46 "; |
||||||
|
Assert.AreEqual(expectedStackTrace, testResult.StackTrace); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,126 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.IO; |
||||||
|
using System.Text; |
||||||
|
using Gallio.Extension; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class TestResultsWriterTestFixture |
||||||
|
{ |
||||||
|
TestResultsWriter writer; |
||||||
|
StringBuilder results; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
results = new StringBuilder(); |
||||||
|
StringWriter stringWriter = new StringWriter(results); |
||||||
|
writer = new TestResultsWriter(stringWriter); |
||||||
|
} |
||||||
|
|
||||||
|
[TearDown] |
||||||
|
public void TearDown() |
||||||
|
{ |
||||||
|
writer.Dispose(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void WriteSuccessTestResult() |
||||||
|
{ |
||||||
|
TestResult testResult = new TestResult("MyTests.MyTestClass.MyTestMethod"); |
||||||
|
testResult.ResultType = TestResultType.Success; |
||||||
|
writer.Write(testResult); |
||||||
|
|
||||||
|
string expectedText = |
||||||
|
"Name: MyTests.MyTestClass.MyTestMethod\r\n" + |
||||||
|
"Result: Success\r\n"; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedText, results.ToString()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void WriteIgnoredTestResult() |
||||||
|
{ |
||||||
|
TestResult testResult = new TestResult("MyTests.MyTestClass.MyTestMethod"); |
||||||
|
testResult.ResultType = TestResultType.Ignored; |
||||||
|
writer.Write(testResult); |
||||||
|
|
||||||
|
string expectedText = |
||||||
|
"Name: MyTests.MyTestClass.MyTestMethod\r\n" + |
||||||
|
"Result: Ignored\r\n"; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedText, results.ToString()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void WriteFailedTestResult() |
||||||
|
{ |
||||||
|
TestResult testResult = new TestResult("MyTests.MyTestClass.MyTestMethod"); |
||||||
|
testResult.ResultType = TestResultType.Failure; |
||||||
|
testResult.Message = "message"; |
||||||
|
testResult.StackTrace = "stacktrace"; |
||||||
|
writer.Write(testResult); |
||||||
|
|
||||||
|
string expectedText = |
||||||
|
"Name: MyTests.MyTestClass.MyTestMethod\r\n" + |
||||||
|
"Result: Failure\r\n" + |
||||||
|
"Message: message\r\n" + |
||||||
|
"StackTrace: stacktrace\r\n"; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedText, results.ToString()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void WriteFailedTestResultWithTwoLineMessage() |
||||||
|
{ |
||||||
|
TestResult testResult = new TestResult("MyTests.MyTestClass.MyTestMethod"); |
||||||
|
testResult.ResultType = TestResultType.Failure; |
||||||
|
testResult.Message = "first\r\n" + |
||||||
|
"second"; |
||||||
|
testResult.StackTrace = "stacktrace"; |
||||||
|
writer.Write(testResult); |
||||||
|
|
||||||
|
string expectedText = |
||||||
|
"Name: MyTests.MyTestClass.MyTestMethod\r\n" + |
||||||
|
"Result: Failure\r\n" + |
||||||
|
"Message: first\r\n" + |
||||||
|
" second\r\n" + |
||||||
|
"StackTrace: stacktrace\r\n"; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedText, results.ToString()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void WriteFailedTestResultWithThreeLineStackTrace() |
||||||
|
{ |
||||||
|
TestResult testResult = new TestResult("MyTests.MyTestClass.MyTestMethod"); |
||||||
|
testResult.ResultType = TestResultType.Failure; |
||||||
|
testResult.Message = "first\r\n" + |
||||||
|
"second\r\n"; |
||||||
|
testResult.StackTrace = "first\r\n" + |
||||||
|
"second\r\n" + |
||||||
|
"third\r\n"; |
||||||
|
writer.Write(testResult); |
||||||
|
|
||||||
|
string expectedText = |
||||||
|
"Name: MyTests.MyTestClass.MyTestMethod\r\n" + |
||||||
|
"Result: Failure\r\n" + |
||||||
|
"Message: first\r\n" + |
||||||
|
" second\r\n" + |
||||||
|
"StackTrace: first\r\n" + |
||||||
|
" second\r\n" + |
||||||
|
" third\r\n"; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedText, results.ToString()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,71 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.Extension; |
||||||
|
using Gallio.Runtime.Logging; |
||||||
|
using Gallio.SharpDevelop.Tests.Utils; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class TestRunnerExtensionTestFixture |
||||||
|
{ |
||||||
|
SharpDevelopTestRunnerExtension testRunnerExtension; |
||||||
|
MockTestResultsWriterFactory factory; |
||||||
|
MockTestRunnerEvents testRunnerEvents; |
||||||
|
MockTestResultsWriter writer; |
||||||
|
NullLogger logger; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
testRunnerEvents = new MockTestRunnerEvents(); |
||||||
|
logger = new NullLogger(); |
||||||
|
factory = new MockTestResultsWriterFactory(); |
||||||
|
|
||||||
|
testRunnerExtension = new SharpDevelopTestRunnerExtension(factory); |
||||||
|
testRunnerExtension.Parameters = @"c:\temp\tmp77.tmp"; |
||||||
|
testRunnerExtension.Install(testRunnerEvents, logger); |
||||||
|
|
||||||
|
writer = factory.TestResultsWriter; |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultWriterCreatedWithFileNameTakenFromTestRunnerExtensionParameters() |
||||||
|
{ |
||||||
|
string expectedFileName = @"c:\temp\tmp77.tmp"; |
||||||
|
Assert.AreEqual(expectedFileName, writer.FileName); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FiringTestStepFinishedEventWritesTestResultNameToTestResultsWriter() |
||||||
|
{ |
||||||
|
string testName = "MyNamespace.MyTests.MyTestMethod"; |
||||||
|
testRunnerEvents.FireTestStepFinishedEvent("MyNamespace.MyTests.MyTestMethod"); |
||||||
|
|
||||||
|
Assert.AreEqual(testName, writer.FirstTestResult.Name); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestRunnerEventsDisposeStartedEventCausesTestResultsWriterToBeDisposed() |
||||||
|
{ |
||||||
|
testRunnerEvents.FireDisposeStartedEvent(); |
||||||
|
Assert.IsTrue(writer.IsDisposed); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FiringTestStepFinishedEventWithNonTestCaseDoesNotWriteTestResultToTestResultsWriter() |
||||||
|
{ |
||||||
|
testRunnerEvents.FireTestStepFinishedEventForNonTestCase("MyNamespace.MyTests.MyTestMethod"); |
||||||
|
|
||||||
|
Assert.AreEqual(0, writer.TestResults.Count); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,93 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.Model; |
||||||
|
using Gallio.Common.Markup; |
||||||
|
using Gallio.Common.Markup.Tags; |
||||||
|
using Gallio.Common.Reflection; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils |
||||||
|
{ |
||||||
|
public class GallioBodyTagFactory |
||||||
|
{ |
||||||
|
public StructuredStream CreateAssertionFailureStructuredStream() |
||||||
|
{ |
||||||
|
StructuredStream stream = new StructuredStream("Failures"); |
||||||
|
stream.Body = CreateAssertionFailure(); |
||||||
|
return stream; |
||||||
|
} |
||||||
|
|
||||||
|
public BodyTag CreateAssertionFailure() |
||||||
|
{ |
||||||
|
BodyTag bodyTag = new BodyTag(); |
||||||
|
bodyTag.Contents.Add(CreateAssertionFailureMarkerTag()); |
||||||
|
return bodyTag; |
||||||
|
} |
||||||
|
|
||||||
|
MarkerTag CreateAssertionFailureMarkerTag() |
||||||
|
{ |
||||||
|
MarkerTag markerTag = new MarkerTag(Marker.AssertionFailure); |
||||||
|
markerTag.Contents.Add(CreateAssertionFailureSectionTag()); |
||||||
|
return markerTag; |
||||||
|
} |
||||||
|
|
||||||
|
SectionTag CreateAssertionFailureSectionTag() |
||||||
|
{ |
||||||
|
SectionTag sectionTag = new SectionTag("Expected value to be true."); |
||||||
|
sectionTag.Contents.Add(CreateUserAssertionMessageTextTag()); |
||||||
|
sectionTag.Contents.Add(CreateMonospaceMarkerTag()); |
||||||
|
sectionTag.Contents.Add(CreateEmptyTextTag()); |
||||||
|
sectionTag.Contents.Add(CreateStackTraceMarkerTag()); |
||||||
|
return sectionTag; |
||||||
|
} |
||||||
|
|
||||||
|
TextTag CreateUserAssertionMessageTextTag() |
||||||
|
{ |
||||||
|
return new TextTag("User assertion message."); |
||||||
|
} |
||||||
|
|
||||||
|
MarkerTag CreateMonospaceMarkerTag() |
||||||
|
{ |
||||||
|
return new MarkerTag(Marker.Monospace); |
||||||
|
} |
||||||
|
|
||||||
|
TextTag CreateEmptyTextTag() |
||||||
|
{ |
||||||
|
return new TextTag(String.Empty); |
||||||
|
} |
||||||
|
|
||||||
|
MarkerTag CreateStackTraceMarkerTag() |
||||||
|
{ |
||||||
|
MarkerTag markerTag = new MarkerTag(Marker.StackTrace); |
||||||
|
markerTag.Contents.Add(CreateStackTraceTextTag()); |
||||||
|
markerTag.Contents.Add(CreateCodeLocationMarkerTag()); |
||||||
|
return markerTag; |
||||||
|
} |
||||||
|
|
||||||
|
TextTag CreateStackTraceTextTag() |
||||||
|
{ |
||||||
|
string text = " at GallioTest.MyClass.AssertWithFailureMessage() in "; |
||||||
|
return new TextTag(text); |
||||||
|
} |
||||||
|
|
||||||
|
MarkerTag CreateCodeLocationMarkerTag() |
||||||
|
{ |
||||||
|
CodeLocation location = new CodeLocation(); |
||||||
|
Marker marker = Marker.CodeLocation(location); |
||||||
|
MarkerTag markerTag = new MarkerTag(marker); |
||||||
|
markerTag.Contents.Add(CreateCodeLocationTextTag()); |
||||||
|
return markerTag; |
||||||
|
} |
||||||
|
|
||||||
|
TextTag CreateCodeLocationTextTag() |
||||||
|
{ |
||||||
|
string text = @"d:\temp\test\GallioTest\MyClass.cs:line 46 "; |
||||||
|
return new TextTag(text); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using Gallio.Model.Schema; |
||||||
|
using Gallio.Runner.Events; |
||||||
|
using Gallio.Runner.Reports.Schema; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils |
||||||
|
{ |
||||||
|
public class GallioTestStepFinishedEventArgsFactory |
||||||
|
{ |
||||||
|
TestData gallioTest; |
||||||
|
Report gallioReport = new Report(); |
||||||
|
TestStepRun gallioTestStepRun; |
||||||
|
|
||||||
|
public TestStepFinishedEventArgs Create(string name) |
||||||
|
{ |
||||||
|
CreateTestData(name); |
||||||
|
CreateTestStepRun(); |
||||||
|
return CreateTestStepFinishedEventArgs(); |
||||||
|
} |
||||||
|
|
||||||
|
void CreateTestData(string name) |
||||||
|
{ |
||||||
|
string gallioTestName = ConvertToGallioTestName(name); |
||||||
|
gallioTest = new TestData("a", "b", gallioTestName); |
||||||
|
gallioTest.IsTestCase = true; |
||||||
|
} |
||||||
|
|
||||||
|
void CreateTestStepRun() |
||||||
|
{ |
||||||
|
TestStepData testStepData = new TestStepData("a", "b", "c", "d"); |
||||||
|
gallioTestStepRun = new TestStepRun(testStepData); |
||||||
|
} |
||||||
|
|
||||||
|
string ConvertToGallioTestName(string name) |
||||||
|
{ |
||||||
|
return name.Replace('.', '/'); |
||||||
|
} |
||||||
|
|
||||||
|
TestStepFinishedEventArgs CreateTestStepFinishedEventArgs() |
||||||
|
{ |
||||||
|
return new TestStepFinishedEventArgs(gallioReport, gallioTest, gallioTestStepRun); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,52 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.Extension; |
||||||
|
using System.Collections.Generic; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils |
||||||
|
{ |
||||||
|
public class MockTestResultsWriter : ITestResultsWriter |
||||||
|
{ |
||||||
|
string fileName = String.Empty; |
||||||
|
List<TestResult> testResults = new List<TestResult>(); |
||||||
|
bool disposed; |
||||||
|
|
||||||
|
public MockTestResultsWriter(string fileName) |
||||||
|
{ |
||||||
|
this.fileName = fileName; |
||||||
|
} |
||||||
|
|
||||||
|
public string FileName { |
||||||
|
get { return fileName; } |
||||||
|
} |
||||||
|
|
||||||
|
public void Write(TestResult testResult) |
||||||
|
{ |
||||||
|
testResults.Add(testResult); |
||||||
|
} |
||||||
|
|
||||||
|
public List<TestResult> TestResults { |
||||||
|
get { return testResults; } |
||||||
|
} |
||||||
|
|
||||||
|
public TestResult FirstTestResult { |
||||||
|
get { return testResults[0]; } |
||||||
|
} |
||||||
|
|
||||||
|
public void Dispose() |
||||||
|
{ |
||||||
|
disposed = true; |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsDisposed { |
||||||
|
get { return disposed; } |
||||||
|
set { disposed = value; } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,28 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.Extension; |
||||||
|
using Gallio.SharpDevelop; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils |
||||||
|
{ |
||||||
|
public class MockTestResultsWriterFactory : ITestResultsWriterFactory |
||||||
|
{ |
||||||
|
MockTestResultsWriter testResultsWriter; |
||||||
|
|
||||||
|
public ITestResultsWriter Create(string fileName) |
||||||
|
{ |
||||||
|
testResultsWriter = new MockTestResultsWriter(fileName); |
||||||
|
return testResultsWriter; |
||||||
|
} |
||||||
|
|
||||||
|
public MockTestResultsWriter TestResultsWriter { |
||||||
|
get { return testResultsWriter; } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,76 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using Gallio.Runner.Events; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils |
||||||
|
{ |
||||||
|
public class MockTestRunnerEvents : ITestRunnerEvents |
||||||
|
{ |
||||||
|
#pragma warning disable 67
|
||||||
|
|
||||||
|
public event EventHandler<Gallio.Runtime.Logging.LogEntrySubmittedEventArgs> LogEntrySubmitted; |
||||||
|
public event EventHandler<Gallio.Runner.Events.MessageReceivedEventArgs> MessageReceived; |
||||||
|
public event EventHandler<InitializeStartedEventArgs> InitializeStarted; |
||||||
|
public event EventHandler<InitializeFinishedEventArgs> InitializeFinished; |
||||||
|
public event EventHandler<DisposeStartedEventArgs> DisposeStarted; |
||||||
|
public event EventHandler<DisposeFinishedEventArgs> DisposeFinished; |
||||||
|
public event EventHandler<ExploreStartedEventArgs> ExploreStarted; |
||||||
|
public event EventHandler<ExploreFinishedEventArgs> ExploreFinished; |
||||||
|
public event EventHandler<RunStartedEventArgs> RunStarted; |
||||||
|
public event EventHandler<RunFinishedEventArgs> RunFinished; |
||||||
|
public event EventHandler<TestDiscoveredEventArgs> TestDiscovered; |
||||||
|
public event EventHandler<AnnotationDiscoveredEventArgs> AnnotationDiscovered; |
||||||
|
public event EventHandler<TestStepStartedEventArgs> TestStepStarted; |
||||||
|
public event EventHandler<TestStepFinishedEventArgs> TestStepFinished; |
||||||
|
public event EventHandler<TestStepLifecyclePhaseChangedEventArgs> TestStepLifecyclePhaseChanged; |
||||||
|
public event EventHandler<TestStepMetadataAddedEventArgs> TestStepMetadataAdded; |
||||||
|
public event EventHandler<TestStepLogAttachEventArgs> TestStepLogAttach; |
||||||
|
public event EventHandler<TestStepLogStreamWriteEventArgs> TestStepLogStreamWrite; |
||||||
|
public event EventHandler<TestStepLogStreamEmbedEventArgs> TestStepLogStreamEmbed; |
||||||
|
public event EventHandler<TestStepLogStreamBeginSectionBlockEventArgs> TestStepLogStreamBeginSectionBlock; |
||||||
|
public event EventHandler<TestStepLogStreamBeginMarkerBlockEventArgs> TestStepLogStreamBeginMarkerBlock; |
||||||
|
public event EventHandler<TestStepLogStreamEndBlockEventArgs> TestStepLogStreamEndBlock; |
||||||
|
|
||||||
|
#pragma warning restore 67
|
||||||
|
|
||||||
|
public void FireTestStepFinishedEvent(string name) |
||||||
|
{ |
||||||
|
TestStepFinishedEventArgs e = CreateTestStepFinishedEventArgs(name); |
||||||
|
FireTestStepFinishedEvent(e); |
||||||
|
} |
||||||
|
|
||||||
|
TestStepFinishedEventArgs CreateTestStepFinishedEventArgs(string testName) |
||||||
|
{ |
||||||
|
GallioTestStepFinishedEventArgsFactory factory = new GallioTestStepFinishedEventArgsFactory(); |
||||||
|
return factory.Create(testName); |
||||||
|
} |
||||||
|
|
||||||
|
void FireTestStepFinishedEvent(TestStepFinishedEventArgs e) |
||||||
|
{ |
||||||
|
if (TestStepFinished != null) { |
||||||
|
TestStepFinished(this, e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void FireTestStepFinishedEventForNonTestCase(string testName) |
||||||
|
{ |
||||||
|
TestStepFinishedEventArgs e = CreateTestStepFinishedEventArgs(testName); |
||||||
|
e.Test.IsTestCase = false; |
||||||
|
FireTestStepFinishedEvent(e); |
||||||
|
} |
||||||
|
|
||||||
|
public void FireDisposeStartedEvent() |
||||||
|
{ |
||||||
|
if (DisposeStarted != null) { |
||||||
|
DisposeStarted(this, new DisposeStartedEventArgs()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,175 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.Common.Markup; |
||||||
|
using Gallio.Common.Markup.Tags; |
||||||
|
using Gallio.SharpDevelop.Tests.Utils; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class CreateAssertionFailureBodyTagTestFixture |
||||||
|
{ |
||||||
|
StructuredStream structuredStream; |
||||||
|
BodyTag bodyTag; |
||||||
|
MarkerTag assertionFailureMarkerTag; |
||||||
|
SectionTag expectedValueToBeTrueSectionTag; |
||||||
|
TextTag expectedValueToBeTrueTextTag; |
||||||
|
MarkerTag monoSpaceMarkerTag; |
||||||
|
TextTag textTagAfterMonoSpaceMarkerTag; |
||||||
|
MarkerTag stackTraceMarkerTag; |
||||||
|
TextTag stackTraceTextTag; |
||||||
|
MarkerTag codeLocationMarkerTag; |
||||||
|
TextTag codeLocationTextTag; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
GallioBodyTagFactory factory = new GallioBodyTagFactory(); |
||||||
|
structuredStream = factory.CreateAssertionFailureStructuredStream(); |
||||||
|
bodyTag = structuredStream.Body; |
||||||
|
assertionFailureMarkerTag = GetFirstChildMarkerTag(bodyTag); |
||||||
|
expectedValueToBeTrueSectionTag = GetFirstChildSectionTag(assertionFailureMarkerTag); |
||||||
|
expectedValueToBeTrueTextTag = GetFirstChildTextTag(expectedValueToBeTrueSectionTag); |
||||||
|
monoSpaceMarkerTag = GetSecondChildMarkerTag(expectedValueToBeTrueSectionTag); |
||||||
|
textTagAfterMonoSpaceMarkerTag = GetThirdChildTextTag(expectedValueToBeTrueSectionTag); |
||||||
|
stackTraceMarkerTag = GetFourthChildMarkerTag(expectedValueToBeTrueSectionTag); |
||||||
|
stackTraceTextTag = GetFirstChildTextTag(stackTraceMarkerTag); |
||||||
|
codeLocationMarkerTag = GetSecondChildMarkerTag(stackTraceMarkerTag); |
||||||
|
codeLocationTextTag = GetFirstChildTextTag(codeLocationMarkerTag); |
||||||
|
} |
||||||
|
|
||||||
|
MarkerTag GetFirstChildMarkerTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetFirstChildTag(parentTag) as MarkerTag; |
||||||
|
} |
||||||
|
|
||||||
|
Tag GetFirstChildTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetChildTagAtPosition(parentTag, 1); |
||||||
|
} |
||||||
|
|
||||||
|
Tag GetChildTagAtPosition(ContainerTag parentTag, int position) |
||||||
|
{ |
||||||
|
if (TagHasChildTagAtPosition(parentTag, position)) { |
||||||
|
int index = position - 1; |
||||||
|
return parentTag.Contents[index]; |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
bool TagHasChildTagAtPosition(ContainerTag tag, int position) |
||||||
|
{ |
||||||
|
if (tag != null) { |
||||||
|
return tag.Contents.Count >= position; |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
SectionTag GetFirstChildSectionTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetFirstChildTag(parentTag) as SectionTag; |
||||||
|
} |
||||||
|
|
||||||
|
TextTag GetFirstChildTextTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetFirstChildTag(parentTag) as TextTag; |
||||||
|
} |
||||||
|
|
||||||
|
MarkerTag GetSecondChildMarkerTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetSecondChildTag(parentTag) as MarkerTag; |
||||||
|
} |
||||||
|
|
||||||
|
Tag GetSecondChildTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetChildTagAtPosition(parentTag, 2); |
||||||
|
} |
||||||
|
|
||||||
|
TextTag GetThirdChildTextTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetChildTagAtPosition(parentTag, 3) as TextTag; |
||||||
|
} |
||||||
|
|
||||||
|
MarkerTag GetFourthChildMarkerTag(ContainerTag parentTag) |
||||||
|
{ |
||||||
|
return GetChildTagAtPosition(parentTag, 4) as MarkerTag; |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void StructuredStreamNameIsFailures() |
||||||
|
{ |
||||||
|
Assert.AreEqual("Failures", structuredStream.Name); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void BodyTagHasOneChildTag() |
||||||
|
{ |
||||||
|
Assert.AreEqual(1, bodyTag.Contents.Count); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void BodyTagChildIsMarkerTagWithClassSetToAssertionFailure() |
||||||
|
{ |
||||||
|
Assert.AreEqual("AssertionFailure", assertionFailureMarkerTag.Class); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void AssertionFailureMarkerTagHasSectionTagContentsWithTagNameEqualToExpectedValueToBeTrue() |
||||||
|
{ |
||||||
|
string expectedName = "Expected value to be true."; |
||||||
|
Assert.AreEqual(expectedName, expectedValueToBeTrueSectionTag.Name); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void ExpectedValueToBeTrueSectionTagHasTextTagChildWithTextSetToUserAssertionMessage() |
||||||
|
{ |
||||||
|
string expectedText = "User assertion message."; |
||||||
|
Assert.AreEqual(expectedText, expectedValueToBeTrueTextTag.Text); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void ExpectedValueToBeTrueSectionTagHasMarkerTagChildWithClassSetToMonospace() |
||||||
|
{ |
||||||
|
Assert.AreEqual("Monospace", monoSpaceMarkerTag.Class); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void ExpectedValueToBeTrueSectionTagHasTextTagChildAfterMonospaceTagChild() |
||||||
|
{ |
||||||
|
Assert.IsNotNull(textTagAfterMonoSpaceMarkerTag); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void ExpectedValueToBeTrueSectionTagHasMarkerTagWithClassSetToStackTrace() |
||||||
|
{ |
||||||
|
Assert.AreEqual("StackTrace", stackTraceMarkerTag.Class); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void StackTraceTagHasFirstChildTextTagWithFirstLineOfStackTrace() |
||||||
|
{ |
||||||
|
string expectedText = " at GallioTest.MyClass.AssertWithFailureMessage() in "; |
||||||
|
Assert.AreEqual(expectedText, stackTraceTextTag.Text); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void StackTraceTagHasMarkerTagChildWithClassSetToCodeLocation() |
||||||
|
{ |
||||||
|
Assert.AreEqual("CodeLocation", codeLocationMarkerTag.Class); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void CodeLocationMarkerHasTextTagWithCodeLocationText() |
||||||
|
{ |
||||||
|
string expectedText = @"d:\temp\test\GallioTest\MyClass.cs:line 46 "; |
||||||
|
Assert.AreEqual(expectedText, codeLocationTextTag.Text); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,82 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.Extension; |
||||||
|
using Gallio.SharpDevelop.Tests.Utils; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class MockTestResultsWriterFactoryTests |
||||||
|
{ |
||||||
|
MockTestResultsWriterFactory factory; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
factory = new MockTestResultsWriterFactory(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultsWritersSavedByFactory() |
||||||
|
{ |
||||||
|
ITestResultsWriter writer = factory.Create("testresults.txt"); |
||||||
|
Assert.AreEqual(writer, factory.TestResultsWriter); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultsWriterCreatedIsMockTestResultsWriter() |
||||||
|
{ |
||||||
|
MockTestResultsWriter writer = factory.Create("abc.txt") as MockTestResultsWriter; |
||||||
|
Assert.IsNotNull(writer); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultsWriterCreatedWithFileNamePassedToFactoryCreateMethod() |
||||||
|
{ |
||||||
|
MockTestResultsWriter writer = factory.Create("testresults.txt") as MockTestResultsWriter; |
||||||
|
Assert.AreEqual("testresults.txt", writer.FileName); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestResultsWriterSavesTestResultsWritten() |
||||||
|
{ |
||||||
|
TestResult firstResult = new TestResult("test1"); |
||||||
|
TestResult secondResult = new TestResult("test2"); |
||||||
|
MockTestResultsWriter writer = factory.Create("testresults.txt") as MockTestResultsWriter; |
||||||
|
writer.Write(firstResult); |
||||||
|
writer.Write(secondResult); |
||||||
|
|
||||||
|
TestResult[] expectedTestResults = new TestResult[] { firstResult, secondResult }; |
||||||
|
|
||||||
|
Assert.AreEqual(expectedTestResults, writer.TestResults.ToArray()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FirstTestResultsWriterReturnsFirstTestResultsWriter() |
||||||
|
{ |
||||||
|
TestResult firstResult = new TestResult("test1"); |
||||||
|
TestResult secondResult = new TestResult("test2"); |
||||||
|
MockTestResultsWriter writer = factory.Create("testresults.txt") as MockTestResultsWriter; |
||||||
|
writer.Write(firstResult); |
||||||
|
writer.Write(secondResult); |
||||||
|
|
||||||
|
Assert.AreEqual(firstResult, writer.FirstTestResult); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void IsDisposedCalledReturnsTrueAfterDisposeMethodCalled() |
||||||
|
{ |
||||||
|
MockTestResultsWriter writer = factory.Create("testresults.txt") as MockTestResultsWriter; |
||||||
|
writer.IsDisposed = false; |
||||||
|
writer.Dispose(); |
||||||
|
Assert.IsTrue(writer.IsDisposed); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,69 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
using Gallio.Runner.Events; |
||||||
|
using Gallio.SharpDevelop.Tests.Utils; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop.Tests.Utils.Tests |
||||||
|
{ |
||||||
|
[TestFixture] |
||||||
|
public class MockTestRunnerEventsTestFixture |
||||||
|
{ |
||||||
|
MockTestRunnerEvents testRunnerEvents; |
||||||
|
TestStepFinishedEventArgs testStepFinishedEventArgs; |
||||||
|
|
||||||
|
[SetUp] |
||||||
|
public void Init() |
||||||
|
{ |
||||||
|
testRunnerEvents = new MockTestRunnerEvents(); |
||||||
|
testRunnerEvents.TestStepFinished += delegate (object source, TestStepFinishedEventArgs e) { |
||||||
|
testStepFinishedEventArgs = e; |
||||||
|
}; |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FireTestStepFinishedEventWithTestResultCreatesGallioTestDataWithExpectedFullName() |
||||||
|
{ |
||||||
|
testRunnerEvents.FireTestStepFinishedEvent("MyNamespace/MyTests/MyTestMethod"); |
||||||
|
|
||||||
|
string expectedFullName = "MyNamespace/MyTests/MyTestMethod"; |
||||||
|
string actualFullName = testStepFinishedEventArgs.Test.FullName; |
||||||
|
Assert.AreEqual(expectedFullName, actualFullName); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FireTestStepFinishedEventCreatesGallioTestDataWithIsTestCaseSetToTrue() |
||||||
|
{ |
||||||
|
testRunnerEvents.FireTestStepFinishedEvent("testName"); |
||||||
|
|
||||||
|
Assert.IsTrue(testStepFinishedEventArgs.Test.IsTestCase); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FireTestStepFinishedEventForNonTestCaseCreatesGallioTestDataIsTestCaseSetToFalse() |
||||||
|
{ |
||||||
|
testRunnerEvents.FireTestStepFinishedEventForNonTestCase("testName"); |
||||||
|
|
||||||
|
Assert.IsFalse(testStepFinishedEventArgs.Test.IsTestCase); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void FireDisposeStartedEventTriggersEvent() |
||||||
|
{ |
||||||
|
DisposeStartedEventArgs eventArgs = null; |
||||||
|
testRunnerEvents.DisposeStarted += delegate(object sender, DisposeStartedEventArgs e) { |
||||||
|
eventArgs = e; |
||||||
|
}; |
||||||
|
testRunnerEvents.FireDisposeStartedEvent(); |
||||||
|
|
||||||
|
Assert.IsNotNull(eventArgs); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00 |
||||||
|
# Visual Studio 2010 |
||||||
|
# SharpDevelop 4.0.0.5840 |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gallio.SharpDevelop", "Gallio.SharpDevelop\Gallio.SharpDevelop.csproj", "{88D3DC5E-8A91-4DCE-A785-CC37DE0AA0EC}" |
||||||
|
EndProject |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gallio.SharpDevelop.Tests", "Gallio.SharpDevelop.Tests\Gallio.SharpDevelop.Tests.csproj", "{3F6C539D-DB38-41B4-A5B3-B9A52AE607CD}" |
||||||
|
EndProject |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gallio.Extension", "Gallio.Extension\Gallio.Extension.csproj", "{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}" |
||||||
|
EndProject |
||||||
|
Global |
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||||
|
Debug|x86 = Debug|x86 |
||||||
|
Release|x86 = Release|x86 |
||||||
|
EndGlobalSection |
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||||
|
{88D3DC5E-8A91-4DCE-A785-CC37DE0AA0EC}.Debug|x86.Build.0 = Debug|x86 |
||||||
|
{88D3DC5E-8A91-4DCE-A785-CC37DE0AA0EC}.Debug|x86.ActiveCfg = Debug|x86 |
||||||
|
{88D3DC5E-8A91-4DCE-A785-CC37DE0AA0EC}.Release|x86.Build.0 = Release|x86 |
||||||
|
{88D3DC5E-8A91-4DCE-A785-CC37DE0AA0EC}.Release|x86.ActiveCfg = Release|x86 |
||||||
|
{3F6C539D-DB38-41B4-A5B3-B9A52AE607CD}.Debug|x86.Build.0 = Debug|x86 |
||||||
|
{3F6C539D-DB38-41B4-A5B3-B9A52AE607CD}.Debug|x86.ActiveCfg = Debug|x86 |
||||||
|
{3F6C539D-DB38-41B4-A5B3-B9A52AE607CD}.Release|x86.Build.0 = Release|x86 |
||||||
|
{3F6C539D-DB38-41B4-A5B3-B9A52AE607CD}.Release|x86.ActiveCfg = Release|x86 |
||||||
|
{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}.Debug|x86.Build.0 = Debug|x86 |
||||||
|
{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}.Debug|x86.ActiveCfg = Debug|x86 |
||||||
|
{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}.Release|x86.Build.0 = Release|x86 |
||||||
|
{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}.Release|x86.ActiveCfg = Release|x86 |
||||||
|
EndGlobalSection |
||||||
|
EndGlobal |
@ -0,0 +1,28 @@ |
|||||||
|
<AddIn name="Unit Testing Addin" |
||||||
|
author="Matt Ward" |
||||||
|
copyright="prj:///doc/copyright.txt" |
||||||
|
description="Runs unit tests with Gallio inside SharpDevelop" |
||||||
|
addInManagerHidden="preinstalled"> |
||||||
|
|
||||||
|
<Manifest> |
||||||
|
<Identity name="ICSharpCode.Gallio"/> |
||||||
|
<Dependency addin="SharpDevelop"/> |
||||||
|
<Dependency addin="ICSharpCode.UnitTesting"/> |
||||||
|
</Manifest> |
||||||
|
|
||||||
|
<Runtime> |
||||||
|
<Import assembly="Gallio.SharpDevelop.dll"/> |
||||||
|
<Import assembly="$ICSharpCode.UnitTesting/UnitTesting.dll"/> |
||||||
|
</Runtime> |
||||||
|
|
||||||
|
<Path name="/SharpDevelop/UnitTesting/GallioEchoApplication"> |
||||||
|
<String id="GallioEchoApplication" text="D:\projects\dotnet\mirador\SharpDevelop\samples\Gallio\Gallio\bin\Gallio.Echo.exe"/> |
||||||
|
</Path> |
||||||
|
|
||||||
|
<Path name="/SharpDevelop/UnitTesting/TestFrameworks"> |
||||||
|
<TestFramework id="gallio" |
||||||
|
class="Gallio.SharpDevelop.GallioTestFramework" |
||||||
|
supportedProjects=".csproj;.vbproj" |
||||||
|
insertbefore="nunit" /> |
||||||
|
</Path> |
||||||
|
</AddIn> |
@ -0,0 +1,87 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||||
|
<PropertyGroup> |
||||||
|
<ProjectGuid>{88D3DC5E-8A91-4DCE-A785-CC37DE0AA0EC}</ProjectGuid> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||||
|
<OutputType>Library</OutputType> |
||||||
|
<RootNamespace>Gallio.SharpDevelop</RootNamespace> |
||||||
|
<AssemblyName>Gallio.SharpDevelop</AssemblyName> |
||||||
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||||
|
<SourceAnalysisOverrideSettingsFile>C:\Users\Matt\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile> |
||||||
|
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||||
|
<NoStdLib>False</NoStdLib> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> |
||||||
|
<PlatformTarget>x86</PlatformTarget> |
||||||
|
<RegisterForComInterop>False</RegisterForComInterop> |
||||||
|
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||||
|
<BaseAddress>4194304</BaseAddress> |
||||||
|
<FileAlignment>4096</FileAlignment> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||||
|
<OutputPath>..\..\..\AddIns\Samples\Gallio</OutputPath> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>Full</DebugType> |
||||||
|
<Optimize>False</Optimize> |
||||||
|
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||||
|
<OutputPath>..\..\..\AddIns\Samples\Gallio</OutputPath> |
||||||
|
<DebugSymbols>false</DebugSymbols> |
||||||
|
<DebugType>None</DebugType> |
||||||
|
<Optimize>True</Optimize> |
||||||
|
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||||
|
<DefineConstants>TRACE</DefineConstants> |
||||||
|
</PropertyGroup> |
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||||
|
<ItemGroup> |
||||||
|
<Reference Include="Gallio"> |
||||||
|
<HintPath>..\Gallio\bin\Gallio.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.Core"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.SharpDevelop"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
<Reference Include="ICSharpCode.SharpDevelop.Dom"> |
||||||
|
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
<Reference Include="System" /> |
||||||
|
<Reference Include="System.Xml" /> |
||||||
|
<Reference Include="UnitTesting"> |
||||||
|
<HintPath>..\..\..\AddIns\AddIns\Misc\UnitTesting\UnitTesting.dll</HintPath> |
||||||
|
<Private>False</Private> |
||||||
|
</Reference> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Compile Include="GallioEchoConsoleApplication.cs" /> |
||||||
|
<Compile Include="GallioEchoConsoleApplicationFactory.cs" /> |
||||||
|
<Compile Include="GallioEchoConsoleApplicationProcessStartInfo.cs" /> |
||||||
|
<Compile Include="GallioTestDebugger.cs" /> |
||||||
|
<Compile Include="GallioTestFramework.cs" /> |
||||||
|
<Compile Include="GallioTestResult.cs" /> |
||||||
|
<Compile Include="GallioTestRunner.cs" /> |
||||||
|
<Compile Include="MbUnitTestAttributeName.cs" /> |
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||||
|
<Compile Include="SharpDevelopTestRunnerExtensionCommandLineArgument.cs" /> |
||||||
|
<Compile Include="TestRunnerExtensionCommandLineArgument.cs" /> |
||||||
|
<None Include="Gallio.SharpDevelop.addin"> |
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||||
|
</None> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<ProjectReference Include="..\Gallio.Extension\Gallio.Extension.csproj"> |
||||||
|
<Project>{98030C86-7B0F-4813-AC4D-9FFCF00CF81F}</Project> |
||||||
|
<Name>Gallio.Extension</Name> |
||||||
|
</ProjectReference> |
||||||
|
</ItemGroup> |
||||||
|
</Project> |
@ -0,0 +1,96 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Diagnostics; |
||||||
|
using System.Text; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class GallioEchoConsoleApplication |
||||||
|
{ |
||||||
|
string fileName = String.Empty; |
||||||
|
SelectedTests selectedTests; |
||||||
|
StringBuilder commandLine = new StringBuilder(); |
||||||
|
List<TestRunnerExtensionCommandLineArgument> testRunnerExtensions = |
||||||
|
new List<TestRunnerExtensionCommandLineArgument>(); |
||||||
|
|
||||||
|
public GallioEchoConsoleApplication(SelectedTests selectedTests, string fileName) |
||||||
|
{ |
||||||
|
this.selectedTests = selectedTests; |
||||||
|
this.fileName = fileName; |
||||||
|
} |
||||||
|
|
||||||
|
public GallioEchoConsoleApplication(SelectedTests selectedTests) |
||||||
|
: this(selectedTests, String.Empty) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public string FileName { |
||||||
|
get { return fileName; } |
||||||
|
} |
||||||
|
|
||||||
|
public List<TestRunnerExtensionCommandLineArgument> TestRunnerExtensions { |
||||||
|
get { return testRunnerExtensions; } |
||||||
|
} |
||||||
|
|
||||||
|
public string GetArguments() |
||||||
|
{ |
||||||
|
AppendDotNet4Framework(); |
||||||
|
AppendTestRunnerExtensions(); |
||||||
|
AppendAssemblyToTest(); |
||||||
|
|
||||||
|
return commandLine.ToString().TrimEnd(); |
||||||
|
} |
||||||
|
|
||||||
|
void AppendDotNet4Framework() |
||||||
|
{ |
||||||
|
AppendArgument("/rv:v4.0.30319"); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void AppendTestRunnerExtensions() |
||||||
|
{ |
||||||
|
foreach (TestRunnerExtensionCommandLineArgument arg in testRunnerExtensions) { |
||||||
|
AppendArgument(arg.ToString()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void AppendArgument(string argument) |
||||||
|
{ |
||||||
|
commandLine.Append(argument); |
||||||
|
commandLine.Append(' '); |
||||||
|
} |
||||||
|
|
||||||
|
void AppendAssemblyToTest() |
||||||
|
{ |
||||||
|
AppendQuoted(selectedTests.Project.OutputAssemblyFullPath); |
||||||
|
} |
||||||
|
|
||||||
|
void AppendQuoted(string argument) |
||||||
|
{ |
||||||
|
commandLine.AppendFormat("\"{0}\"", argument); |
||||||
|
} |
||||||
|
|
||||||
|
public ProcessStartInfo GetProcessStartInfo() |
||||||
|
{ |
||||||
|
ProcessStartInfo startInfo = new ProcessStartInfo(); |
||||||
|
startInfo.FileName = fileName; |
||||||
|
startInfo.Arguments = GetArguments(); |
||||||
|
startInfo.WorkingDirectory = GetWorkingDirectory(); |
||||||
|
return startInfo; |
||||||
|
} |
||||||
|
|
||||||
|
string GetWorkingDirectory() |
||||||
|
{ |
||||||
|
return StringParser.Parse("${addinpath:ICSharpCode.Gallio}"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class GallioEchoConsoleApplicationFactory |
||||||
|
{ |
||||||
|
public static readonly string AddInTreePath = "/SharpDevelop/UnitTesting/GallioEchoApplication"; |
||||||
|
|
||||||
|
string gallioEchoConsoleApplicationFileName = "Gallio.Echo.exe"; |
||||||
|
|
||||||
|
public GallioEchoConsoleApplicationFactory() |
||||||
|
: this(new UnitTestAddInTree()) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public GallioEchoConsoleApplicationFactory(IAddInTree addInTree) |
||||||
|
{ |
||||||
|
ReadFileName(addInTree); |
||||||
|
} |
||||||
|
|
||||||
|
void ReadFileName(IAddInTree addInTree) |
||||||
|
{ |
||||||
|
List<string> items = addInTree.BuildItems<string>(AddInTreePath, this); |
||||||
|
gallioEchoConsoleApplicationFileName = items[0]; |
||||||
|
} |
||||||
|
|
||||||
|
public GallioEchoConsoleApplication Create(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
return new GallioEchoConsoleApplication(selectedTests, gallioEchoConsoleApplicationFileName); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class GallioEchoConsoleApplicationProcessStartInfo |
||||||
|
{ |
||||||
|
ProcessStartInfo processStartInfo = new ProcessStartInfo(); |
||||||
|
|
||||||
|
public GallioEchoConsoleApplicationProcessStartInfo(SelectedTests selectedTests, string testResultsFileName) |
||||||
|
{ |
||||||
|
GallioEchoConsoleApplicationFactory factory = new GallioEchoConsoleApplicationFactory(); |
||||||
|
GallioEchoConsoleApplication app = factory.Create(selectedTests); |
||||||
|
SharpDevelopTestRunnerExtensionCommandLineArgument argument = new SharpDevelopTestRunnerExtensionCommandLineArgument(); |
||||||
|
argument.TestResultsFileName = testResultsFileName; |
||||||
|
app.TestRunnerExtensions.Add(argument); |
||||||
|
processStartInfo = app.GetProcessStartInfo(); |
||||||
|
} |
||||||
|
|
||||||
|
public ProcessStartInfo ProcessStartInfo { |
||||||
|
get { return processStartInfo; } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class GallioTestDebugger : TestDebuggerBase |
||||||
|
{ |
||||||
|
public GallioTestDebugger() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
protected override ProcessStartInfo GetProcessStartInfo(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
GallioEchoConsoleApplicationProcessStartInfo startInfo = |
||||||
|
new GallioEchoConsoleApplicationProcessStartInfo(selectedTests, base.TestResultsMonitor.FileName); |
||||||
|
startInfo.ProcessStartInfo.Arguments += " /d"; |
||||||
|
return startInfo.ProcessStartInfo; |
||||||
|
} |
||||||
|
|
||||||
|
protected override TestResult CreateTestResultForTestFramework(TestResult testResult) |
||||||
|
{ |
||||||
|
return new GallioTestResult(testResult); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,111 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class GallioTestFramework : ITestFramework |
||||||
|
{ |
||||||
|
public GallioTestFramework() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsTestProject(IProject project) |
||||||
|
{ |
||||||
|
if (project != null) { |
||||||
|
foreach (ProjectItem projectItem in project.Items) { |
||||||
|
ReferenceProjectItem referenceProjectItem = projectItem as ReferenceProjectItem; |
||||||
|
if (IsMbUnitFrameworkAssemblyReference(referenceProjectItem)) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
bool IsMbUnitFrameworkAssemblyReference(ReferenceProjectItem referenceProjectItem) |
||||||
|
{ |
||||||
|
if (referenceProjectItem != null) { |
||||||
|
string name = referenceProjectItem.ShortName; |
||||||
|
return name.Equals("MbUnit", StringComparison.OrdinalIgnoreCase); |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
public ITestRunner CreateTestRunner() |
||||||
|
{ |
||||||
|
return new GallioTestRunner(); |
||||||
|
} |
||||||
|
|
||||||
|
public ITestRunner CreateTestDebugger() |
||||||
|
{ |
||||||
|
return new GallioTestDebugger(); |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsTestClass(IClass c) |
||||||
|
{ |
||||||
|
StringComparer nameComparer = GetNameComparer(c); |
||||||
|
if (nameComparer != null) { |
||||||
|
MbUnitTestAttributeName testAttributeName = new MbUnitTestAttributeName("TestFixture", nameComparer); |
||||||
|
foreach (IAttribute attribute in c.Attributes) { |
||||||
|
if (testAttributeName.IsEqual(attribute)) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
StringComparer GetNameComparer(IClass c) |
||||||
|
{ |
||||||
|
if (c != null) { |
||||||
|
IProjectContent projectContent = c.ProjectContent; |
||||||
|
if (projectContent != null) { |
||||||
|
LanguageProperties language = projectContent.Language; |
||||||
|
if (language != null) { |
||||||
|
return language.NameComparer; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether the method is a test method. A method
|
||||||
|
/// is considered to be a test method if it contains the NUnit Test attribute.
|
||||||
|
/// If the method has parameters it cannot be a test method.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsTestMethod(IMember member) |
||||||
|
{ |
||||||
|
if (member == null) { |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
StringComparer nameComparer = GetNameComparer(member.DeclaringType); |
||||||
|
if (nameComparer != null) { |
||||||
|
MbUnitTestAttributeName testAttribute = new MbUnitTestAttributeName("Test", nameComparer); |
||||||
|
foreach (IAttribute attribute in member.Attributes) { |
||||||
|
if (testAttribute.IsEqual(attribute)) { |
||||||
|
IMethod method = (IMethod)member; |
||||||
|
if (method.Parameters.Count == 0) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsBuildNeededBeforeTestRun { |
||||||
|
get { return true; } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,54 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Text.RegularExpressions; |
||||||
|
using System.IO; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class GallioTestResult : TestResult |
||||||
|
{ |
||||||
|
public GallioTestResult(TestResult testResult) |
||||||
|
: base(testResult.Name) |
||||||
|
{ |
||||||
|
Message = testResult.Message; |
||||||
|
ResultType = testResult.ResultType; |
||||||
|
StackTrace = testResult.StackTrace; |
||||||
|
} |
||||||
|
|
||||||
|
protected override void OnStackTraceChanged() |
||||||
|
{ |
||||||
|
GetFilePositionFromStackTrace(); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stack trace:
|
||||||
|
/// at GallioTest.MyClass.AssertWithFailureMessage() in d:\temp\test\..\GallioTest\MyClass.cs:line 46
|
||||||
|
/// </summary>
|
||||||
|
void GetFilePositionFromStackTrace() |
||||||
|
{ |
||||||
|
Match match = Regex.Match(StackTrace, @"\sin\s(.*?):line\s(\d+)", RegexOptions.Multiline); |
||||||
|
if (match.Success) { |
||||||
|
SetStackTraceFilePosition(match.Groups); |
||||||
|
} else { |
||||||
|
StackTraceFilePosition = FilePosition.Empty; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void SetStackTraceFilePosition(GroupCollection groups) |
||||||
|
{ |
||||||
|
string fileName = Path.GetFullPath(groups[1].Value); |
||||||
|
int line = Convert.ToInt32(groups[2].Value); |
||||||
|
int column = 1; |
||||||
|
|
||||||
|
StackTraceFilePosition = new FilePosition(fileName, line, column); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class GallioTestRunner : TestProcessRunnerBase |
||||||
|
{ |
||||||
|
public GallioTestRunner() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
protected override ProcessStartInfo GetProcessStartInfo(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
GallioEchoConsoleApplicationProcessStartInfo startInfo = |
||||||
|
new GallioEchoConsoleApplicationProcessStartInfo(selectedTests, base.TestResultsMonitor.FileName); |
||||||
|
return startInfo.ProcessStartInfo; |
||||||
|
} |
||||||
|
|
||||||
|
protected override TestResult CreateTestResultForTestFramework(TestResult testResult) |
||||||
|
{ |
||||||
|
return new GallioTestResult(testResult); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,47 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class MbUnitTestAttributeName |
||||||
|
{ |
||||||
|
string name = String.Empty; |
||||||
|
string qualifiedName = String.Empty; |
||||||
|
string fullyQualifiedName = String.Empty; |
||||||
|
StringComparer nameComparer; |
||||||
|
|
||||||
|
public MbUnitTestAttributeName(string name, StringComparer nameComparer) |
||||||
|
{ |
||||||
|
this.name = name; |
||||||
|
this.nameComparer = nameComparer; |
||||||
|
qualifiedName = String.Concat(name, "Attribute"); |
||||||
|
fullyQualifiedName = String.Concat("MbUnit.Framework.", name, "Attribute"); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether the specified attribute name is a
|
||||||
|
/// match to this attribute.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsEqual(string attributeName) |
||||||
|
{ |
||||||
|
if (nameComparer.Equals(attributeName, name) || |
||||||
|
nameComparer.Equals(attributeName, qualifiedName) || |
||||||
|
nameComparer.Equals(attributeName, fullyQualifiedName)) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
return false; |
||||||
|
} |
||||||
|
|
||||||
|
public bool IsEqual(IAttribute attribute) |
||||||
|
{ |
||||||
|
return IsEqual(attribute.AttributeType.FullyQualifiedName); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
#region Using directives
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Reflection; |
||||||
|
using System.Runtime.InteropServices; |
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Gallio.SharpDevelop")] |
||||||
|
[assembly: AssemblyDescription("")] |
||||||
|
[assembly: AssemblyConfiguration("")] |
||||||
|
[assembly: AssemblyCompany("")] |
||||||
|
[assembly: AssemblyProduct("Gallio.SharpDevelop")] |
||||||
|
[assembly: AssemblyCopyright("Copyright 2010")] |
||||||
|
[assembly: AssemblyTrademark("")] |
||||||
|
[assembly: AssemblyCulture("")] |
||||||
|
|
||||||
|
// This sets the default COM visibility of types in the assembly to invisible.
|
||||||
|
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||||
|
[assembly: ComVisible(false)] |
||||||
|
|
||||||
|
// The assembly version has following format :
|
||||||
|
//
|
||||||
|
// Major.Minor.Build.Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can use the default the Revision and
|
||||||
|
// Build Numbers by using the '*' as shown below:
|
||||||
|
[assembly: AssemblyVersion("0.1")] |
@ -0,0 +1,38 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Gallio.Extension; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class SharpDevelopTestRunnerExtensionCommandLineArgument : TestRunnerExtensionCommandLineArgument |
||||||
|
{ |
||||||
|
string testResultsFileName = String.Empty; |
||||||
|
|
||||||
|
public SharpDevelopTestRunnerExtensionCommandLineArgument() |
||||||
|
: base(GetFullyQualifiedTypeName()) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
static string GetFullyQualifiedTypeName() |
||||||
|
{ |
||||||
|
Type type = typeof(SharpDevelopTestRunnerExtension); |
||||||
|
string typeName = type.FullName; |
||||||
|
string assemblyFileName = type.Assembly.ManifestModule.ScopeName; |
||||||
|
return String.Format("{0},{1}", typeName, assemblyFileName); |
||||||
|
} |
||||||
|
|
||||||
|
public string TestResultsFileName { |
||||||
|
get { return testResultsFileName; } |
||||||
|
set { |
||||||
|
testResultsFileName = value; |
||||||
|
Parameters = testResultsFileName; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,51 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Gallio.SharpDevelop |
||||||
|
{ |
||||||
|
public class TestRunnerExtensionCommandLineArgument |
||||||
|
{ |
||||||
|
string type; |
||||||
|
string parameters = String.Empty; |
||||||
|
|
||||||
|
public TestRunnerExtensionCommandLineArgument(string type) |
||||||
|
{ |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
|
||||||
|
public string Type { |
||||||
|
get { return type; } |
||||||
|
} |
||||||
|
|
||||||
|
public string Parameters { |
||||||
|
get { return parameters; } |
||||||
|
set { parameters = value; } |
||||||
|
} |
||||||
|
|
||||||
|
public override string ToString() |
||||||
|
{ |
||||||
|
return String.Format("/re:\"{0}{1}\"", |
||||||
|
GetTypeName(), |
||||||
|
GetParameters()); |
||||||
|
} |
||||||
|
|
||||||
|
string GetTypeName() |
||||||
|
{ |
||||||
|
return type; |
||||||
|
} |
||||||
|
|
||||||
|
string GetParameters() |
||||||
|
{ |
||||||
|
if (String.IsNullOrEmpty(parameters)) { |
||||||
|
return String.Empty; |
||||||
|
} |
||||||
|
return String.Format(";{0}", parameters); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Binary file not shown.
@ -0,0 +1,22 @@ |
|||||||
|
<AddIn name = "CodeQualityAnalysis" |
||||||
|
author = "Tomas Linhart" |
||||||
|
copyright = "prj:///doc/copyright.txt" |
||||||
|
description = "Provides code quality analysis with various metrics and dependencies." |
||||||
|
addInManagerHidden = "preinstalled"> |
||||||
|
|
||||||
|
<Manifest> |
||||||
|
<Identity name = "ICSharpCode.CodeQualityAnalysis"/> |
||||||
|
</Manifest> |
||||||
|
|
||||||
|
<Runtime> |
||||||
|
<Import assembly = "CodeQualityAnalysis.exe"/> |
||||||
|
</Runtime> |
||||||
|
|
||||||
|
<Path name = "/SharpDevelop/Workbench/MainMenu/Analysis"> |
||||||
|
<Condition name = "ProjectActive" activeproject="*"> |
||||||
|
<MenuItem id = "GenerateDependencyGraph" |
||||||
|
label = "Generate Dependency Graph" |
||||||
|
class = "ICSharpCode.CodeQualityAnalysis.DependencyGraphCommand" /> |
||||||
|
</Condition> |
||||||
|
</Path> |
||||||
|
</AddIn> |
@ -0,0 +1,188 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||||
|
<PropertyGroup> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||||
|
<ProductVersion>8.0.30703</ProductVersion> |
||||||
|
<SchemaVersion>2.0</SchemaVersion> |
||||||
|
<ProjectGuid>{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}</ProjectGuid> |
||||||
|
<OutputType>WinExe</OutputType> |
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||||
|
<RootNamespace>ICSharpCode.CodeQualityAnalysis</RootNamespace> |
||||||
|
<AssemblyName>CodeQualityAnalysis</AssemblyName> |
||||||
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
||||||
|
<TargetFrameworkProfile> |
||||||
|
</TargetFrameworkProfile> |
||||||
|
<FileAlignment>512</FileAlignment> |
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<PublishUrl>publish\</PublishUrl> |
||||||
|
<Install>true</Install> |
||||||
|
<InstallFrom>Disk</InstallFrom> |
||||||
|
<UpdateEnabled>false</UpdateEnabled> |
||||||
|
<UpdateMode>Foreground</UpdateMode> |
||||||
|
<UpdateInterval>7</UpdateInterval> |
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits> |
||||||
|
<UpdatePeriodically>false</UpdatePeriodically> |
||||||
|
<UpdateRequired>false</UpdateRequired> |
||||||
|
<MapFileExtensions>true</MapFileExtensions> |
||||||
|
<ApplicationRevision>0</ApplicationRevision> |
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> |
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper> |
||||||
|
<UseApplicationTrust>false</UseApplicationTrust> |
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled> |
||||||
|
<OutputPath>..\..\..\..\AddIns\AddIns\Misc\CodeQualityAnalysis\</OutputPath> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug' "> |
||||||
|
<PlatformTarget>x86</PlatformTarget> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>full</DebugType> |
||||||
|
<Optimize>false</Optimize> |
||||||
|
<OutputPath>bin\Debug\</OutputPath> |
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||||
|
<ErrorReport>prompt</ErrorReport> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release' "> |
||||||
|
<PlatformTarget>x86</PlatformTarget> |
||||||
|
<DebugType>pdbonly</DebugType> |
||||||
|
<Optimize>true</Optimize> |
||||||
|
<OutputPath>bin\Release\</OutputPath> |
||||||
|
<DefineConstants>TRACE</DefineConstants> |
||||||
|
<ErrorReport>prompt</ErrorReport> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
</PropertyGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Reference Include="GraphSharp"> |
||||||
|
<HintPath>..\..\..\Libraries\GraphSharp\GraphSharp.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="GraphSharp.Contracts"> |
||||||
|
<HintPath>..\..\..\Libraries\GraphSharp\GraphSharp.Contracts.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="GraphSharp.Controls"> |
||||||
|
<HintPath>..\..\..\Libraries\GraphSharp\GraphSharp.Controls.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="Microsoft.Contracts"> |
||||||
|
<HintPath>..\..\..\Libraries\GraphSharp\Microsoft.Contracts.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="Mono.Cecil"> |
||||||
|
<HintPath>..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="QuickGraph"> |
||||||
|
<HintPath>..\..\..\Libraries\GraphSharp\QuickGraph.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
<Reference Include="System" /> |
||||||
|
<Reference Include="System.Data" /> |
||||||
|
<Reference Include="System.Xml" /> |
||||||
|
<Reference Include="Microsoft.CSharp" /> |
||||||
|
<Reference Include="System.Core" /> |
||||||
|
<Reference Include="System.Xml.Linq" /> |
||||||
|
<Reference Include="System.Data.DataSetExtensions" /> |
||||||
|
<Reference Include="System.Xaml"> |
||||||
|
<RequiredTargetFramework>4.0</RequiredTargetFramework> |
||||||
|
</Reference> |
||||||
|
<Reference Include="WindowsBase" /> |
||||||
|
<Reference Include="PresentationCore" /> |
||||||
|
<Reference Include="PresentationFramework" /> |
||||||
|
<Reference Include="WPFExtensions"> |
||||||
|
<HintPath>..\..\..\Libraries\GraphSharp\WPFExtensions.dll</HintPath> |
||||||
|
</Reference> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<ApplicationDefinition Include="Src\App.xaml"> |
||||||
|
<Generator>MSBuild:Compile</Generator> |
||||||
|
<SubType>Designer</SubType> |
||||||
|
</ApplicationDefinition> |
||||||
|
<Compile Include="Src\DependencyGraphCommand.cs" /> |
||||||
|
<Compile Include="Src\Field.cs" /> |
||||||
|
<Compile Include="Src\IDependency.cs" /> |
||||||
|
<Compile Include="Src\MetricsReader.cs" /> |
||||||
|
<Compile Include="Src\Method.cs" /> |
||||||
|
<Compile Include="Src\Namespace.cs" /> |
||||||
|
<Compile Include="Src\Type.cs" /> |
||||||
|
<Page Include="Src\MainWindow.xaml"> |
||||||
|
<Generator>MSBuild:Compile</Generator> |
||||||
|
<SubType>Designer</SubType> |
||||||
|
</Page> |
||||||
|
<Compile Include="Src\App.xaml.cs"> |
||||||
|
<DependentUpon>App.xaml</DependentUpon> |
||||||
|
<SubType>Code</SubType> |
||||||
|
</Compile> |
||||||
|
<Compile Include="Src\MainWindow.xaml.cs"> |
||||||
|
<DependentUpon>MainWindow.xaml</DependentUpon> |
||||||
|
<SubType>Code</SubType> |
||||||
|
</Compile> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Compile Include="Src\Module.cs" /> |
||||||
|
<Compile Include="Properties\AssemblyInfo.cs"> |
||||||
|
<SubType>Code</SubType> |
||||||
|
</Compile> |
||||||
|
<Compile Include="Properties\Resources.Designer.cs"> |
||||||
|
<AutoGen>True</AutoGen> |
||||||
|
<DesignTime>True</DesignTime> |
||||||
|
<DependentUpon>Resources.resx</DependentUpon> |
||||||
|
</Compile> |
||||||
|
<Compile Include="Properties\Settings.Designer.cs"> |
||||||
|
<AutoGen>True</AutoGen> |
||||||
|
<DependentUpon>Settings.settings</DependentUpon> |
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
||||||
|
</Compile> |
||||||
|
<EmbeddedResource Include="Properties\Resources.resx"> |
||||||
|
<Generator>ResXFileCodeGenerator</Generator> |
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
||||||
|
</EmbeddedResource> |
||||||
|
<None Include="Properties\Settings.settings"> |
||||||
|
<Generator>SettingsSingleFileGenerator</Generator> |
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
||||||
|
</None> |
||||||
|
<AppDesigner Include="Properties\" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.0"> |
||||||
|
<Visible>False</Visible> |
||||||
|
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName> |
||||||
|
<Install>true</Install> |
||||||
|
</BootstrapperPackage> |
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> |
||||||
|
<Visible>False</Visible> |
||||||
|
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> |
||||||
|
<Install>false</Install> |
||||||
|
</BootstrapperPackage> |
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> |
||||||
|
<Visible>False</Visible> |
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName> |
||||||
|
<Install>false</Install> |
||||||
|
</BootstrapperPackage> |
||||||
|
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> |
||||||
|
<Visible>False</Visible> |
||||||
|
<ProductName>Windows Installer 3.1</ProductName> |
||||||
|
<Install>true</Install> |
||||||
|
</BootstrapperPackage> |
||||||
|
</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> |
||||||
|
<ItemGroup> |
||||||
|
<Content Include="CodeQualityAnalysis.addin"> |
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||||
|
</Content> |
||||||
|
</ItemGroup> |
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
||||||
|
Other similar extension points exist, see Microsoft.Common.targets. |
||||||
|
<Target Name="BeforeBuild"> |
||||||
|
</Target> |
||||||
|
<Target Name="AfterBuild"> |
||||||
|
</Target> |
||||||
|
--> |
||||||
|
</Project> |
@ -0,0 +1,42 @@ |
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00 |
||||||
|
# Visual Studio 2010 |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeQualityAnalysis", "CodeQualityAnalysis.csproj", "{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}" |
||||||
|
EndProject |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\..\Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}" |
||||||
|
EndProject |
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}" |
||||||
|
EndProject |
||||||
|
Global |
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
||||||
|
Debug|Any CPU = Debug|Any CPU |
||||||
|
Debug|x86 = Debug|x86 |
||||||
|
Release|Any CPU = Release|Any CPU |
||||||
|
Release|x86 = Release|x86 |
||||||
|
EndGlobalSection |
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Debug|x86.ActiveCfg = Debug|Any CPU |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Debug|x86.Build.0 = Debug|Any CPU |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Release|Any CPU.Build.0 = Release|Any CPU |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Release|x86.ActiveCfg = Release|x86 |
||||||
|
{76DD1CC0-0D86-44A1-9BD6-D91F79807BC3}.Release|x86.Build.0 = Release|x86 |
||||||
|
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||||
|
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||||
|
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|x86.ActiveCfg = Debug|Any CPU |
||||||
|
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||||
|
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU |
||||||
|
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|x86.ActiveCfg = Release|Any CPU |
||||||
|
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
||||||
|
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU |
||||||
|
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|x86.ActiveCfg = Debug|Any CPU |
||||||
|
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU |
||||||
|
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU |
||||||
|
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|x86.ActiveCfg = Release|Any CPU |
||||||
|
EndGlobalSection |
||||||
|
GlobalSection(SolutionProperties) = preSolution |
||||||
|
HideSolutionNode = FALSE |
||||||
|
EndGlobalSection |
||||||
|
EndGlobal |
@ -0,0 +1,55 @@ |
|||||||
|
using System.Reflection; |
||||||
|
using System.Resources; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Runtime.InteropServices; |
||||||
|
using System.Windows; |
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Code-Quality-Analysis")] |
||||||
|
[assembly: AssemblyDescription("")] |
||||||
|
[assembly: AssemblyConfiguration("")] |
||||||
|
[assembly: AssemblyCompany("Microsoft")] |
||||||
|
[assembly: AssemblyProduct("Code-Quality-Analysis")] |
||||||
|
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] |
||||||
|
[assembly: AssemblyTrademark("")] |
||||||
|
[assembly: AssemblyCulture("")] |
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)] |
||||||
|
|
||||||
|
//In order to begin building localizable applications, set
|
||||||
|
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||||
|
//inside a <PropertyGroup>. For example, if you are using US english
|
||||||
|
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||||
|
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||||
|
//the line below to match the UICulture setting in the project file.
|
||||||
|
|
||||||
|
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||||
|
|
||||||
|
|
||||||
|
[assembly: ThemeInfo( |
||||||
|
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// or application resource dictionaries)
|
||||||
|
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||||
|
//(used if a resource is not found in the page,
|
||||||
|
// app, or any theme specific resource dictionaries)
|
||||||
|
)] |
||||||
|
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")] |
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")] |
@ -1,18 +1,18 @@ |
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:2.0.50727.1433
|
// Runtime Version:4.0.30319.1
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace AvalonDock.Properties { |
namespace ICSharpCode.CodeQualityAnalysis.Properties { |
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] |
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { |
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { |
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
@ -1,4 +1,4 @@ |
|||||||
<?xml version='1.0' encoding='iso-8859-1'?> |
<?xml version='1.0' encoding='utf-8'?> |
||||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> |
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)"> |
||||||
<Profiles> |
<Profiles> |
||||||
<Profile Name="(Default)" /> |
<Profile Name="(Default)" /> |
@ -0,0 +1,8 @@ |
|||||||
|
<Application x:Class="ICSharpCode.CodeQualityAnalysis.App" |
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||||
|
StartupUri="Src\MainWindow.xaml"> |
||||||
|
<Application.Resources> |
||||||
|
|
||||||
|
</Application.Resources> |
||||||
|
</Application> |
@ -0,0 +1,16 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Configuration; |
||||||
|
using System.Data; |
||||||
|
using System.Linq; |
||||||
|
using System.Windows; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for App.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : Application |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.SharpDevelop; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
public class DependencyGraphCommand : AbstractMenuCommand |
||||||
|
{ |
||||||
|
public override void Run() |
||||||
|
{ |
||||||
|
var window = new MainWindow(); |
||||||
|
window.Show(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using QuickGraph; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
public class Field : IDependency |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Name of field
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type of field
|
||||||
|
/// </summary>
|
||||||
|
public Type Type { get; set; } |
||||||
|
|
||||||
|
public BidirectionalGraph<object, IEdge<object>> BuildDependencyGraph() |
||||||
|
{ |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using QuickGraph; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
public interface IDependency |
||||||
|
{ |
||||||
|
string Name { set; get; } |
||||||
|
BidirectionalGraph<object, IEdge<object>> BuildDependencyGraph(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
<Window x:Class="ICSharpCode.CodeQualityAnalysis.MainWindow" |
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||||
|
xmlns:graphsharp="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls" |
||||||
|
xmlns:zoom="clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions" |
||||||
|
Title="Code Quality Analysis" |
||||||
|
x:Name="root"> |
||||||
|
<Grid> |
||||||
|
<Grid.RowDefinitions> |
||||||
|
<RowDefinition Height="Auto" /> |
||||||
|
<RowDefinition /> |
||||||
|
</Grid.RowDefinitions> |
||||||
|
|
||||||
|
<Grid.ColumnDefinitions> |
||||||
|
<ColumnDefinition Width="250px" /> |
||||||
|
<ColumnDefinition /> |
||||||
|
<ColumnDefinition Width="200px" /> |
||||||
|
</Grid.ColumnDefinitions> |
||||||
|
|
||||||
|
<ToolBarTray Background="White" Grid.Row="0"> |
||||||
|
<ToolBar> |
||||||
|
<Button Name="btnOpenAssembly" Click="btnOpenAssembly_Click">Open Assembly</Button> |
||||||
|
</ToolBar> |
||||||
|
</ToolBarTray> |
||||||
|
|
||||||
|
<TreeView Name="definitionTree" Grid.Row="1" Grid.Column="0" SelectedItemChanged="definitionTree_SelectedItemChanged" /> |
||||||
|
|
||||||
|
<!-- gonna replace with ISharpDevelop ZoomControl --> |
||||||
|
<zoom:ZoomControl ForceCursor="True" Grid.Row="1" Grid.Column="1" Name="zoom"> |
||||||
|
<graphsharp:GraphLayout x:Name="graphLayout" |
||||||
|
LayoutAlgorithmType="LinLog" |
||||||
|
OverlapRemovalAlgorithmType="FSA" |
||||||
|
HighlightAlgorithmType="Simple" |
||||||
|
/> |
||||||
|
</zoom:ZoomControl> |
||||||
|
|
||||||
|
<TextBlock Name="txbTypeInfo" Grid.Column="3" Grid.Row="1"/> |
||||||
|
</Grid> |
||||||
|
</Window> |
@ -0,0 +1,115 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using System.Windows; |
||||||
|
using System.Windows.Controls; |
||||||
|
using System.Windows.Data; |
||||||
|
using System.Windows.Documents; |
||||||
|
using System.Windows.Input; |
||||||
|
using System.Windows.Media; |
||||||
|
using System.Windows.Media.Imaging; |
||||||
|
using System.Windows.Navigation; |
||||||
|
using System.Windows.Shapes; |
||||||
|
using Microsoft.Win32; |
||||||
|
using Mono.Cecil; |
||||||
|
using Mono.Cecil.Cil; |
||||||
|
using QuickGraph; |
||||||
|
using QuickGraph.Collections; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for MainWindow.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class MainWindow : Window |
||||||
|
{ |
||||||
|
private MetricsReader _metricsReader; |
||||||
|
|
||||||
|
public MainWindow() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
} |
||||||
|
|
||||||
|
private void btnOpenAssembly_Click(object sender, RoutedEventArgs e) |
||||||
|
{ |
||||||
|
var fileDialog = new OpenFileDialog |
||||||
|
{ |
||||||
|
Filter = "Component Files (*.dll, *.exe)|*.dll;*.exe" |
||||||
|
}; |
||||||
|
|
||||||
|
fileDialog.ShowDialog(); |
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(fileDialog.FileName)) |
||||||
|
return; |
||||||
|
|
||||||
|
definitionTree.Items.Clear(); |
||||||
|
|
||||||
|
_metricsReader = new MetricsReader(fileDialog.FileName); |
||||||
|
|
||||||
|
FillTree(); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill tree with module, types and methods and TODO: fields
|
||||||
|
/// </summary>
|
||||||
|
private void FillTree() |
||||||
|
{ |
||||||
|
var itemModule = new MetricTreeViewItem() { Header = _metricsReader.MainModule.Name, Dependency = _metricsReader.MainModule }; |
||||||
|
definitionTree.Items.Add(itemModule); |
||||||
|
|
||||||
|
foreach (var ns in _metricsReader.MainModule.Namespaces) |
||||||
|
{ |
||||||
|
var nsType = new MetricTreeViewItem() { Header = ns.Name, Dependency = ns }; |
||||||
|
itemModule.Items.Add(nsType); |
||||||
|
|
||||||
|
foreach (var type in ns.Types) |
||||||
|
{ |
||||||
|
var itemType = new MetricTreeViewItem() { Header = type.Name, Dependency = type }; |
||||||
|
nsType.Items.Add(itemType); |
||||||
|
|
||||||
|
foreach (var method in type.Methods) |
||||||
|
{ |
||||||
|
var itemMethod = new MetricTreeViewItem() { Header = method.Name, Dependency = method }; |
||||||
|
itemType.Items.Add(itemMethod); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (var field in type.Fields) |
||||||
|
{ |
||||||
|
var itemField = new MetricTreeViewItem() { Header = field.Name, Dependency = field }; |
||||||
|
itemType.Items.Add(itemField); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private void definitionTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) |
||||||
|
{ |
||||||
|
var item = definitionTree.SelectedItem as MetricTreeViewItem; |
||||||
|
|
||||||
|
if (item != null) |
||||||
|
{ |
||||||
|
// would be better inherit from TreeViewItem and add reference into it
|
||||||
|
// will do it later or will use another tree maybe tree from SharpDevelop
|
||||||
|
string name = item.Header.ToString(); |
||||||
|
txbTypeInfo.Text = "Infobox: \n" + name; |
||||||
|
/*var type = (from n in this._metricsReader.MainModule.Namespaces |
||||||
|
from t in n.Types |
||||||
|
where t.Name == name |
||||||
|
select t).SingleOrDefault();*/ |
||||||
|
|
||||||
|
var graph = item.Dependency.BuildDependencyGraph(); |
||||||
|
if (graph != null && graph.VertexCount > 0) |
||||||
|
{ |
||||||
|
graphLayout.Graph = graph; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private class MetricTreeViewItem : TreeViewItem |
||||||
|
{ |
||||||
|
public IDependency Dependency { get; set; } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,48 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using QuickGraph; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
public class Method : IDependency |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Types which are used in body of method
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Type> TypeUses { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Methods which are called in body of method
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Method> MethodUses { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fields which are accesed in body of method
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Field> FieldUses { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A name of method
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A return type of method
|
||||||
|
/// </summary>
|
||||||
|
public Type Type { get; set; } |
||||||
|
|
||||||
|
public Method() |
||||||
|
{ |
||||||
|
TypeUses = new HashSet<Type>(); |
||||||
|
MethodUses = new HashSet<Method>(); |
||||||
|
FieldUses = new HashSet<Field>(); |
||||||
|
} |
||||||
|
|
||||||
|
public BidirectionalGraph<object, IEdge<object>> BuildDependencyGraph() |
||||||
|
{ |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,361 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using Mono.Cecil; |
||||||
|
using Mono.Cecil.Cil; |
||||||
|
using Mono.Collections.Generic; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Reads neccesery information with Mono.Cecil to calculate code metrics
|
||||||
|
/// </summary>
|
||||||
|
public class MetricsReader |
||||||
|
{ |
||||||
|
public Module MainModule { get; private set; } |
||||||
|
|
||||||
|
public MetricsReader(string file) |
||||||
|
{ |
||||||
|
this.ReadAssembly(file); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Opens file as assembly and starts reading MainModule
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
private void ReadAssembly(string file) |
||||||
|
{ |
||||||
|
var assembly = AssemblyDefinition.ReadAssembly(file); |
||||||
|
ReadModule(assembly.MainModule); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads main module from assembly
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleDefinition"></param>
|
||||||
|
private void ReadModule(ModuleDefinition moduleDefinition) |
||||||
|
{ |
||||||
|
this.MainModule = new Module() |
||||||
|
{ |
||||||
|
Name = moduleDefinition.Name |
||||||
|
}; |
||||||
|
|
||||||
|
ReadTypes(MainModule, moduleDefinition.Types); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads types from module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="module"></param>
|
||||||
|
/// <param name="types"></param>
|
||||||
|
private void ReadTypes(Module module, Collection<TypeDefinition> types) |
||||||
|
{ |
||||||
|
// first add all types, because i will need find depend types
|
||||||
|
|
||||||
|
foreach (TypeDefinition typeDefinition in types) |
||||||
|
{ |
||||||
|
if (typeDefinition.Name != "<Module>") |
||||||
|
{ |
||||||
|
var type = new Type() |
||||||
|
{ |
||||||
|
FullName = FormatTypeName(typeDefinition), |
||||||
|
Name = FormatTypeName(typeDefinition) |
||||||
|
}; |
||||||
|
|
||||||
|
// try find namespace
|
||||||
|
var nsName = GetNamespaceName(typeDefinition); |
||||||
|
|
||||||
|
var ns = (from n in module.Namespaces |
||||||
|
where n.Name == nsName |
||||||
|
select n).SingleOrDefault(); |
||||||
|
|
||||||
|
if (ns == null) |
||||||
|
{ |
||||||
|
ns = new Namespace() |
||||||
|
{ |
||||||
|
Name = nsName, |
||||||
|
Module = module |
||||||
|
}; |
||||||
|
|
||||||
|
module.Namespaces.Add(ns); |
||||||
|
} |
||||||
|
|
||||||
|
type.Namespace = ns; |
||||||
|
ns.Types.Add(type); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
foreach (TypeDefinition typeDefinition in types) |
||||||
|
{ |
||||||
|
if (typeDefinition.Name != "<Module>") |
||||||
|
{ |
||||||
|
var type = |
||||||
|
(from n in module.Namespaces |
||||||
|
from t in n.Types |
||||||
|
where (t.Name == FormatTypeName(typeDefinition)) |
||||||
|
select t).SingleOrDefault(); |
||||||
|
|
||||||
|
|
||||||
|
if (typeDefinition.HasFields) |
||||||
|
ReadFields(type, typeDefinition.Fields); |
||||||
|
|
||||||
|
/*if (typeDefinition.HasEvents) |
||||||
|
ReadEvents(type, typeDefinition.Events);*/ |
||||||
|
|
||||||
|
if (typeDefinition.HasMethods) |
||||||
|
ReadMethods(type, typeDefinition.Methods); |
||||||
|
|
||||||
|
/*if (typeDefinition.HasConstructors) |
||||||
|
ReadConstructors(type, typeDefinition.Constructors);*/ |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private void ReadEvents(Type type, Collection<EventDefinition> events) |
||||||
|
{ |
||||||
|
throw new NotImplementedException(); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads fields and add them to field list for type
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="fields"></param>
|
||||||
|
private void ReadFields(Type type, Collection<FieldDefinition> fields) |
||||||
|
{ |
||||||
|
foreach (FieldDefinition fieldDefinition in fields) |
||||||
|
{ |
||||||
|
var field = new Field() |
||||||
|
{ |
||||||
|
Name = fieldDefinition.Name |
||||||
|
}; |
||||||
|
|
||||||
|
type.Fields.Add(field); |
||||||
|
|
||||||
|
var declaringType = |
||||||
|
(from n in type.Namespace.Module.Namespaces |
||||||
|
from t in n.Types |
||||||
|
where t.Name == field.Name |
||||||
|
select t).SingleOrDefault(); |
||||||
|
|
||||||
|
field.Type = declaringType; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Extracts methods and add them to method list for type
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="methods"></param>
|
||||||
|
private void ReadMethods(Type type, Collection<MethodDefinition> methods) |
||||||
|
{ |
||||||
|
foreach (MethodDefinition methodDefinition in methods) |
||||||
|
{ |
||||||
|
var method = new Method |
||||||
|
{ |
||||||
|
Name = FormatMethodName(methodDefinition), |
||||||
|
Type = type |
||||||
|
}; |
||||||
|
|
||||||
|
type.Methods.Add(method); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (MethodDefinition methodDefinition in methods) |
||||||
|
{ |
||||||
|
var method = (from m in type.Methods |
||||||
|
where m.Name == FormatMethodName(methodDefinition) |
||||||
|
select m).SingleOrDefault(); |
||||||
|
|
||||||
|
if (methodDefinition.Body != null) |
||||||
|
{ |
||||||
|
ReadInstructions(method, methodDefinition, methodDefinition.Body.Instructions); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads constructors and add them to method list for type
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="constructors"></param>
|
||||||
|
private void ReadConstructors(Type type, Collection<MethodDefinition> constructors) |
||||||
|
{ |
||||||
|
foreach (MethodDefinition constructor in constructors) |
||||||
|
{ |
||||||
|
var method = new Method |
||||||
|
{ |
||||||
|
Name = FormatMethodName(constructor), |
||||||
|
Type = type |
||||||
|
}; |
||||||
|
|
||||||
|
type.Methods.Add(method); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (MethodDefinition constructor in constructors) |
||||||
|
{ |
||||||
|
var method = (from m in type.Methods |
||||||
|
where m.Name == FormatMethodName(constructor) |
||||||
|
select m).SingleOrDefault(); |
||||||
|
|
||||||
|
if (constructor.Body != null) |
||||||
|
{ |
||||||
|
ReadInstructions(method, constructor, constructor.Body.Instructions); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads method calls by extracting instrunctions
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="method"></param>
|
||||||
|
/// <param name="methodDefinition"></param>
|
||||||
|
/// <param name="instructions"></param>
|
||||||
|
public void ReadInstructions(Method method, MethodDefinition methodDefinition, |
||||||
|
Collection<Instruction> instructions) |
||||||
|
{ |
||||||
|
foreach (Instruction instruction in instructions) |
||||||
|
{ |
||||||
|
var instr = ReadInstruction(instruction); |
||||||
|
|
||||||
|
if (instr is MethodDefinition) |
||||||
|
{ |
||||||
|
var md = instr as MethodDefinition; |
||||||
|
var type = (from n in method.Type.Namespace.Module.Namespaces |
||||||
|
from t in n.Types |
||||||
|
where t.Name == FormatTypeName(md.DeclaringType) && |
||||||
|
n.Name == t.Namespace.Name |
||||||
|
select t).SingleOrDefault(); |
||||||
|
|
||||||
|
method.TypeUses.Add(type); |
||||||
|
|
||||||
|
var findTargetMethod = (from m in type.Methods |
||||||
|
where m.Name == FormatMethodName(md) |
||||||
|
select m).SingleOrDefault(); |
||||||
|
|
||||||
|
if (findTargetMethod != null && type == method.Type) |
||||||
|
method.MethodUses.Add(findTargetMethod); |
||||||
|
} |
||||||
|
|
||||||
|
if (instr is FieldDefinition) |
||||||
|
{ |
||||||
|
var fd = instr as FieldDefinition; |
||||||
|
var field = (from f in method.Type.Fields |
||||||
|
where f.Name == fd.Name |
||||||
|
select f).SingleOrDefault(); |
||||||
|
|
||||||
|
if (field != null) |
||||||
|
method.FieldUses.Add(field); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reads instruction operand by recursive calling until non-instruction
|
||||||
|
/// operand is found
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instruction"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public object ReadInstruction(Instruction instruction) |
||||||
|
{ |
||||||
|
if (instruction.Operand == null) |
||||||
|
return null; |
||||||
|
|
||||||
|
var nextInstruction = instruction.Operand as Instruction; |
||||||
|
|
||||||
|
if (nextInstruction != null) |
||||||
|
return ReadInstruction(nextInstruction); |
||||||
|
else |
||||||
|
return instruction.Operand; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Formats method name by adding parameters to it. If there are not any parameters
|
||||||
|
/// only empty brackers will be added.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="methodDefinition"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string FormatMethodName(MethodDefinition methodDefinition) |
||||||
|
{ |
||||||
|
if (methodDefinition.HasParameters) |
||||||
|
{ |
||||||
|
var builder = new StringBuilder(); |
||||||
|
var enumerator = methodDefinition.Parameters.GetEnumerator(); |
||||||
|
bool hasNext = enumerator.MoveNext(); |
||||||
|
while (hasNext) |
||||||
|
{ |
||||||
|
builder.Append(((ParameterDefinition) enumerator.Current).ParameterType.FullName); |
||||||
|
hasNext = enumerator.MoveNext(); |
||||||
|
if (hasNext) |
||||||
|
builder.Append(", "); |
||||||
|
} |
||||||
|
|
||||||
|
return methodDefinition.Name + "(" + builder.ToString() + ")"; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
return methodDefinition.Name + "()"; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Formats a specific type name. If type is generic. Brackets <> will be added with proper names of parameters.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="typeDefinition"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string FormatTypeName(TypeDefinition typeDefinition) |
||||||
|
{ |
||||||
|
if (typeDefinition.IsNested && typeDefinition.DeclaringType != null) |
||||||
|
{ |
||||||
|
return FormatTypeName(typeDefinition.DeclaringType) + "+" + typeDefinition.Name; |
||||||
|
} |
||||||
|
|
||||||
|
if (typeDefinition.HasGenericParameters) |
||||||
|
{ |
||||||
|
var builder = new StringBuilder(); |
||||||
|
var enumerator = typeDefinition.GenericParameters.GetEnumerator(); |
||||||
|
bool hasNext = enumerator.MoveNext(); |
||||||
|
while (hasNext) |
||||||
|
{ |
||||||
|
builder.Append(((GenericParameter)enumerator.Current).Name); |
||||||
|
hasNext = enumerator.MoveNext(); |
||||||
|
if (hasNext) |
||||||
|
builder.Append(","); |
||||||
|
} |
||||||
|
|
||||||
|
return StripGenericName(typeDefinition.Name) + "<" + builder.ToString() + ">"; |
||||||
|
} |
||||||
|
|
||||||
|
return typeDefinition.Name; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes a number of generics parameters. Eg. `3 will be removed from end of name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string StripGenericName(string name) |
||||||
|
{ |
||||||
|
return name.IndexOf('`') != -1 ? name.Remove(name.IndexOf('`')) : name; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets namespace name. If type is nested it looks recursively to parent type until finds his namespace.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string GetNamespaceName(TypeDefinition type) |
||||||
|
{ |
||||||
|
if (type.IsNested && type.DeclaringType != null) |
||||||
|
return GetNamespaceName(type.DeclaringType); |
||||||
|
else |
||||||
|
{ |
||||||
|
if (!String.IsNullOrEmpty(type.Namespace)) |
||||||
|
return type.Namespace; |
||||||
|
else |
||||||
|
return "-"; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using QuickGraph; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
public class Module : IDependency |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Namespaces within module
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Namespace> Namespaces { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of module
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; } |
||||||
|
|
||||||
|
public Module() |
||||||
|
{ |
||||||
|
Namespaces = new HashSet<Namespace>(); |
||||||
|
} |
||||||
|
|
||||||
|
public BidirectionalGraph<object, IEdge<object>> BuildDependencyGraph() |
||||||
|
{ |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,54 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using QuickGraph; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
public class Namespace : IDependency |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Types within namespace
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Type> Types { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of namespace
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Module where is namespace located
|
||||||
|
/// </summary>
|
||||||
|
public Module Module { get; set; } |
||||||
|
|
||||||
|
public Namespace() |
||||||
|
{ |
||||||
|
Types = new HashSet<Type>(); |
||||||
|
} |
||||||
|
|
||||||
|
public BidirectionalGraph<object, IEdge<object>> BuildDependencyGraph() |
||||||
|
{ |
||||||
|
var g = new BidirectionalGraph<object, IEdge<object>>(); |
||||||
|
|
||||||
|
foreach (var type in Types) |
||||||
|
{ |
||||||
|
g.AddVertex(type.Name); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (var type in Types) |
||||||
|
{ |
||||||
|
var types = type.GetUses(); |
||||||
|
|
||||||
|
foreach (var dependType in types) |
||||||
|
{ |
||||||
|
if (dependType != type && dependType.Namespace == type.Namespace) |
||||||
|
g.AddEdge(new Edge<object>(type.Name, dependType.Name)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return g; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,99 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Linq; |
||||||
|
using System.Text; |
||||||
|
using QuickGraph; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis |
||||||
|
{ |
||||||
|
public class Type : IDependency |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Nested types like inner classes, interfaces and so on.
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Type> InnerTypes { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Methods within type
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Method> Methods { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fields within type
|
||||||
|
/// </summary>
|
||||||
|
public ISet<Field> Fields { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of type with a name of namespace.
|
||||||
|
/// </summary>
|
||||||
|
public string FullName { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Name of type
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; } |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Namespace where type is located
|
||||||
|
/// </summary>
|
||||||
|
public Namespace Namespace { get; set; } |
||||||
|
|
||||||
|
public Type() |
||||||
|
{ |
||||||
|
Methods = new HashSet<Method>(); |
||||||
|
Fields = new HashSet<Field>(); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns all types which are used in this type
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>A set of types</returns>
|
||||||
|
public ISet<Type> GetUses() |
||||||
|
{ |
||||||
|
var set = new HashSet<Type>(); |
||||||
|
|
||||||
|
foreach (var method in Methods) |
||||||
|
{ |
||||||
|
set.UnionWith(method.TypeUses); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (var field in Fields) |
||||||
|
{ |
||||||
|
if (field.Type != null) // if it is null so it is type from outside of this assembly
|
||||||
|
set.Add(field.Type); // TODO: find solution to handle them
|
||||||
|
} |
||||||
|
|
||||||
|
return set; |
||||||
|
} |
||||||
|
|
||||||
|
public BidirectionalGraph<object, IEdge<object>> BuildDependencyGraph() |
||||||
|
{ |
||||||
|
var g = new BidirectionalGraph<object, IEdge<object>>(); |
||||||
|
|
||||||
|
foreach (var method in Methods) |
||||||
|
{ |
||||||
|
g.AddVertex(method.Name); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (var field in Fields) |
||||||
|
{ |
||||||
|
g.AddVertex(field.Name); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (var method in Methods) |
||||||
|
{ |
||||||
|
foreach (var methodUse in method.MethodUses) |
||||||
|
{ |
||||||
|
g.AddEdge(new Edge<object>(method.Name, methodUse.Name)); |
||||||
|
} |
||||||
|
|
||||||
|
foreach (var fieldUse in method.FieldUses) |
||||||
|
{ |
||||||
|
g.AddEdge(new Edge<object>(method.Name, fieldUse.Name)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return g; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,115 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Siegfried Pammer" email="sie_pam@gmx.at"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.Diagnostics; |
||||||
|
using System.Linq; |
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.Profiler.AddIn; |
||||||
|
using ICSharpCode.Profiler.Controller.Data; |
||||||
|
using ICSharpCode.SharpDevelop; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
using ICSharpCode.UnitTesting; |
||||||
|
|
||||||
|
namespace ICSharpCode.Profiler.AddIn |
||||||
|
{ |
||||||
|
public class ProfilerTestRunner : TestRunnerBase |
||||||
|
{ |
||||||
|
ProfilerRunner runner; |
||||||
|
UnitTestingOptions options = new UnitTestingOptions(); |
||||||
|
TestResultsMonitor testResultsMonitor; |
||||||
|
|
||||||
|
public ProfilerTestRunner() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public override void Start(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
ProcessStartInfo startInfo = GetProcessStartInfo(selectedTests); |
||||||
|
Start(startInfo, selectedTests); |
||||||
|
} |
||||||
|
|
||||||
|
protected override ProcessStartInfo GetProcessStartInfo(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
NUnitConsoleApplication app = new NUnitConsoleApplication(selectedTests, options); |
||||||
|
testResultsMonitor = new TestResultsMonitor(); |
||||||
|
app.Results = testResultsMonitor.FileName; |
||||||
|
return app.GetProcessStartInfo(); |
||||||
|
} |
||||||
|
|
||||||
|
void Start(ProcessStartInfo startInfo, SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
LogCommandLine(startInfo); |
||||||
|
|
||||||
|
string path = selectedTests.Project.GetSessionFileName(); |
||||||
|
|
||||||
|
LoggingService.Info("starting profiler..."); |
||||||
|
|
||||||
|
runner = new ProfilerRunner(startInfo, true, new UnitTestWriter(new ProfilingDataSQLiteWriter(path), GetUnitTestNames(selectedTests).ToArray())); |
||||||
|
|
||||||
|
runner.RunFinished += delegate { |
||||||
|
WorkbenchSingleton.SafeThreadCall(() => FileService.OpenFile(path)); |
||||||
|
AfterFinish(selectedTests, path); |
||||||
|
}; |
||||||
|
|
||||||
|
testResultsMonitor.TestFinished += OnTestFinished; |
||||||
|
testResultsMonitor.Start(); |
||||||
|
runner.Run(); |
||||||
|
} |
||||||
|
|
||||||
|
IEnumerable<string> GetUnitTestNames(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
IProjectContent content = ParserService.GetProjectContent(selectedTests.Project); |
||||||
|
|
||||||
|
if (selectedTests.Class == null) { |
||||||
|
var testClasses = content.Classes |
||||||
|
.Where(c => c.Attributes.Any(a => a.AttributeType.FullyQualifiedName == "NUnit.Framework.TestFixtureAttribute")); |
||||||
|
return testClasses |
||||||
|
.SelectMany(c2 => c2.Methods) |
||||||
|
.Where(m => m.Attributes.Any(a2 => a2.AttributeType.FullyQualifiedName == "NUnit.Framework.TestAttribute")) |
||||||
|
.Select(m2 => m2.FullyQualifiedName); |
||||||
|
} |
||||||
|
|
||||||
|
if (selectedTests.Method == null) { |
||||||
|
return content.Classes |
||||||
|
.Where(c => c.FullyQualifiedName == selectedTests.Class.DotNetName).First().Methods |
||||||
|
.Where(m => m.Attributes.Any(a2 => a2.AttributeType.FullyQualifiedName == "NUnit.Framework.TestAttribute")) |
||||||
|
.Select(m2 => m2.FullyQualifiedName); |
||||||
|
} |
||||||
|
|
||||||
|
return new[] { selectedTests.Class.DotNetName + "." + selectedTests.Method.Name }; |
||||||
|
} |
||||||
|
|
||||||
|
void AfterFinish(SelectedTests selectedTests, string path) |
||||||
|
{ |
||||||
|
selectedTests.Project.AddSessionToProject(path); |
||||||
|
OnAllTestsFinished(this, new EventArgs()); |
||||||
|
LoggingService.Info("shutting profiler down..."); |
||||||
|
} |
||||||
|
|
||||||
|
public override void Stop() |
||||||
|
{ |
||||||
|
if (this.runner != null && this.runner.Profiler.IsRunning) { |
||||||
|
LoggingService.Info("stopping profiler..."); |
||||||
|
runner.Stop(); |
||||||
|
} |
||||||
|
|
||||||
|
if (testResultsMonitor != null) { |
||||||
|
testResultsMonitor.Stop(); |
||||||
|
testResultsMonitor.Read(); |
||||||
|
testResultsMonitor = null; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public override void Dispose() |
||||||
|
{ |
||||||
|
Stop(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,332 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.IO; |
||||||
|
|
||||||
|
using ICSharpCode.Core; |
||||||
|
using ICSharpCode.SharpDevelop; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
public abstract class AbstractRunTestCommand : AbstractMenuCommand |
||||||
|
{ |
||||||
|
static AbstractRunTestCommand runningTestCommand; |
||||||
|
IUnitTestsPad unitTestsPad; |
||||||
|
SelectedTests selectedTests; |
||||||
|
IRunTestCommandContext context; |
||||||
|
ITestRunner testRunner; |
||||||
|
|
||||||
|
public AbstractRunTestCommand() |
||||||
|
: this(new RunTestCommandContext()) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public AbstractRunTestCommand(IRunTestCommandContext context) |
||||||
|
{ |
||||||
|
this.context = context; |
||||||
|
} |
||||||
|
|
||||||
|
protected IRunTestCommandContext Context { |
||||||
|
get { return context; } |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the running test command.
|
||||||
|
/// </summary>
|
||||||
|
public static AbstractRunTestCommand RunningTestCommand { |
||||||
|
get { return runningTestCommand; } |
||||||
|
set { runningTestCommand = value; } |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether a test is currently running.
|
||||||
|
/// </summary>
|
||||||
|
public static bool IsRunningTest { |
||||||
|
get { return runningTestCommand != null; } |
||||||
|
} |
||||||
|
|
||||||
|
public override void Run() |
||||||
|
{ |
||||||
|
GetUnitTestsPad(context.OpenUnitTestsPad); |
||||||
|
|
||||||
|
selectedTests = new SelectedTests(Owner, this.unitTestsPad.GetProjects()); |
||||||
|
if (selectedTests.HasProjects) { |
||||||
|
runningTestCommand = this; |
||||||
|
BeforeRun(); |
||||||
|
RunTests(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void GetUnitTestsPad(IUnitTestsPad unitTestsPad) |
||||||
|
{ |
||||||
|
if (unitTestsPad != null) { |
||||||
|
this.unitTestsPad = unitTestsPad; |
||||||
|
} else { |
||||||
|
this.unitTestsPad = new EmptyUnitTestsPad(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the initial workbench state before starting
|
||||||
|
/// a test run.
|
||||||
|
/// </summary>
|
||||||
|
void BeforeRun() |
||||||
|
{ |
||||||
|
ClearTasks(); |
||||||
|
ClearUnitTestCategoryText(); |
||||||
|
|
||||||
|
ShowUnitTestsPad(); |
||||||
|
ShowOutputPad(); |
||||||
|
|
||||||
|
UpdateUnitTestsPadToolbar(); |
||||||
|
ResetAllTestResultsInUnitTestsPad(); |
||||||
|
|
||||||
|
OnBeforeRunTests(); |
||||||
|
} |
||||||
|
|
||||||
|
void RunTests() |
||||||
|
{ |
||||||
|
if (IsBuildNeededBeforeTestRun()) { |
||||||
|
BuildProjectBeforeRunningTests(selectedTests); |
||||||
|
} else { |
||||||
|
context.SaveAllFilesCommand.SaveAllFiles(); |
||||||
|
RunTests(selectedTests); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
bool IsBuildNeededBeforeTestRun() |
||||||
|
{ |
||||||
|
return context.RegisteredTestFrameworks.IsBuildNeededBeforeTestRunForProject(selectedTests.Project); |
||||||
|
} |
||||||
|
|
||||||
|
void ClearTasks() |
||||||
|
{ |
||||||
|
context.TaskService.BuildMessageViewCategory.ClearText(); |
||||||
|
context.TaskService.InUpdate = true; |
||||||
|
context.TaskService.ClearExceptCommentTasks(); |
||||||
|
context.TaskService.InUpdate = false; |
||||||
|
} |
||||||
|
|
||||||
|
void ClearUnitTestCategoryText() |
||||||
|
{ |
||||||
|
context.UnitTestCategory.ClearText(); |
||||||
|
} |
||||||
|
|
||||||
|
void ShowUnitTestsPad() |
||||||
|
{ |
||||||
|
unitTestsPad.BringToFront(); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateUnitTestsPadToolbar() |
||||||
|
{ |
||||||
|
unitTestsPad.UpdateToolbar(); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called before all tests are run. If multiple projects are
|
||||||
|
/// to be tested this is called only once.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void OnBeforeRunTests() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Runs the tests after building the project under test.
|
||||||
|
/// </summary>
|
||||||
|
void BuildProjectBeforeRunningTests(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
BuildProjectBeforeTestRun build = CreateBuildProjectBeforeTestRun(selectedTests); |
||||||
|
build.BuildComplete += delegate { |
||||||
|
OnBuildComplete(build.LastBuildResults, selectedTests); |
||||||
|
}; |
||||||
|
build.Run(); |
||||||
|
} |
||||||
|
|
||||||
|
BuildProjectBeforeTestRun CreateBuildProjectBeforeTestRun(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
return context.BuildProjectFactory.CreateBuildProjectBeforeTestRun(selectedTests.Project); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops running the tests.
|
||||||
|
/// </summary>
|
||||||
|
public void Stop() |
||||||
|
{ |
||||||
|
StopActiveTestRunner(); |
||||||
|
|
||||||
|
runningTestCommand = null; |
||||||
|
UpdateUnitTestsPadToolbar(); |
||||||
|
|
||||||
|
OnStop(); |
||||||
|
} |
||||||
|
|
||||||
|
void StopActiveTestRunner() |
||||||
|
{ |
||||||
|
if (testRunner != null) { |
||||||
|
testRunner.Stop(); |
||||||
|
testRunner.Dispose(); |
||||||
|
testRunner = null; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called after all tests have been run even if there have
|
||||||
|
/// been errors. If multiple projects are to be tested this is called only once.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void OnAfterRunTests() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
protected virtual void RunTests(NUnitConsoleApplication helper) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called by derived classes when a single test run
|
||||||
|
/// is finished.
|
||||||
|
/// </summary>
|
||||||
|
protected void TestRunCompleted() |
||||||
|
{ |
||||||
|
StopActiveTestRunner(); |
||||||
|
selectedTests.RemoveFirstProject(); |
||||||
|
if (selectedTests.HasProjects) { |
||||||
|
RunTests(); |
||||||
|
} else { |
||||||
|
runningTestCommand = null; |
||||||
|
UpdateUnitTestsPadToolbar(); |
||||||
|
ShowErrorList(); |
||||||
|
OnAfterRunTests(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void TestFinished(object source, TestFinishedEventArgs e) |
||||||
|
{ |
||||||
|
context.Workbench.SafeThreadAsyncCall(ShowResult, e.Result); |
||||||
|
} |
||||||
|
|
||||||
|
protected void ShowResult(TestResult result) |
||||||
|
{ |
||||||
|
if (IsTestResultFailureOrIsIgnored(result)) { |
||||||
|
AddTaskForTestResult(result); |
||||||
|
} |
||||||
|
UpdateTestResult(result); |
||||||
|
} |
||||||
|
|
||||||
|
bool IsTestResultFailureOrIsIgnored(TestResult result) |
||||||
|
{ |
||||||
|
return result.IsFailure || result.IsIgnored; |
||||||
|
} |
||||||
|
|
||||||
|
void AddTaskForTestResult(TestResult testResult) |
||||||
|
{ |
||||||
|
TestProject project = GetTestProjectForProject(selectedTests.Project); |
||||||
|
Task task = TestResultTask.Create(testResult, project); |
||||||
|
context.TaskService.Add(task); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the test run should be stopped.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void OnStop() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
void ShowOutputPad() |
||||||
|
{ |
||||||
|
ShowPad(context.Workbench.GetPad(typeof(CompilerMessageView))); |
||||||
|
} |
||||||
|
|
||||||
|
protected void ShowPad(PadDescriptor padDescriptor) |
||||||
|
{ |
||||||
|
context.Workbench.SafeThreadAsyncCall(padDescriptor.BringPadToFront); |
||||||
|
} |
||||||
|
|
||||||
|
void ShowErrorList() |
||||||
|
{ |
||||||
|
if (HasErrorsThatShouldBeDisplayed()) { |
||||||
|
ShowPad(context.Workbench.GetPad(typeof(ErrorListPad))); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
bool HasErrorsThatShouldBeDisplayed() |
||||||
|
{ |
||||||
|
return context.TaskService.SomethingWentWrong && |
||||||
|
context.BuildOptions.ShowErrorListAfterBuild; |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Runs the test for the project after a successful build.
|
||||||
|
/// </summary>
|
||||||
|
void OnBuildComplete(BuildResults results, SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
if (BuildHasNoErrorsAndStillRunningTests(results)) { |
||||||
|
RunTests(selectedTests); |
||||||
|
} else { |
||||||
|
if (IsRunningTest) { |
||||||
|
Stop(); |
||||||
|
} |
||||||
|
ShowErrorList(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
bool BuildHasNoErrorsAndStillRunningTests(BuildResults results) |
||||||
|
{ |
||||||
|
return (results.ErrorCount == 0) && IsRunningTest; |
||||||
|
} |
||||||
|
|
||||||
|
void RunTests(SelectedTests selectedTests) |
||||||
|
{ |
||||||
|
testRunner = CreateTestRunner(selectedTests.Project); |
||||||
|
if (testRunner != null) { |
||||||
|
testRunner.MessageReceived += TestRunnerMessageReceived; |
||||||
|
testRunner.AllTestsFinished += AllTestsFinished; |
||||||
|
testRunner.TestFinished += TestFinished; |
||||||
|
testRunner.Start(selectedTests); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected virtual ITestRunner CreateTestRunner(IProject project) |
||||||
|
{ |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
void TestRunnerMessageReceived(object source, MessageReceivedEventArgs e) |
||||||
|
{ |
||||||
|
context.UnitTestCategory.AppendLine(e.Message); |
||||||
|
} |
||||||
|
|
||||||
|
void AllTestsFinished(object source, EventArgs e) |
||||||
|
{ |
||||||
|
context.Workbench.SafeThreadAsyncCall(TestRunCompleted); |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears the test results in the test tree view for all the
|
||||||
|
/// displayed projects.
|
||||||
|
/// </summary>
|
||||||
|
void ResetAllTestResultsInUnitTestsPad() |
||||||
|
{ |
||||||
|
unitTestsPad.ResetTestResults(); |
||||||
|
} |
||||||
|
|
||||||
|
TestProject GetTestProjectForProject(IProject project) |
||||||
|
{ |
||||||
|
return unitTestsPad.GetTestProject(project); |
||||||
|
} |
||||||
|
|
||||||
|
void UpdateTestResult(TestResult result) |
||||||
|
{ |
||||||
|
TestProject testProject = GetTestProjectForProject(selectedTests.Project); |
||||||
|
if (testProject != null) { |
||||||
|
testProject.UpdateTestResult(result); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
using ICSharpCode.SharpDevelop.Project.Commands; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Custom build command that makes sure errors and warnings
|
||||||
|
/// are not cleared from the Errors list before every build since
|
||||||
|
/// we may be running multiple tests after each other.
|
||||||
|
/// </summary>
|
||||||
|
public class BuildProjectBeforeTestRun : BuildProjectBeforeExecute |
||||||
|
{ |
||||||
|
IUnitTestSaveAllFilesCommand saveAllFilesCommand; |
||||||
|
|
||||||
|
public BuildProjectBeforeTestRun(IProject targetProject, |
||||||
|
IUnitTestSaveAllFilesCommand saveAllFilesCommand) |
||||||
|
: base(targetProject) |
||||||
|
{ |
||||||
|
this.saveAllFilesCommand = saveAllFilesCommand; |
||||||
|
} |
||||||
|
|
||||||
|
public BuildProjectBeforeTestRun(IProject targetProject) |
||||||
|
: this(targetProject, new UnitTestSaveAllFilesCommand()) |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Before a build do not clear the tasks, just save any
|
||||||
|
/// dirty files.
|
||||||
|
/// </summary>
|
||||||
|
public override void BeforeBuild() |
||||||
|
{ |
||||||
|
saveAllFilesCommand.SaveAllFiles(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
public class EmptyUnitTestsPad : IUnitTestsPad |
||||||
|
{ |
||||||
|
public void UpdateToolbar() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public void BringToFront() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public void ResetTestResults() |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public IProject[] GetProjects() |
||||||
|
{ |
||||||
|
return new IProject[0]; |
||||||
|
} |
||||||
|
|
||||||
|
public TestProject GetTestProject(IProject project) |
||||||
|
{ |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -1,16 +1,17 @@ |
|||||||
// <file>
|
// <file>
|
||||||
// <copyright see="prj:///doc/copyright.txt"/>
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
// <license see="prj:///doc/license.txt"/>
|
// <license see="prj:///doc/license.txt"/>
|
||||||
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
// <version>$Revision$</version>
|
// <version>$Revision$</version>
|
||||||
// </file>
|
// </file>
|
||||||
|
|
||||||
using System; |
using System; |
||||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||||
using System.Windows; |
|
||||||
using System.Windows.Controls; |
|
||||||
using System.Windows.Media; |
|
||||||
|
|
||||||
namespace Debugger.AddIn.Visualizers |
namespace ICSharpCode.UnitTesting |
||||||
{ |
{ |
||||||
|
public interface IAddInTree |
||||||
|
{ |
||||||
|
List<T> BuildItems<T>(string path, object caller); |
||||||
|
} |
||||||
} |
} |
@ -0,0 +1,16 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
public interface IBuildOptions |
||||||
|
{ |
||||||
|
bool ShowErrorListAfterBuild { get; } |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
public interface IBuildProjectFactory |
||||||
|
{ |
||||||
|
BuildProjectBeforeTestRun CreateBuildProjectBeforeTestRun(IProject project); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Dom; |
||||||
|
using ICSharpCode.SharpDevelop.Project; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
public interface IRegisteredTestFrameworks |
||||||
|
{ |
||||||
|
ITestFramework GetTestFrameworkForProject(IProject project); |
||||||
|
ITestRunner CreateTestRunner(IProject project); |
||||||
|
ITestRunner CreateTestDebugger(IProject project); |
||||||
|
|
||||||
|
bool IsTestMethod(IMember member); |
||||||
|
bool IsTestClass(IClass c); |
||||||
|
bool IsTestProject(IProject project); |
||||||
|
|
||||||
|
bool IsBuildNeededBeforeTestRunForProject(IProject project); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.SharpDevelop.Gui; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
public interface IRunTestCommandContext |
||||||
|
{ |
||||||
|
IRegisteredTestFrameworks RegisteredTestFrameworks { get; } |
||||||
|
IUnitTestTaskService TaskService { get; } |
||||||
|
IUnitTestWorkbench Workbench { get; } |
||||||
|
IBuildProjectFactory BuildProjectFactory { get; } |
||||||
|
IBuildOptions BuildOptions { get; } |
||||||
|
MessageViewCategory UnitTestCategory { get; } |
||||||
|
IUnitTestsPad OpenUnitTestsPad { get; } |
||||||
|
IUnitTestMessageService MessageService { get; } |
||||||
|
IUnitTestSaveAllFilesCommand SaveAllFilesCommand { get; } |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.UnitTesting |
||||||
|
{ |
||||||
|
public interface ITestFrameworkFactory |
||||||
|
{ |
||||||
|
ITestFramework Create(string className); |
||||||
|
} |
||||||
|
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue