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