エミュレーターや実際のデバイスを使用せずに、git からプロジェクトをフェッチし、テスト プロジェクトでテストを実行する AutoTest スクリプトを作成しようとしています。
2 つのプロジェクトをダウンロードし、同じディレクトリに配置して、次のコマンドを実行しました。
$ android update project -p Labyrinth -n Labyrinth
Updated local.properties
Added file Labyrinth/build.xml
Updated file Labyrinth/proguard-project.txt
$ android update test-project -m ../Labyrinth -p LabyrinthTest/
Resolved location of main project to: /home/me/labyrinth-temp/Labyrinth
Updated project.properties
Updated local.properties
Added file LabyrinthTest/build.xml
Updated file LabyrinthTest/proguard-project.txt
Updated ant.properties
Buildfile: /home/me/labyrinth-temp/LabyrinthTest/build.xml
次に、フォルダー LabyrinthTest に移動してテストを実行しようとすると、次のようになります。
$ ant run-tests
BUILD FAILED
Target "run-tests" does not exist in the project "LabyrinthTest".
Total time: 0 seconds
私はググって、過去3〜4時間で見つけることができるすべてのものを試してみましたが、何の進歩もありません. ただし、エミュレーターで「ant テスト」を実行すると機能します。しかし、私はそれなしでそれを実行したいです。
$ ant test
Buildfile: /home/me/labyrinth-temp/LabyrinthTest/build.xml
-test-project-check:
test:
[echo] Running tests ...
[exec]
[exec] com.app.labyrinth.test.BallTest:...
[exec] Test results for InstrumentationTestRunner=...
[exec] Time: 0.034
[exec]
[exec] OK (3 tests)
[exec]
[exec]
BUILD SUCCESSFUL 合計時間: 1 秒
情報が必要な場合:
Android API version used: 7 (2.1 Eclair)
Android SDK Tools version: 18
Apache Ant(TM) version 1.8.3 compiled on May 17 2012