Android的Eclipse插件:仪器仪表测试运行没有指定 [英] Android Eclipse Plugin: Instrumentation Test Runner not specified
问题描述
我试图从Eclipse运行单元测试与Android项目时收到此错误。仪器测试运行的列表是空的,在Android preferences。
I'm getting this error when trying to run unit tests from Eclipse with an Android Project. The list of Instrumentation Test Runners is empty in the Android preferences.
[2009-06-17 23点57分51秒 - 的MyApp]错误: 应用程序没有指定 android.test.InstrumentationTestRunner 仪器仪表或不申报 使用库android.test.runner
[2009-06-17 23:57:51 - MyApp] ERROR: Application does not specify a android.test.InstrumentationTestRunner instrumentation or does not declare uses-library android.test.runner
它也烦人的决定,因为我试图运行单元测试一次,这是我一直想做的事情。
It's also annoyingly decided that because I tried to run a unit test once, that's what I always want to do.
推荐答案
在运行配置
你可能有 Android的JUnit测试
,如果有这里面的任何新的启动配置项,删除它,然后运行你的应用程序将运行。
In the Run Configuration
you may have Android JUnit Test
, if there are any new launch configuration entries inside this, you delete it and then run your application it will run.
请注意 - 这很可能是解决办法,如果你试图在从约瑟夫的回答说明添加正确的线路清单之前运行测试用例。如果你这样做了,删除配置(这就会抱怨没有仪器测试运行已在它的头被指定),然后再运行它作为一个Android JUnit测试,它会创建一个有效的配置拿起正确的东西,你已添加到清单(见本约瑟夫的答案)。
NOTE - This is likely to be the solution if you tried to run the test case before adding the correct lines to the manifest as described in the answer from Josef. If you have done this, delete the configuration (which will be complaining that no instrumentation test runner has been specified in its header) and then run it as an Android Junit Test again and it will create a valid configuration picking up the correct stuff that you have added to the manifest (see Josef's answer for this).
这篇关于Android的Eclipse插件:仪器仪表测试运行没有指定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!