Intellij Idea 如何显示测试覆盖线 [英] Intellij Idea How to show tests covering line

查看:65
本文介绍了Intellij Idea 如何显示测试覆盖线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 IDEA 来分析我们的代码覆盖率.我可以看到有些行被调用了 N 次.但我也想知道是哪个测试导致了该线路呼叫.我看到了相应的按钮显示测试覆盖线",但是所有线都禁用了此按钮.

那么这种行为的原因是什么,是否可以强制 IDEA 显示调用特定代码行的测试

解决方案

来自

更多详情在文档中.

I'm using IDEA in order to analyze our code coverage. I can see that some lines were called N number of times. But I also want to know which test caused that line call. I see the appropriate button "Show tests covering line", but this button is disabled for all of the lines.

So what is the reason of that behavior and is it possible to force IDEA to show tests which called a particular line of the code

解决方案

From the docs:

This button is only available in the Tracing mode, and with the Track per test coverage check box selected

You can enable tracing and 'track test per coverage' in the Run/Debug window. Here's a screenshot:

More details in the docs.

这篇关于Intellij Idea 如何显示测试覆盖线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆