Reputation: 16428
I've got my main application project, and then a second project for my tests. Is it good practice to store all types of tests in that test project, or should some reside in the main application project?
Should I keep POJO JUnits (ones that test non-android derived classes) in my main project, or group them all together? I can't see anything on the Google documentation that advises where to locate tests.
Thanks
Upvotes: 3
Views: 311
Reputation: 2861
The Android test documetation says
... the best approach is to add the test project so that its root directory
tests/
is at the same level as thesrc/
directory of the main application's project.
There is even an illustration of the directory structure in the documentation.
Jarl
Upvotes: 1
Reputation: 1966
Rather than creating two projects, its very good practice to create a second 'source' folder in the original android (or java) project and put your tests in that. When you export as an app, you can exclude that source folder from the compiled application.
Upvotes: 4