Reputation: 3087
I'm attempting to set up the android testing framework.
I have a project in ~/boldapp/BOLDApp/
I decided I should have by test project in ~/boldapp/BOLDApp/tests
as described in http://developer.android.com/tools/testing/testing_android.html#TestProjects
I have done the following as per http://developer.android.com/tools/testing/testing_otheride.html :
I run android create test-project -m ../ -n BOLDAppTest -p tests
I now want to run the Instrumentation test case MainActivityTest.java
that was generated.
When I run ant run-tests
, as suggested, I get:
BUILD FAILED
Target "run-tests" does not exist in the project "BOLDAppTest".
When I alternatively run ant test
part of the output is:
test:
[echo] Running tests ...
[exec] INSTRUMENTATION_STATUS: id=ActivityManagerService
[exec] INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: ComponentInfo{au.edu.unimelb.boldapp.tests/android.test.InstrumentationTestRunner}
[exec] INSTRUMENTATION_STATUS_CODE: -1
[exec] android.util.AndroidException: INSTRUMENTATION_FAILED:
I get the same error as above when I run adb shell am instrument -w au.edu.unimelb.boldapp.tests/android.test.InstrumentationTestRunner
:
as well as when I run:
adb shell am instrument -w au.edu.unimelb.boldapp/android.test.InstrumentationTestRunner
How do I run the test?
Upvotes: 1
Views: 1013
Reputation: 6206
you must.haven't installed test apk successfully in your device. you can check by execute adb shell "pm list instrumentation".
Upvotes: 2