Skip to content

Commit

Permalink
Put quotes around TestHost path so in case of spaces in name it start…
Browse files Browse the repository at this point in the history
…s correctly (#1108)

* Put quotes around TestHost path so in case of spaces in name it starts correctly

* Made unit test more strict to ensure path has quotes
  • Loading branch information
DavidKarlas authored and codito committed Sep 19, 2017
1 parent 8746f3f commit c5c77f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo(
!this.processHelper.GetCurrentProcessFileName().EndsWith(DotnetHostHelper.MONOEXENAME, StringComparison.OrdinalIgnoreCase))
{
launcherPath = this.dotnetHostHelper.GetMonoPath();
argumentsString = testhostProcessPath + " " + argumentsString;
argumentsString = testhostProcessPath.AddDoubleQuote() + " " + argumentsString;
}

// For IDEs and other scenario, current directory should be the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void GetTestHostProcessStartInfoShouldUseMonoAsHostOnNonWindowsIfNotStart
default(TestRunnerConnectionInfo));

Assert.AreEqual("/usr/bin/mono", info.FileName);
StringAssert.Contains(info.Arguments, "TestHost" + Path.DirectorySeparatorChar + "testhost.exe");
StringAssert.Contains(info.Arguments, "TestHost" + Path.DirectorySeparatorChar + "testhost.exe\"");
}

[TestMethod]
Expand Down

0 comments on commit c5c77f4

Please sign in to comment.