vstest.console.exe不执行我的测试.
var testProcess = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = @"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe",
Arguments = _testDllPath,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};--我在执行命令行时收到以下输出:
Microsoft (R)测试执行命令行工具版本11.0.60315.1Copyright (c) Microsoft Corporation。版权所有。
注意:当我运行MSTest时,测试确实会被执行:
var testProcess = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = @"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\mstest.exe",
Arguments = string.Format(@"/testcontainer:""{0}"" /resultsfile:""{1}""", _testDllPath, _resultsDirectoryPath),
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};然而,在命令行上运行最多的会导致我的一个测试失败,即使我不能在VS2012 TestExplorer.中再现测试失败。
发布于 2015-02-13 13:07:40
我需要用引号包围我的测试dll路径:
var testProcess = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = @"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe",
Arguments = _testDllPath.Replace(_testDllPath, '"' + _testDllPath + '"'),
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};https://stackoverflow.com/questions/28499998
复制相似问题