Android的测试项目目录结构使用Eclipse当 [英] Android Test Project Directory Structure When Using Eclipse

查看:137
本文介绍了Android的测试项目目录结构使用Eclipse当的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

曾几何时,我避免Eclipse进行Android开发。而生活是不错的。

Once upon a time, I avoided Eclipse for Android development. And life was good.

在这个过程中,我采用了原本支持Android的命令行构建具有含测试code进行测试/ 子目录的工具,一个公约(例如: , MyProject的/ 是应用程序的故乡, MyProject的/测试/ 作为测试套件的家)。安卓确实使测试code驻留在一个单独的,但相关的项目,并让它作为一个子目录一个出色的工作保持了测试逻辑共同位于该项目适当的。

Along the way, I adopted a convention originally supported by the Android command-line build tools, of having a tests/ subdirectory containing the test code (e.g., MyProject/ being the home of the app, MyProject/tests/ being the home of the test suite). Android does an excellent job of allowing test code to reside in a separate-but-related project, and having it as a subdirectory kept the tests logically co-located with the project proper.

我现在转换到Eclipse,因为我需要更好地支持它为我的用户。我做支撑它的质量工作的唯一方法就是每天都使用它。而且,因为我有一个四核4GB内存,Eclipse的真正启动,在不到一分钟。 : - )

I am now switching to Eclipse, as I need to support it better for my subscribers. The only way for me to do a quality job of supporting it is to use it daily. And, since I have a quad-core with 4GB of RAM, Eclipse actually starts up in less than a minute. :-)

不过,preliminary的研究表明,Eclipse不支持分项目(即其子目录中的另一个Eclipse项目中的一个Eclipse项目)。

However, preliminary research suggests that Eclipse does not support sub-projects (i.e., one Eclipse project having another Eclipse project in a subdirectory).

所以,我的问题是:

  1. 我是正确的这一评估,如果我错了,有没有什么特别的步骤,我应该采取以确保Eclipse是幸福?我发现Eclipse可以有时会得到一丁点胡思乱想......

  1. Am I correct in this assessment, and if I'm wrong, are there any particular steps I should take to ensure that Eclipse is happy? I find that Eclipse can sometimes get a wee bit cranky...

如何在Android开发者组织的测试项目与项目进行测试?同行目录(例如, MyProject的/ 的应用, MyProjectTests / 的测试)?在一些有针对性的通用顶级同行的子目录(如, MyProject的/应用/ 的Andr​​oid应用程序, MyProject的/测试/ 的测试套件?)?别的东西?

How are Android developers organizing test projects relative to the project being tested? Peer directories (e.g., MyProject/ for the app, MyProjectTests/ for the tests)? Peer subdirectories under some targeted common top (e.g., MyProject/app/ for the Android app, MyProject/tests/ for the test suite?)? Something else?

顺便说一句,我运行Eclipse 3.5.2,如果该事项。

BTW, I'm running Eclipse 3.5.2, if that matters.

谢谢!

推荐答案

我已经创建测试项目与Eclipse 3.6.2我的主要项目中,就像你描述的命令行工具( MyProject的 MyProject的/测试是都包含一个src文件夹的Andr​​oid项目)。您可以通过取消选择默认位置,并设置路径使用新建的Andr​​oid测试项目本测试项目。

I've been creating test projects with Eclipse 3.6.2 inside my main project just like you describe for command line tools (MyProject and MyProject/test are Android projects that both contain a src folder). You can create this test project using the New Android Test Project by deselecting "Default Location" and setting the path.

没有我的项目是非常大的,但我已经迄今为止唯一的问题是,你不能使用MyProject的项目下的 MyProject的/测试文件夹。为了能够右键点击并运行一个测试用例,你必须直接从MyProjectTest项目访问文件。要从有问题prevent你,你可以添加一个资源筛选器隐藏在项目属性test文件夹>资源>资源过滤器。

None of my projects are very large, but the only problem I've had so far is that you cannot use the MyProject/test folder under the MyProject project. To be able to right click and run as a test case, you have to access files directly from the MyProjectTest project. To prevent you from having problems, you can add a Resource Filter to hide the test folder in Project Properties > Resource > Resource Filters.

不过,preliminary的研究表明,Eclipse不支持分项目(即其子目录中的另一个Eclipse项目中的一个Eclipse项目)。

However, preliminary research suggests that Eclipse does not support sub-projects (i.e., one Eclipse project having another Eclipse project in a subdirectory).

你见过什么问题?

这篇关于Android的测试项目目录结构使用Eclipse当的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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