agiledragon / gomonkey

gomonkey is a library to make monkey patching in unit tests easy
MIT License
1.92k stars 178 forks source link

获取测试覆盖率失败 #165

Closed yyfyfyang closed 6 days ago

yyfyfyang commented 1 month ago

go test -coverprofile=coverage.out 在执行go test的时候获取测试覆盖率的时候测试程序会崩溃,我mac使用的是apple m1芯片

unexpected fault address 0x10168b678
fatal error: fault
[signal SIGBUS: bus error code=0x1 addr=0x10168b678 pc=0x10168b678]

goroutine 35 gp=0x140002c96c0 m=0 mp=0x101fb0940 [running]:
runtime.throw({0x1016a3d8a?, 0x14000130a20?})
xhd2015 commented 1 month ago

或许试试xgo test -coverprofile=coverage.out 同样支持mock,但是兼容性更好,功能更多。 https://github.com/xhd2015/xgo

agiledragon commented 3 weeks ago

@yyfyfyang apple m1芯片的问题没有完全解决