NUnit-console 2.5.4 无法运行多个程序集?
我在使用命令行 NUnit 测试运行程序运行测试时遇到问题。
我在 x64 计算机上使用带有 .NET 4 的版本 2.5.4。
使用以下行会导致失败“无法加载文件或程序集‘bar’或其中之一 它的依赖项。系统找不到指定的文件。”
nunit-console-x86 foo.dll bar.dll /framework=4.0.30319
如果我反转 dll 文件名,它会抱怨找不到“foo”...
如果我单独运行它们,它会起作用,例如:
nunit-console-x86 foo.dll /framework=4.0.30319
,第二个文件的测试也会起作用
nunit-console-x86 bar.dll /framework=4.0.30319
如果我运行: Before 将我们的项目升级到 4.0,我们使用了 NUnit 2.5.2 和相同的命令行工具选项,此时运行器可以很好地处理多个程序集,同时在多个文件上运行测试的能力似乎被破坏了......
都可以看到相同的行为或者它是否有效表明我的环境在某种程度上被破坏了?
任何人
I am having problems running tests with the command line NUnit test runner.
I am using version 2.5.4 with .NET 4 on an x64 machine.
Using the following line results in a failure "Could not load file or assembly 'bar' or one of
its dependencies. The system cannot find the file specified."
nunit-console-x86 foo.dll bar.dll /framework=4.0.30319
If I reverse the dll file names it complains about not finding 'foo' instead...
It works if I run them separately like:
nunit-console-x86 foo.dll /framework=4.0.30319
Also the tests of the second file works if I run:
nunit-console-x86 bar.dll /framework=4.0.30319
Before upgrading our projects to 4.0 we used NUnit 2.5.2 and the same command line tool options and at that point the runner worked well with multiple assemblies. It seems like the ability to run tests on multiple files at the same time is broken...
Anyone that can see the same behavior or does it work indicating that my environment is somehow broken?
/Per
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
程序集加载行为在 2.5.4 和 2.5.3 之间发生了变化。它给我们带来了问题,所以我们恢复到 2.5.3,因为它仍然支持 4.0 框架。
我们在 msbuild 脚本中使用带有多个程序集的 nunit-console.exe 2.5.3,如下所示:
执行时,它的填写如下(为了便于阅读而进行了编辑):
我们不使用 64 位机器进行单元测试,所以 YMMV。
我有一篇关于您应该对 nunit-console-x86.exe.config 进行额外修改的博客文章:让 .Net 4.0、Team City、MSBuild 和 Nunit 发挥良好作用。
Assembly loading behaviour has changed between 2.5.4 and 2.5.3. It was causing problems for us, so we reverted to 2.5.3, since that still supports the 4.0 framework.
We use nunit-console.exe 2.5.3 with multiple assemblies in our msbuild script, which looks like this:
On execution, it fills out like this (edited for readability):
We don't use a 64bit machine for our unit tests, so YMMV.
I have a blog post about the addtional modification your should make to the nunit-console-x86.exe.config here: Getting .Net 4.0, Team City, MSBuild and Nunit to play nice.
我有同样的问题。我通过在 GUI 中创建一个包含多个 dll 的 nunit 项目来解决这个问题。然后我可以使用 nunit-console 运行它。
I has the same problem. I got around it by creating an nunit project in the GUI that includes multiple dlls. Then I can run it with nunit-console.