[英]Run JUnit in IntelliJ while ignoring compilation error in an unrelated class?
When running a JUnit test case in IntelliJ it opens up the Make console and shows complication errors in an unrelated class. 在IntelliJ中运行JUnit测试用例时,它会打开Make控制台并显示不相关类中的复杂错误。
Can I run the test case ignoring these errors? 我可以运行测试用例忽略这些错误吗?
Is there a way to make it not compile the entire project when running the test cases but only those class files required by the test case? 有没有办法让它在运行测试用例时不编译整个项目,而只测试测试用例所需的那些类文件?
Yes you can. 是的你可以。
You can disable the Make before Run. 您可以禁用“运行前制作”。
(The following is written for IntelliJ 14, different versions might have slightly different layouts, but as far as I can remember these options have been the same for a while) (以下是针对IntelliJ 14编写的,不同版本的布局可能略有不同,但据我记忆,这些选项暂时相同)
For a single test 对于单个测试
For all tests: 对于所有测试:
If you want to remove this by default for all new test configurations (which might not be a terribly good idea, since then you got to allways build manually when running tests) 如果你想在所有新测试配置中删除它(这可能不是一个非常好的主意,从那时起你必须在运行测试时手动构建)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.