且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用eclipse Android的JUnit启动配置,以排除一个测试程序测试

更新时间:2023-09-18 11:50:46

Android的JUnit测试启动配置是缺乏功能只支持配置在目前运行的是所有测试或单独的一个测试类。

Android JUnit Test launch configuration is lack of functionality which only support configure running either all tests or single one test class at the moment.

此外,而不是试图包含/排除测试的JUnit运行时间前吧,我们可以包括/通过配置Eclipse项目构建路径排除在项目构建的时间特定的测试源文件,右键单击您的测试项目中,选择Build路径 - 配置构建路径,在源选项卡中,编辑排除部分并添加多个测试源文件,这将从您的项目构建路径排除测试源文件,并最终排除它们,当你开始运行Android JUnit测试:
如何使用eclipse Android的JUnit启动配置,以排除一个测试程序测试

Alternatively, instead of trying to include/exclude tests right before junit run time, we can include/exclude specific test source files at project build time by configuring project build path in Eclipse, right-click your test project, go to Build Path -- Configure Build Path, in the Source tab, edit Excluded section and add multiple test source files, this will exclude the test source files from your project build path and finally exclude them when you start running Android JUnit test: