5

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

ant emma debug install test

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

    -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
4

0 回答 0