由于org.junit.Test的CNF异常,Android代码覆盖率失败

时间:2013-06-11 09:29:45

标签: android ant instrumentation eclemma

当我使用ant运行以下代码覆盖率测试时出现以下错误:

ant emma debug install test

我是从Ubuntu 12.10终端运行的。 JUnit4库已正确添加到我的eclipse测试项目中。 测试项目是一个简单的Android测试项目。我不明白为什么我得到“没有在路径上找到类org.junit.test ...”我是否需要添加指定更多,以便构建知道还在生成的测试APK中包装junit? / p>

    -post-build:

debug:

install:
     [echo] Installing /home/jes/IDTest/bin/StartupActivityTest-debug.apk onto default emulator or device...
     [exec] 1017 KB/s (37974 bytes in 0.036s)
     [exec]     pkg: /data/local/tmp/StartupActivityTest-debug.apk
     [exec] Success

-set-mode-check:

-set-instrumented-mode:

install:
     [echo] Installing /home/jes/android/bin/StartupActivity-instrumented.apk onto default emulator or device...
     [exec] 1171 KB/s (9168346 bytes in 7.642s)
     [exec]     pkg: /data/local/tmp/StartupActivity-instrumented.apk
     [exec] Success

installi:

-check-env:
 [checkenv] Android SDK Tools Revision 21.1.0
 [checkenv] Installed at /home/jes/Development/sdk

-setup:
     [echo] Project Name: StartupActivityTest
  [gettype] Project Type: Test Application

-test-project-check:

test:
[getlibpath] Library dependencies:
[getlibpath] 
[getlibpath] ------------------
[getlibpath] Ordered libraries:
     [echo] Running tests...
     [echo] Running tests ...
     [exec] INSTRUMENTATION_RESULT: shortMsg=java.lang.ClassNotFoundException
     [exec] INSTRUMENTATION_RESULT: longMsg=java.lang.ClassNotFoundException: Didn't find class "org.junit.Test" on path: /system/framework/android.test.runner.jar:/data/app/test-1.apk:/data/app/ocr-2.apk
     [exec] INSTRUMENTATION_CODE: 0
     [echo] Setting permission to download the coverage file...
     [exec] Unable to chmod /data/data/ocr/coverage.ec: No such file or directory
     [echo] Downloading coverage file into project directory...
     [exec] remote object '/data/data/ocr/coverage.ec' does not exist

BUILD FAILED
/home/jes/Development/sdk/tools/ant/build.xml:1284: exec returned: 1

0 个答案:

没有答案