构建Eclipse项目时自动运行JUnit [英] Run JUnit automatically when building Eclipse project
问题描述
我该怎么办?是唯一的选择是获取一个蚂蚁脚本,并更改项目构建以使用蚂蚁脚本与目标构建和编译?
更新现在我将尝试两种不同的方法:
- 为我的项目运行一个额外的构建器
- ct-eclipse ,由Thorbjørn
确定运行所有测试是不明智的,因为我们可以有例如20.000个测试,而我们的更改只能影响,我们说其中有50个,其中包括我们已经更改的类的测试,以及与我们的类协作的类的测试。
有一个非常简单的插件称为infinitetest http:// improvementworks.com/products/infinitest/ ,它仅在我们保存更改之后运行一些测试(与我们已更改的类相关)。它也很好地与编辑器(使用注释)和问题视图集成 - 显示不通过的测试,如错误。
I want to run my unit tests automatically when I save my Eclipse project. The project is built automatically whenever I save a file, so I think this should be possible in some way.
How do I do it? Is the only option really to get an ant script and change the project build to use the ant script with targets build and compile?
Update I will try 2 different approaches now:
- Running an additional builder for my project that executes the ant target test (I have an ant script anyway)
- ct-eclipse, recommended by Thorbjørn
For sure it it unwise to run all tests, because we can have for example 20.000 tests whereas our change could affect only, let's say 50 of them, among which are tests for the class we have changed and tests for classes that collaborate with our class.
There is an unseful plugin called infinitetest http://improvingworks.com/products/infinitest/ which runs only some tests ( related to class we've changed ) just after we save changes. It also integrate quite nicely with editor ( using annotations ) and problem view - displaying not-passing tests like errors.
这篇关于构建Eclipse项目时自动运行JUnit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!