Just out of interest - why has it been decided to move tests to a separate project, not just to a separate source folder?
The test application "instruments" the target or main application.
The instrumentation section in the test project's AndroidManifest.xml allows the tests to run in the same process as the application. This instrumentation feature allows the test application to step through android component lifecycles in a controlled way.
Having this control allows you to (for example) create repeatable tests for cases for the activity lifecycle (create,resume,pause,destroy).
see http://developer.android.com/guide/topics/testing/testing_android.html#Instrumentation
So in summary, the extra application has special powers over the test target. Since these are encapsulated in the test application, your real application need only have the permissions it requires to perform its duty.
The current documentation, as I interpret it, states that you should hold the test code in a separate project in folder "tests" inside the applicaton project => "A project within a project"
http://developer.android.com/guide/topics/testing/testing_android.html#TestProjects
How ?
Creating an Android Test project in Eclipse
Why ?
Instead of ex. 40 projects you have 20 projects => better overview, less maintenance, faster eclipse.
Two build.xml => easier CI builds with Jenkins
Two manifest files => future versions of ADT build tools will support manifest merging
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With