Merge pull request #2717 from eerhardt/Spaces
dotnet build fails with xmlDoc = true and spaces in the path.
This commit is contained in:
commit
a9621eb469
6 changed files with 69 additions and 3 deletions
|
@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
public class TestCommand
|
||||
{
|
||||
protected string _command;
|
||||
|
||||
|
||||
private string _baseDirectory;
|
||||
|
||||
public string WorkingDirectory { get; set; }
|
||||
|
@ -33,6 +33,12 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
#endif
|
||||
}
|
||||
|
||||
public TestCommand WithWorkingDirectory(string workingDirectory)
|
||||
{
|
||||
WorkingDirectory = workingDirectory;
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual CommandResult Execute(string args = "")
|
||||
{
|
||||
var commandPath = _command;
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
|
|||
|
||||
var buildCommand = new BuildCommand("");
|
||||
buildCommand.WorkingDirectory = testProjectDirectory;
|
||||
|
||||
|
||||
buildCommand.ExecuteWithCapturedOutput()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
@ -42,5 +42,29 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
|
|||
.Should()
|
||||
.Pass();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void It_builds_projects_with_xmlDoc_and_spaces_in_the_path()
|
||||
{
|
||||
var testInstance = TestAssetsManager
|
||||
.CreateTestInstance("TestLibraryWithXmlDoc", identifier: "With Space")
|
||||
.WithLockFiles();
|
||||
|
||||
testInstance.TestRoot.Should().Contain(" ");
|
||||
|
||||
var output = new DirectoryInfo(Path.Combine(testInstance.TestRoot, "output"));
|
||||
|
||||
new BuildCommand("", output: output.FullName, framework: DefaultLibraryFramework)
|
||||
.WithWorkingDirectory(testInstance.TestRoot)
|
||||
.ExecuteWithCapturedOutput()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
output.Should().HaveFiles(new[]
|
||||
{
|
||||
"TestLibraryWithXmlDoc.dll",
|
||||
"TestLibraryWithXmlDoc.xml"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue