[英]Run unit tests on Save with Android Studio
Has anyone managed to make a reasonably comfortable setup for their project where unit tests run on every save? 有没有人设法为他们的项目做一个相当舒适的设置,在每次保存时运行单元测试?
I currently have a split project -- An Android Application project, and a Java project that the android application depends upon. 我目前有一个拆分项目 - 一个Android应用程序项目,以及一个Android应用程序所依赖的Java项目。 I write unit tests for the Java project and run them manually every now and then.
我为Java项目编写单元测试并且不时地手动运行它们。
In my understanding, to make this happen as expected, I also want to have incremental builds for the Java project. 根据我的理解,为了实现预期,我还希望为Java项目提供增量构建。 I am not sure that this is feasibly possible while using Gradle with its current state of affairs.
在使用Gradle及其当前状态时,我不确定这是否可行。
If you are using Eclipse or IntelliJ with JUnit, you can use InfiniTest to run tests on save. 如果您使用Eclipse或IntelliJ和JUnit,则可以使用InfiniTest在保存时运行测试。 InfiniTest only runs tests for code that has changed rather than running everything, so it's great for TDD.
InfiniTest只对已更改而不是运行所有内容的代码运行测试,因此对于TDD来说非常棒。 InfiniTest is completely decoupled from Gradle, so you don't have to worry about incremental builds.
InfiniTest与Gradle完全分离,因此您不必担心增量构建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.