如何从测试应用程序中使用eclipse排除android-junit启动配置的测试 [英] How to exclude a test from a test application using eclipse android-junit launch configuration

查看:240
本文介绍了如何从测试应用程序中使用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排除类,但是我没有这种配置从eclipse直接排除它们)。

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中配置项目构建路径来包含/排除特定的测试源文件,右键单击测试项目,在源选项卡中的创建路径 - 配置构建路径中,编辑已排除部分并添加多个测试源文件s,这将从您的项目构建路径中排除测试源文件,最后在开始运行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天全站免登陆