Browse Source

Added Create XML output file option to the options panel for unit tests.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4120 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 16 years ago
parent
commit
3f6773cc05
  1. BIN
      data/resources/StringResources.de.resources
  2. BIN
      data/resources/StringResources.es-mx.resources
  3. BIN
      data/resources/StringResources.es.resources
  4. BIN
      data/resources/StringResources.nl.resources
  5. 9
      src/AddIns/Misc/UnitTesting/Resources/UnitTestingOptionsPanel.xfrm
  6. 4
      src/AddIns/Misc/UnitTesting/Src/RunTestCommands.cs
  7. 13
      src/AddIns/Misc/UnitTesting/Src/UnitTestingOptions.cs
  8. 5
      src/AddIns/Misc/UnitTesting/Src/UnitTestingOptionsPanel.cs
  9. 2
      src/AddIns/Misc/UnitTesting/Test/UnitTestCommandLineTests.cs
  10. 18
      src/AddIns/Misc/UnitTesting/Test/UnitTestingOptionsPanelTestFixture.cs
  11. 19
      src/AddIns/Misc/UnitTesting/Test/UnitTestingOptionsTestFixture.cs
  12. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

BIN
data/resources/StringResources.de.resources

Binary file not shown.

BIN
data/resources/StringResources.es-mx.resources

Binary file not shown.

BIN
data/resources/StringResources.es.resources

Binary file not shown.

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

9
src/AddIns/Misc/UnitTesting/Resources/UnitTestingOptionsPanel.xfrm

@ -12,6 +12,15 @@ @@ -12,6 +12,15 @@
<Anchor value="Top, Left, Right" />
<TabIndex value="1" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="createXmlOutputFileCheckBox" />
<Location value="6, 179" />
<Text value="${res:ICSharpCode.UnitTesting.OptionsPanel.CreateXmlOutputFile}" />
<TabIndex value="6" />
<Size value="420, 24" />
<UseVisualStyleBackColor value="True" />
<Anchor value="Top, Left, Right" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="threadCheckBox" />
<Location value="6, 149" />

4
src/AddIns/Misc/UnitTesting/Src/RunTestCommands.cs

@ -308,6 +308,10 @@ namespace ICSharpCode.UnitTesting @@ -308,6 +308,10 @@ namespace ICSharpCode.UnitTesting
helper.Labels = options.Labels;
helper.ShadowCopy = !options.NoShadow;
if (options.CreateXmlOutputFile) {
helper.XmlOutputFile = Path.Combine(Path.GetDirectoryName(project.OutputAssemblyFullPath), project.AssemblyName + "-TestResult.xml");
}
helper.Initialize(project, namespaceFilter, fixture, test);
helper.Results = Path.GetTempFileName();

13
src/AddIns/Misc/UnitTesting/Src/UnitTestingOptions.cs

@ -42,6 +42,11 @@ namespace ICSharpCode.UnitTesting @@ -42,6 +42,11 @@ namespace ICSharpCode.UnitTesting
/// </summary>
public static readonly string LabelsProperty = "Labels";
/// <summary>
/// The name of the create xml file property stored in SharpDevelop's options.
/// </summary>
public static readonly string CreateXmlOutputFileProperty = "CreateXmlOutputFile";
Properties properties;
public UnitTestingOptions()
@ -92,6 +97,14 @@ namespace ICSharpCode.UnitTesting @@ -92,6 +97,14 @@ namespace ICSharpCode.UnitTesting
public bool Labels {
get { return properties.Get<bool>(LabelsProperty, false); }
set { properties.Set<bool>(LabelsProperty, value); }
}
/// <summary>
/// Creates an XML output file.
/// </summary>
public bool CreateXmlOutputFile {
get { return properties.Get<bool>(CreateXmlOutputFileProperty, false); }
set { properties.Set<bool>(CreateXmlOutputFileProperty, value); }
}
}
}

5
src/AddIns/Misc/UnitTesting/Src/UnitTestingOptionsPanel.cs

@ -22,6 +22,7 @@ namespace ICSharpCode.UnitTesting @@ -22,6 +22,7 @@ namespace ICSharpCode.UnitTesting
CheckBox showProgressCheckBox;
CheckBox threadCheckBox;
CheckBox shadowCopyCheckBox;
CheckBox createXmlOutputFileCheckBox;
public UnitTestingOptionsPanel() : this(new UnitTestingOptions())
{
@ -50,6 +51,9 @@ namespace ICSharpCode.UnitTesting @@ -50,6 +51,9 @@ namespace ICSharpCode.UnitTesting
threadCheckBox = (CheckBox)ControlDictionary["threadCheckBox"];
threadCheckBox.Checked = !options.NoThread;
createXmlOutputFileCheckBox = (CheckBox)ControlDictionary["createXmlOutputFileCheckBox"];
createXmlOutputFileCheckBox.Checked = options.CreateXmlOutputFile;
}
public override bool StorePanelContents()
@ -59,6 +63,7 @@ namespace ICSharpCode.UnitTesting @@ -59,6 +63,7 @@ namespace ICSharpCode.UnitTesting
options.NoDots = !showProgressCheckBox.Checked;
options.NoShadow = !shadowCopyCheckBox.Checked;
options.NoThread = !threadCheckBox.Checked;
options.CreateXmlOutputFile = createXmlOutputFileCheckBox.Checked;
return true;
}

2
src/AddIns/Misc/UnitTesting/Test/UnitTestCommandLineTests.cs

@ -221,6 +221,6 @@ namespace UnitTesting.Tests @@ -221,6 +221,6 @@ namespace UnitTesting.Tests
string expectedCommandLine = "\"C:\\Projects\\MyTests\\MyTests.dll\" /run=\"MyTests.TestFixture+InnerTest\"";
Assert.AreEqual(expectedCommandLine, helper.GetArguments());
}
}
}
}

18
src/AddIns/Misc/UnitTesting/Test/UnitTestingOptionsPanelTestFixture.cs

@ -29,6 +29,7 @@ namespace UnitTesting.Tests @@ -29,6 +29,7 @@ namespace UnitTesting.Tests
CheckBox showProgressCheckBox;
CheckBox threadCheckBox;
CheckBox shadowCopyCheckBox;
CheckBox createXmlOutputFileCheckBox;
[SetUp]
public void SetUp()
@ -39,6 +40,7 @@ namespace UnitTesting.Tests @@ -39,6 +40,7 @@ namespace UnitTesting.Tests
options.NoDots = false;
options.NoShadow = false;
options.NoThread = false;
options.CreateXmlOutputFile = false;
panel = new DerivedUnitTestingOptionsPanel(options);
panel.LoadPanelContents();
@ -48,6 +50,7 @@ namespace UnitTesting.Tests @@ -48,6 +50,7 @@ namespace UnitTesting.Tests
showProgressCheckBox = (CheckBox)panel.ControlDictionary["showProgressCheckBox"];
threadCheckBox = (CheckBox)panel.ControlDictionary["threadCheckBox"];
shadowCopyCheckBox = (CheckBox)panel.ControlDictionary["shadowCopyCheckBox"];
createXmlOutputFileCheckBox = (CheckBox)panel.ControlDictionary["createXmlOutputFileCheckBox"];
}
[TearDown]
@ -137,5 +140,20 @@ namespace UnitTesting.Tests @@ -137,5 +140,20 @@ namespace UnitTesting.Tests
panel.StorePanelContents();
Assert.IsTrue(options.NoThread);
}
[Test]
public void CreateXmlOutputFileCheckBoxIsChecked()
{
Assert.IsFalse(createXmlOutputFileCheckBox.Checked);
}
[Test]
public void CreateXmlOutputFileSettingSaved()
{
options.CreateXmlOutputFile = false;
createXmlOutputFileCheckBox.Checked = true;
panel.StorePanelContents();
Assert.IsTrue(options.CreateXmlOutputFile);
}
}
}

19
src/AddIns/Misc/UnitTesting/Test/UnitTestingOptionsTestFixture.cs

@ -141,6 +141,23 @@ namespace UnitTesting.Tests @@ -141,6 +141,23 @@ namespace UnitTesting.Tests
UnitTestingOptions options = new UnitTestingOptions(newProperties);
Assert.IsTrue(options.Labels);
}
}
[Test]
public void SetCreateXmlOutputFileProperty()
{
defaultOptions.CreateXmlOutputFile = true;
Assert.IsTrue(p.Get<bool>(UnitTestingOptions.CreateXmlOutputFileProperty, false));
}
[Test]
public void CreateXmlOutputFileSetToTrueInProperties()
{
Properties newProperties = new Properties();
newProperties.Set<bool>(UnitTestingOptions.CreateXmlOutputFileProperty, true);
UnitTestingOptions options = new UnitTestingOptions(newProperties);
Assert.IsTrue(options.CreateXmlOutputFile);
}
}
}

BIN
src/Main/StartUp/Project/Resources/StringResources.resources

Binary file not shown.
Loading…
Cancel
Save