In the way it works on Eclipse for Android development, yuo can easily :
- create a library project, and then no apk will be generated but rather a jar that will be added as dependency to apps that will use the library
- create an android project and rather easily create a test project for it, using Instrumentation test cases, etc..
This works pretty well. But how do you provide unit and functional tests for an android librairy ?
As soon as I turn my library-project into a library through eclipse then, it's not testable any more as no apk is generated, no apk is installed on the device to be instrumented by the test app.
And more over, if my lib needs some permissions, an app using the lib can add the permissions to its manifest, but a testing app can't do that ! The testing framework instruments the tested app using the permission declared by the app under test, not the testing app.
An obvious answer would be not to unit test the library itself, but to test a sample app using the library but we are far from unit tests...
Thanks in advance, folks !
A more detailled aspect of this problem can be found here.