我正在使用 NUnit 2.5 和 NAnt 0.85 编译 .NET 3.5 库。由于 NAnt 0.85 不支持 .NET 3.5,所以我在 NAnt.exe.config 中添加了一个条目来支持 3.5 框架。
'MyLibrary' 构建成功,但是当我执行 "test" 目标来运行 NUnit 测试时,似乎没有运行任何测试。
我需要注意某些版本问题吗?Test.dll在NUnit GUI中运行良好。
测试dll肯定被找到了,因为如果我移动它,就会出现以下错误:
执行测试失败。如果您的程序集未使用NUnit 2.2.8.0构建... 无法加载文件或程序集“Test”或其某个依赖项...
如果有人能指点我方向或描述他们遇到的类似情况,我将不胜感激。
编辑:我已经尝试过NAnt 0.86 beta 1,出现了同样的问题。
'MyLibrary' 构建成功,但是当我执行 "test" 目标来运行 NUnit 测试时,似乎没有运行任何测试。
[nunit2] Tests run: 0, Failures: 0, Not run: 0, Time: 0.012 seconds
以下是我在 NAnt.build 文件中用于构建和运行测试的条目:
<target name="build_tests" depends="build_core">
<mkdir dir="Target" />
<csc target="library" output="Target\Test.dll" debug="true">
<references>
<include name="Target\MyLibrary.dll"/>
<include name="Libraries\nunit.framework.dll"/>
</references>
<sources>
<include name="Test\**\*.cs" />
</sources>
</csc>
</target>
<target name="test" depends="build_tests">
<nunit2>
<formatter type="Plain" />
<test assemblyname="Target\Test.dll" />
</nunit2>
</target>
我需要注意某些版本问题吗?Test.dll在NUnit GUI中运行良好。
测试dll肯定被找到了,因为如果我移动它,就会出现以下错误:
执行测试失败。如果您的程序集未使用NUnit 2.2.8.0构建... 无法加载文件或程序集“Test”或其某个依赖项...
如果有人能指点我方向或描述他们遇到的类似情况,我将不胜感激。
编辑:我已经尝试过NAnt 0.86 beta 1,出现了同样的问题。