如何使用eclipse Android的JUnit启动配置,以排除一个测试程序测试 [英] How to exclude a test from a test application using eclipse android-junit launch configuration

查看:226
本文介绍了如何使用eclipse Android的JUnit启动配置,以排除一个测试程序测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在测试一个应用程序项目和测试应用程序项目(在Android)。

I got an application project under test and a test application project (on Android).

我的测试程序包含了大量的测试,但我想找到一种机制,以排除测试,或者从测试发射测试类(从Eclipse中启动)。

My test app contains a lot of tests but I would like to find a mechanism to exclude a test, or a test class from the test launch (launched from eclipse).

我知道我可以排除基于注释,例如在命令行上测试,或者使用ant排除类,但我没有这种配置,并希望直接从日食排除它们)。

I know I can exclude tests on the command line based on annotations for instance, or use ant to exclude classes, but I don't have this kind of configuration and want to exclude them directly from eclipse).

是否有可能使用eclipse Android的JUnit的启动配置从一个测试程序排除测试,或者从一系列测试?

Is it possible to exclude a test, or a bunch of tests from a from a test application using eclipse android-junit launch configuration ?

在此先感谢!

推荐答案

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测试:

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:

这篇关于如何使用eclipse Android的JUnit启动配置,以排除一个测试程序测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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