2014-03-25 43 views
4

好,事情是这样的,在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

运行(导致堆栈跟踪)显示相应的行号。

+0

好的,所以如果'-framework = 3.5'被添加它的作品。 – thiagogalesi

+0

-runtime = v4.0应添加到单声道命令行中 – thiagogalesi

+0

您应该将解决方案作为答案发布并接受它。 – jariq

回答

1

什么解决这个问题对我来说是选项

-runtime=v4.0 

(或相应的一个你的情况)

1

尝试通过“-config =调试”参数的NUnit控制台是这样的:

mono --debug /Users/thiago/qm/nunit/NUnit-2.6.3/bin/nunit-console.exe test.exe -config=Debug 
+0

同样的事情,仍然没有什么 – thiagogalesi

+0

你有工作目录中的所有.mdb文件以及test.exe二进制文件吗? – jariq

+0

是的,.mdbs在那里 – thiagogalesi