提交 e90bcae2 编写于 作者: Z Zach Hess

Added command-line tests for SharedCompilationId (no changes expected)

上级 6e4a146f
......@@ -469,7 +469,7 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
var responseTask = BuildServerConnection.RunServerCompilation(
Language,
SharedCompilationId == "" ? null : SharedCompilationId,
string.IsNullOrEmpty(SharedCompilationId) ? null : SharedCompilationId,
GetArguments(commandLineCommands, responseFileCommands).ToList(),
buildPaths,
keepAlive: null,
......
......@@ -313,5 +313,26 @@ public void RefOnly()
csc.RefOnly = true;
Assert.Equal("/out:test.exe /refonly test.cs", csc.GenerateResponseFileContents());
}
[Fact]
public void SharedCompilationId()
{
var csc = new Csc();
csc.Sources = MSBuildUtil.CreateTaskItems("test.cs");
csc.UseSharedCompilation = true;
csc.SharedCompilationId = "testPipeName";
Assert.Equal("/out:test.exe test.cs", csc.GenerateResponseFileContents());
csc = new Csc();
csc.Sources = MSBuildUtil.CreateTaskItems("test.cs");
csc.UseSharedCompilation = false;
csc.SharedCompilationId = "testPipeName";
Assert.Equal("/out:test.exe test.cs", csc.GenerateResponseFileContents());
csc = new Csc();
csc.Sources = MSBuildUtil.CreateTaskItems("test.cs");
csc.SharedCompilationId = "testPipeName";
Assert.Equal("/out:test.exe test.cs", csc.GenerateResponseFileContents());
}
}
}
......@@ -310,5 +310,26 @@ public void RefOnly()
vbc.RefOnly = true;
Assert.Equal("/optionstrict:custom /out:test.exe /refonly test.vb", vbc.GenerateResponseFileContents());
}
[Fact]
public void SharedCompilationId()
{
var vbc = new Vbc();
vbc.Sources = MSBuildUtil.CreateTaskItems("test.vb");
vbc.UseSharedCompilation = true;
vbc.SharedCompilationId = "testPipeName";
Assert.Equal("/optionstrict:custom /out:test.exe test.vb", vbc.GenerateResponseFileContents());
vbc = new Vbc();
vbc.Sources = MSBuildUtil.CreateTaskItems("test.vb");
vbc.UseSharedCompilation = false;
vbc.SharedCompilationId = "testPipeName";
Assert.Equal("/optionstrict:custom /out:test.exe test.vb", vbc.GenerateResponseFileContents());
vbc = new Vbc();
vbc.Sources = MSBuildUtil.CreateTaskItems("test.vb");
vbc.SharedCompilationId = "testPipeName";
Assert.Equal("/optionstrict:custom /out:test.exe test.vb", vbc.GenerateResponseFileContents());
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册