好,事情是这样的,在OS X上使用XamarinNUnit的/单不打印堆栈跟踪行号甚至--debug
(在cs文件是导致回溯一个非常简单的测试案例)
编译
mcs /debug /lib:~(...)NUnit-2.6.3/bin/framework/:~(...)NUnit-2.6.3/bin/lib/ -r:nunit.framework.dll test.cs
运行
mono --debug /Users/thiago/qm/nunit/NUnit-2.6.3/bin/nunit-console.exe test.exe
结果
1) Test Error : TestOne.testFirst
System.NullReferenceException : Object reference not set to an instance of an object
at TestOne.testFirst() [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
如果我使用所提供的NUnit控制台从Xamarin它的工作原理然而,它并没有与几个库等,(例如:监控和一些其他的)工作仅mono test.cs
运行(导致堆栈跟踪)显示相应的行号。
好的,所以如果'-framework = 3.5'被添加它的作品。 – thiagogalesi
-runtime = v4.0应添加到单声道命令行中 – thiagogalesi
您应该将解决方案作为答案发布并接受它。 – jariq