From 82c8b61d80c92572a6f34d910eacc9d23aca469c Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Mon, 2 Aug 2010 18:04:26 +0000 Subject: [PATCH] Changes in Tools-Options for the IronPython and IronRuby console application filename are now picked up when using Python-Run or Ruby-Run. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6364 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/PythonConsoleApplication.cs | 13 ++++--------- .../Testing/PythonConsoleApplicationTestFixture.cs | 9 +++++++++ .../Project/Src/RubyConsoleApplication.cs | 8 ++++---- .../Testing/RubyConsoleApplicationTestFixture.cs | 9 +++++++++ 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleApplication.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleApplication.cs index 0dba1e1232..ad09516c84 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleApplication.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsoleApplication.cs @@ -13,7 +13,7 @@ namespace ICSharpCode.PythonBinding { public class PythonConsoleApplication { - string fileName = String.Empty; + PythonAddInOptions options; StringBuilder arguments; bool debug; string pythonScriptFileName = String.Empty; @@ -21,17 +21,12 @@ namespace ICSharpCode.PythonBinding string workingDirectory = String.Empty; public PythonConsoleApplication(PythonAddInOptions options) - : this(options.PythonFileName) { - } - - public PythonConsoleApplication(string fileName) - { - this.fileName = fileName; + this.options = options; } public string FileName { - get { return fileName; } + get { return options.PythonFileName; } } public bool Debug { @@ -57,7 +52,7 @@ namespace ICSharpCode.PythonBinding public ProcessStartInfo GetProcessStartInfo() { ProcessStartInfo processStartInfo = new ProcessStartInfo(); - processStartInfo.FileName = fileName; + processStartInfo.FileName = FileName; processStartInfo.Arguments = GetArguments(); processStartInfo.WorkingDirectory = workingDirectory; return processStartInfo; diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonConsoleApplicationTestFixture.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonConsoleApplicationTestFixture.cs index 30802a45ac..91a12bf296 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonConsoleApplicationTestFixture.cs +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonConsoleApplicationTestFixture.cs @@ -91,5 +91,14 @@ namespace PythonBinding.Tests.Testing ProcessStartInfo startInfo = app.GetProcessStartInfo(); Assert.AreEqual(@"d:\temp", startInfo.WorkingDirectory); } + + [Test] + public void ChangingOptionsPythonFileNameChangesProcessStartInfoFileName() + { + options.PythonFileName = @"d:\temp\test\ipy.exe"; + ProcessStartInfo startInfo = app.GetProcessStartInfo(); + + Assert.AreEqual(@"d:\temp\test\ipy.exe", startInfo.FileName); + } } } diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs index cdb94308be..f9cf8cecb5 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs @@ -14,7 +14,7 @@ namespace ICSharpCode.RubyBinding { public class RubyConsoleApplication { - string fileName; + RubyAddInOptions options; bool debug; List loadPaths = new List(); string rubyScriptFileName = String.Empty; @@ -25,11 +25,11 @@ namespace ICSharpCode.RubyBinding public RubyConsoleApplication(RubyAddInOptions options) { - this.fileName = options.RubyFileName; + this.options = options; } public string FileName { - get { return fileName; } + get { return options.RubyFileName; } } public bool Debug { @@ -60,7 +60,7 @@ namespace ICSharpCode.RubyBinding public ProcessStartInfo GetProcessStartInfo() { ProcessStartInfo processStartInfo = new ProcessStartInfo(); - processStartInfo.FileName = fileName; + processStartInfo.FileName = FileName; processStartInfo.Arguments = GetArguments(); processStartInfo.WorkingDirectory = workingDirectory; return processStartInfo; diff --git a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTestFixture.cs b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTestFixture.cs index c6351a23cb..e05b8cba05 100644 --- a/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTestFixture.cs +++ b/src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTestFixture.cs @@ -91,5 +91,14 @@ namespace RubyBinding.Tests.Testing ProcessStartInfo startInfo = app.GetProcessStartInfo(); Assert.AreEqual(@"d:\temp", startInfo.WorkingDirectory); } + + [Test] + public void ChangingOptionsRubyFileNameChangesProcessStartInfoFileName() + { + options.RubyFileName = @"d:\temp\test\ir.exe"; + ProcessStartInfo startInfo = app.GetProcessStartInfo(); + + Assert.AreEqual(@"d:\temp\test\ir.exe", startInfo.FileName); + } } }