单声道(OSX)上的Nunit将不会运行测试 - mono_defaults.runtimetype_class!= 0
问题描述:
我想在OSX上使用Nunit来运行一些基本的测试。单声道(OSX)上的Nunit将不会运行测试 - mono_defaults.runtimetype_class!= 0
mono --version
单JIT编译器版本4.2.1(显式/ 6dd2d0d周二11月10日18时01分18秒美国东部时间2015年)
NUnit的:
which nunit-console
在/ usr /本地/ bin/nunit-console
也Nunit4:
which nunit-console4
在/ usr/local/bin目录/ NUnit的-console4
我试图使用运行的基本测试库中的以下内容:
nunit-console Tests.dll
但我得到跟踪:
* Assertion at domain.c:718, condition `mono_defaults.runtimetype_class != 0' not met
Native stacktrace:
0 mono 0x000c91c6 mono_handle_native_sigsegv + 342
1 mono 0x001198d1 sigabrt_signal_handler + 129
2 libsystem_platform.dylib 0x95d9101b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libsystem_c.dylib 0x90304c34 abort + 156
5 mono 0x0026dd11 monoeg_log_default_handler + 129
6 mono 0x0026de0b monoeg_assertion_message + 107
7 mono 0x001d8f04 mono_init_internal + 5860
8 mono 0x001d92b8 mono_init_from_assembly + 24
9 mono 0x00017c6f mini_init + 2063
10 mono 0x000937e0 mono_main + 4912
11 mono 0x0000c690 main + 768
12 mono 0x0000c385 start + 53
13 ??? 0x00000004 0x0 + 4
Debug info from gdb:
(lldb) command source -s 0 '/tmp/mono-gdb-commands.7rUr4M'
Executing commands in '/tmp/mono-gdb-commands.7rUr4M'.
(lldb) process attach --pid 6044
Process 6044 stopped
* thread #1: tid = 0x403d0, 0x993ced06 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x993ced06 libsystem_kernel.dylib`__wait4 + 10
libsystem_kernel.dylib`__wait4:
-> 0x993ced06 <+10>: jae 0x993ced16 ; <+26>
0x993ced08 <+12>: calll 0x993ced0d ; <+17>
0x993ced0d <+17>: popl %edx
0x993ced0e <+18>: movl 0xab94317(%edx), %edx
Executable module set to "/Library/Frameworks/Mono.framework/Versions/4.2.1/bin/mono".
Architecture set to: i386-apple-macosx.
(lldb) thread list
Process 6044 stopped
* thread #1: tid = 0x403d0, 0x993ced06 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
thread #2: tid = 0x403d8, 0x993ce402 libsystem_kernel.dylib`__psynch_cvwait + 10
(lldb) thread backtrace all
* thread #1: tid = 0x403d0, 0x993ced06 libsystem_kernel.dylib`__wait4 + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
* frame #0: 0x993ced06 libsystem_kernel.dylib`__wait4 + 10
frame #1: 0x903247dc libsystem_c.dylib`waitpid$UNIX2003 + 48
frame #2: 0x000c928d mono`mono_handle_native_sigsegv(signal=6, ctx=0xbfff62ac, info=0xbfff626c) + 541 at mini-exceptions.c:2193 [opt]
frame #3: 0x001198d1 mono`sigabrt_signal_handler(_dummy=<unavailable>, _info=<unavailable>, context=<unavailable>) + 129 at mini-posix.c:208 [opt]
frame #4: 0x95d9101b libsystem_platform.dylib`_sigtramp + 43
frame #5: 0x993ce58b libsystem_kernel.dylib`__pthread_kill + 11
frame #6: 0x91ef3448 libsystem_pthread.dylib`pthread_kill + 101
frame #7: 0x90304c34 libsystem_c.dylib`abort + 156
frame #8: 0x0026dd11 mono`monoeg_log_default_handler(log_domain=<unavailable>, log_level=<unavailable>, message=<unavailable>, unused_data=<unavailable>) + 129 at goutput.c:233 [opt]
frame #9: 0x0026de0b mono`monoeg_assertion_message [inlined] monoeg_g_logv(log_level=G_LOG_LEVEL_ERROR, format=<unavailable>) + 85 at goutput.c:113 [opt]
frame #10: 0x0026ddb6 mono`monoeg_assertion_message(format=<unavailable>) + 22 at goutput.c:133 [opt]
frame #11: 0x001d8f04 mono`mono_init_internal(filename=<unavailable>, exe_filename=<unavailable>, runtime_version=<unavailable>) + 5860 at domain.c:718 [opt]
frame #12: 0x001d92b8 mono`mono_init_from_assembly(domain_name="/Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/4.5/nunit-console.exe", filename="/Library/Frameworks/Mono.framework/Versions/4.2.1/lib/mono/4.5/nunit-console.exe") + 24 at domain.c:893 [opt]
frame #13: 0x00017c6f mono`mini_init(filename=<unavailable>, runtime_version=<unavailable>) + 2063 at mini-runtime.c:3069 [opt]
frame #14: 0x000937e0 mono`mono_main(argc=4, argv=0xbfff6740) + 4912 at driver.c:1907 [opt]
frame #15: 0x0000c690 mono`main [inlined] mono_main_with_options(argc=<unavailable>, argv=<unavailable>) + 768 at main.c:94 [opt]
frame #16: 0x0000c3ad mono`main(argc=<unavailable>, argv=<unavailable>) + 29 at main.c:125 [opt]
frame #17: 0x0000c385 mono`start + 53
thread #2: tid = 0x403d8, 0x993ce402 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #0: 0x993ce402 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x91ef1f6b libsystem_pthread.dylib`_pthread_cond_wait + 757
frame #2: 0x91ef5cc0 libsystem_pthread.dylib`pthread_cond_wait$UNIX2003 + 71
frame #3: 0x0023c852 mono`thread_func(thread_data=0x00000000) + 466 at sgen-thread-pool.c:118 [opt]
frame #4: 0x91ef1a26 libsystem_pthread.dylib`_pthread_body + 138
frame #5: 0x91ef199c libsystem_pthread.dylib`_pthread_start + 155
frame #6: 0x91eeef96 libsystem_pthread.dylib`thread_start + 34
(lldb) detach
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Process 6044 detached
(lldb) quit
[1] 6044 abort nunit-console Tests.dll
我不相信这是我的测试问题,因为它抛出相同跟踪时,只能尝试打开NUnit控制台的帮助说法:
nunit-console4 --help
我可以看到,它被扔在这里的文件的718行:
https://github.com/mono/mono/blob/master/mono/metadata/domain.c
mono_defaults.runtimetype_class = mono_class_from_name (
mono_defaults.corlib, "System", "RuntimeType");
g_assert (mono_defaults.runtimetype_class != 0);
因为错误不是很详细,所以我有点失落 - 对我来说,感觉就像我的配置有问题,导致Nunit无法正常启动。
感谢
答
您可能需要重新安装/升级单。我运行一个稍微更新的版本,我可以证实,
nunit-console --help
运行我的系统上就好用下面的版本 -
mono --version
Mono JIT compiler version 4.2.1 (Stable 4.2.1.102/6dd2d0d Wed Dec 2 14:02:16 PST 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
和运行
dnvm list
Active Version Runtime Arch Location Alias
------ ------- ------- ---- -------- -----
1.0.0-beta4 mono ~/.dnx/runtimes
* 1.0.0-rc1-update1 mono ~/.dnx/runtimes default
编辑: nunit-console脚本
#!/bin/sh
exec /usr/local/Cellar/mono/4.2.1.102_1/bin/mono --debug $MONO_OPTIONS /usr/local/Cellar/mono/4.2.1.102_1/lib/mono/4.5/nunit-console.exe "[email protected]"
我已经升级到4.3.3最新,但不幸的是我仍然看到相同的。你用什么系统和版本的OSX? –
我在12月中旬运行10.10.5的MBP视网膜。我已经在上面添加了我的nunit-console4脚本的内容。也许这对你来说是断开的? – richardsonmarkj
感谢您 - 我仍然没有运行直接与Mono运行,目前我下载Nunit并直接从包文件运行它 - 希望我可以很快修复它:( –