简体   繁体   English

在OSX上运行NUnit测试的步骤

[英]Steps to run NUnit tests on OSX

How do I run NUnit tests developed within VS2010 on a Mac? 如何在Mac上运行VS2010中开发的NUnit测试? This seems like a very simple and naive question but I have been struggling to find all the steps. 这似乎是一个非常简单和天真的问题,但我一直在努力寻找所有的步骤。 I have done my due diligence by scouring the web to find the exact steps. 我通过搜索网络找到了确切的步骤,完成了我的尽职调查。 I have Mono on my Mac, but not monodevelop. 我的Mac上有Mono,但不是monodevelop。 How can i install NUnit on a Mac without mono develop? 如何在没有单色显示的情况下在Mac上安装NUnit? Do I need to add all the NUnit related dlls manually to Mono GAC or something? 我是否需要手动将所有NUnit相关的dll添加到Mono GAC或其他东西?

No need to have monodevelop. 无需进行单一开发。 After getting nunit you can just call it via (for instance) 获得nunit后你可以通过(例如)调用它

mono nunit-console.exe your.dll

You can also do this using only binaries downloaded from nunit site, just be in the nunit's directory. 您也可以仅使用从nunit站点下载的二进制文件来执行此操作,只需在nunit的目录中。

If there is no package for OS X, you can install it by making script invoking nunit (this is how standard nunit install on Linux works) and putting it in your search path. 如果OS X没有软件包,您可以通过调用nunit脚本来安装它(这是Linux上标准的nunit安装工作方式)并将其放在搜索路径中。 Adding assemblies to GAC is not necessary as long as they are with exe's. 只要它们与exe一起使用,就不需要向GAC添加程序集。

For example this is nunit-console script on Ubuntu (which can be usually found in /usr/bin ): 例如,这是Ubuntu上的nunit-console脚本(通常可以在/usr/bin ):

#!/bin/sh
exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/2.0/nunit-console.exe "$@"

Of course you should replace /usr/lib/mono/2.0/ with directory which contains nunit. 当然你应该用包含nunit的目录替换/usr/lib/mono/2.0/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM