Reputation: 44919
The standard tools advise creation of a separate project for testing. I personally would rather maintain the project proper and the testing code in the same project with one build script.
Is there a benefit to having two ant build.xml files and two manifests, the second being for a testing project?
Upvotes: 1
Views: 987
Reputation: 12377
The short answer is that the instrumentation provided by the test project on the main project allows it to make callbacks against the life cycle methods of the main project. It gives control over how the main project is loaded.
If the tests were part of the main project I don't think it would work the same way. The main project would need to be loaded to run the tests and then you couldn't actually test how the project was loaded.
Check this link on the developer site. It has some pretty good reasoning for a separate project.
Also check this question/answer, as they touch on the same topic.
Upvotes: 7