Browse Source

Move MSBuildEngineHelper to Scripting Tests project.

pull/1/head
mrward 15 years ago
parent
commit
18f3790186
  1. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ConvertToPythonProjectCommandTestFixture.cs
  2. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ProjectHasStartupObjectTestFixture.cs
  3. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/AppSettingsPanelTestFixture.cs
  4. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/CompilingOptionsPanelTestFixture.cs
  5. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/ParserTestFixture.cs
  6. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
  7. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonLanguage/CreateNewPythonProjectTestFixture.cs
  8. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestFrameworkIsTestProjectTests.cs
  9. 22
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/PythonMSBuildEngineHelper.cs
  10. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Converter/ConvertToRubyProjectCommandTestFixture.cs
  11. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj
  12. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestFrameworkIsTestProjectTests.cs
  13. 17
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/RubyMSBuildEngineHelper.cs
  14. 1
      src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj
  15. 43
      src/AddIns/BackendBindings/Scripting/Test/Utils/MSBuildEngineHelper.cs

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ConvertToPythonProjectCommandTestFixture.cs

@ -42,7 +42,7 @@ namespace PythonBinding.Tests.Converter
[TestFixtureSetUp] [TestFixtureSetUp]
public void SetUpFixture() public void SetUpFixture()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); PythonMSBuildEngineHelper.InitMSBuildEngine();
List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>(); List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>();
using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) { using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) {

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ProjectHasStartupObjectTestFixture.cs

@ -54,7 +54,7 @@ namespace PythonBinding.Tests.Converter
[TestFixtureSetUp] [TestFixtureSetUp]
public void SetUpFixture() public void SetUpFixture()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); PythonMSBuildEngineHelper.InitMSBuildEngine();
List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>(); List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>();
using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) { using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) {

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/AppSettingsPanelTestFixture.cs

@ -30,7 +30,7 @@ namespace PythonBinding.Tests.Gui
[SetUp] [SetUp]
public void SetUp() public void SetUp()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); PythonMSBuildEngineHelper.InitMSBuildEngine();
ProjectCreateInformation info = new ProjectCreateInformation(); ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = new Solution(); info.Solution = new Solution();

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/CompilingOptionsPanelTestFixture.cs

@ -30,7 +30,7 @@ namespace PythonBinding.Tests.Gui
[SetUp] [SetUp]
public void SetUp() public void SetUp()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); PythonMSBuildEngineHelper.InitMSBuildEngine();
ProjectCreateInformation info = new ProjectCreateInformation(); ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = new Solution(); info.Solution = new Solution();

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/ParserTestFixture.cs

@ -29,7 +29,7 @@ namespace PythonBinding.Tests.Parsing
[TestFixtureSetUp] [TestFixtureSetUp]
public void SetUpFixture() public void SetUpFixture()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); PythonMSBuildEngineHelper.InitMSBuildEngine();
parser = new PythonParser(); parser = new PythonParser();
} }

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj

@ -446,7 +446,7 @@
<Compile Include="Utils\MockPythonConsolePad.cs" /> <Compile Include="Utils\MockPythonConsolePad.cs" />
<Compile Include="Utils\MockPythonFileService.cs" /> <Compile Include="Utils\MockPythonFileService.cs" />
<Compile Include="Utils\MockWorkbench.cs" /> <Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\MSBuildEngineHelper.cs" /> <Compile Include="Utils\PythonMSBuildEngineHelper.cs" />
<Compile Include="Utils\TestablePythonConsole.cs" /> <Compile Include="Utils\TestablePythonConsole.cs" />
<Compile Include="Utils\Tests\AddInPathHelperTestFixture.cs" /> <Compile Include="Utils\Tests\AddInPathHelperTestFixture.cs" />
<EmbeddedResource Include="..\Project\PythonBinding.addin"> <EmbeddedResource Include="..\Project\PythonBinding.addin">

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonLanguage/CreateNewPythonProjectTestFixture.cs

@ -31,7 +31,7 @@ namespace PythonBinding.Tests.PythonLanguage
[TestFixtureSetUp] [TestFixtureSetUp]
public void SetUpFixture() public void SetUpFixture()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); PythonMSBuildEngineHelper.InitMSBuildEngine();
info = new ProjectCreateInformation(); info = new ProjectCreateInformation();
info.Solution = new Solution(); info.Solution = new Solution();

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestFrameworkIsTestProjectTests.cs

@ -24,7 +24,7 @@ namespace PythonBinding.Tests.Testing
[TestFixtureSetUp] [TestFixtureSetUp]
public void SetUpFixture() public void SetUpFixture()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); PythonMSBuildEngineHelper.InitMSBuildEngine();
} }
[SetUp] [SetUp]

22
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MSBuildEngineHelper.cs → src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/PythonMSBuildEngineHelper.cs

@ -8,16 +8,14 @@
using System; using System;
using System.IO; using System.IO;
using ICSharpCode.PythonBinding; using ICSharpCode.PythonBinding;
using ICSharpCode.Scripting.Tests.Utils;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
namespace PythonBinding.Tests.Utils namespace PythonBinding.Tests.Utils
{ {
/// <summary> public sealed class PythonMSBuildEngineHelper
/// Description of MSBuildEngineHelper.
/// </summary>
public sealed class MSBuildEngineHelper
{ {
MSBuildEngineHelper() PythonMSBuildEngineHelper()
{ {
} }
@ -25,23 +23,15 @@ namespace PythonBinding.Tests.Utils
/// The MSBuildEngine sets the PythonBinPath so if /// The MSBuildEngine sets the PythonBinPath so if
/// the Python.Build.Tasks assembly is shadow copied it refers /// the Python.Build.Tasks assembly is shadow copied it refers
/// to the shadow copied assembly not the original. This /// to the shadow copied assembly not the original. This
/// causes problems for python projects that refer to the /// causes problems for Python projects that refer to the
/// SharpDevelop.Python.Build.targets import via $(PythonBinPath) /// SharpDevelop.Python.Build.targets import via $(PythonBinPath)
/// so here we change it so it points to the real PythonBinPath /// so here we change it so it points to the real PythonBinPath
/// binary. /// binary.
/// </summary> /// </summary>
public static void InitMSBuildEngine() public static void InitMSBuildEngine()
{ {
// Remove existing PythonBinPath property. string relativePath = @"..\..\AddIns\BackendBindings\PythonBinding\";
MSBuildEngine.MSBuildProperties.Remove("PythonBinPath"); MSBuildEngineHelper.InitMSBuildEngine("PythonBinPath", relativePath, typeof(PythonParser));
// Set the PythonBinPath property so it points to
// the actual bin path where the Python.Build.Tasks was built not
// to the shadow copy folder.
string codeBase = typeof(PythonParser).Assembly.CodeBase.Replace("file:///", String.Empty);
string folder = Path.GetDirectoryName(codeBase);
folder = Path.GetFullPath(Path.Combine(folder, @"..\..\AddIns\BackendBindings\PythonBinding\"));
MSBuildEngine.MSBuildProperties["PythonBinPath"] = folder;
} }
} }
} }

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Converter/ConvertToRubyProjectCommandTestFixture.cs

@ -45,7 +45,7 @@ namespace RubyBinding.Tests.Converter
[TestFixtureSetUp] [TestFixtureSetUp]
public void SetUpFixture() public void SetUpFixture()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); RubyMSBuildEngineHelper.InitMSBuildEngine();
List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>(); List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>();
using (TextReader reader = RubyBindingAddInFile.ReadAddInFile()) { using (TextReader reader = RubyBindingAddInFile.ReadAddInFile()) {

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj

@ -340,8 +340,8 @@
<Compile Include="Utils\MockRubyFileService.cs" /> <Compile Include="Utils\MockRubyFileService.cs" />
<Compile Include="Utils\MockConsoleTextEditor.cs" /> <Compile Include="Utils\MockConsoleTextEditor.cs" />
<Compile Include="Utils\MockWorkbench.cs" /> <Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\MSBuildEngineHelper.cs" />
<Compile Include="Utils\RubyBindingAddInFile.cs" /> <Compile Include="Utils\RubyBindingAddInFile.cs" />
<Compile Include="Utils\RubyMSBuildEngineHelper.cs" />
<Compile Include="Utils\RubyParserHelper.cs" /> <Compile Include="Utils\RubyParserHelper.cs" />
<Compile Include="Utils\RubySelectedTestsHelper.cs" /> <Compile Include="Utils\RubySelectedTestsHelper.cs" />
<Compile Include="Utils\TestableRubyConsole.cs" /> <Compile Include="Utils\TestableRubyConsole.cs" />

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestFrameworkIsTestProjectTests.cs

@ -24,7 +24,7 @@ namespace RubyBinding.Tests.Testing
[TestFixtureSetUp] [TestFixtureSetUp]
public void SetUpFixture() public void SetUpFixture()
{ {
MSBuildEngineHelper.InitMSBuildEngine(); RubyMSBuildEngineHelper.InitMSBuildEngine();
} }
[SetUp] [SetUp]

17
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/MSBuildEngineHelper.cs → src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/RubyMSBuildEngineHelper.cs

@ -8,13 +8,14 @@
using System; using System;
using System.IO; using System.IO;
using ICSharpCode.RubyBinding; using ICSharpCode.RubyBinding;
using ICSharpCode.Scripting.Tests.Utils;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
namespace RubyBinding.Tests.Utils namespace RubyBinding.Tests.Utils
{ {
public sealed class MSBuildEngineHelper public sealed class RubyMSBuildEngineHelper
{ {
MSBuildEngineHelper() RubyMSBuildEngineHelper()
{ {
} }
@ -29,16 +30,8 @@ namespace RubyBinding.Tests.Utils
/// </summary> /// </summary>
public static void InitMSBuildEngine() public static void InitMSBuildEngine()
{ {
// Remove existing RubyBinPath property. string relativePath = @"..\..\AddIns\BackendBindings\RubyBinding\";
MSBuildEngine.MSBuildProperties.Remove("RubyBinPath"); MSBuildEngineHelper.InitMSBuildEngine("RubyBinPath", relativePath, typeof(RubyParser));
// Set the RubyBinPath property so it points to
// the actual bin path where the Ruby.Build.Tasks was built not
// to the shadow copy folder.
string codeBase = typeof(RubyParser).Assembly.CodeBase.Replace("file:///", String.Empty);
string folder = Path.GetDirectoryName(codeBase);
folder = Path.GetFullPath(Path.Combine(folder, @"..\..\AddIns\AddIns\BackendBindings\RubyBinding\"));
MSBuildEngine.MSBuildProperties["RubyBinPath"] = folder;
} }
} }
} }

1
src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj

@ -110,6 +110,7 @@
<Compile Include="Utils\MockTextEditorViewContent.cs" /> <Compile Include="Utils\MockTextEditorViewContent.cs" />
<Compile Include="Utils\MockTypeResolutionService.cs" /> <Compile Include="Utils\MockTypeResolutionService.cs" />
<Compile Include="Utils\MockViewContent.cs" /> <Compile Include="Utils\MockViewContent.cs" />
<Compile Include="Utils\MSBuildEngineHelper.cs" />
<Compile Include="Utils\NullPropertyUserControl.cs" /> <Compile Include="Utils\NullPropertyUserControl.cs" />
<Compile Include="Utils\SupportInitCustomControl.cs" /> <Compile Include="Utils\SupportInitCustomControl.cs" />
<Compile Include="Utils\Tests\MockComponentCreatorTests.cs" /> <Compile Include="Utils\Tests\MockComponentCreatorTests.cs" />

43
src/AddIns/BackendBindings/Scripting/Test/Utils/MSBuildEngineHelper.cs

@ -0,0 +1,43 @@
// <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.Scripting;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Scripting.Tests.Utils
{
public sealed class MSBuildEngineHelper
{
MSBuildEngineHelper()
{
}
/// <summary>
/// The MSBuildEngine sets theBinPath so if
/// the Build.Tasks assembly is shadow copied it refers
/// to the shadow copied assembly not the original. This
/// causes problems for python projects that refer to the
/// SharpDevelop.*.Build.targets import via $(BinPath)
/// so here we change it so it points to the real BinPath
/// binary.
/// </summary>
public static void InitMSBuildEngine(string binPathName, string addInRelativePath, Type typeForCodeBase)
{
MSBuildEngine.MSBuildProperties.Remove(binPathName);
// Set the bin path property so it points to
// the actual bin path where the Build.Tasks was built not
// to the shadow copy folder.
string codeBase = typeForCodeBase.Assembly.CodeBase.Replace("file:///", String.Empty);
string folder = Path.GetDirectoryName(codeBase);
folder = Path.GetFullPath(Path.Combine(folder, addInRelativePath));
MSBuildEngine.MSBuildProperties[binPathName] = folder;
}
}
}
Loading…
Cancel
Save