在OSX上运行NUnit测试的步骤 [英] Steps to run NUnit tests on OSX

查看:70
本文介绍了在OSX上运行NUnit测试的步骤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Mac上运行VS2010中开发的NUnit测试?这似乎是一个非常简单且幼稚的问题,但我一直在努力寻找所有步骤.我已经通过搜索网络以查找确切步骤进行了尽职调查.我的Mac上装有Mono,但没有monodevelop.在没有Mono开发的情况下如何在Mac上安装NUnit?我是否需要将所有与NUnit相关的dll手动添加到Mono GAC之类?

How do I run NUnit tests developed within VS2010 on a Mac? 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. How can i install NUnit on a Mac without mono develop? Do I need to add all the NUnit related dlls manually to Mono GAC or something?

推荐答案

无需monodevelop.获得nunit之后,您可以通过(例如)调用它

No need to have monodevelop. After getting nunit you can just call it via (for instance)

mono nunit-console.exe your.dll

您也可以只使用从nunit站点下载的二进制文件来执行此操作,只需在nunit的目录中即可.

You can also do this using only binaries downloaded from nunit site, just be in the nunit's directory.

如果没有适用于OS X的软件包,则可以通过使脚本调用nunit(这是在Linux上安装标准nunit的方式)并将其放在搜索路径中来进行安装.只要它们与exe一样,都无需向GAC添加程序集.

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. Adding assemblies to GAC is not necessary as long as they are with exe's.

例如,这是Ubuntu上的nunit-console脚本(通常可以在/usr/bin中找到):

For example this is nunit-console script on Ubuntu (which can be usually found in /usr/bin):

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

当然,您应该将/usr/lib/mono/2.0/替换为包含nunit的目录.

Of course you should replace /usr/lib/mono/2.0/ with directory which contains nunit.

这篇关于在OSX上运行NUnit测试的步骤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆