lundi 7 septembre 2015

How can I run adroid unit tests while not simultaneously starting the application?

When I run unit tests by adroid studio, the testrunner executes the test methods of the test case (which extends AndroidTestCase) as expected. However, the actual application (which extends Application) is started, too. Naturally this interferes with the unit tests, since both use the same classes and hardware resources. I have no idea why adroid studio (or any other module) starts the application?

I'm running the unit test e.g. by using the context menu of adroid studio (v 1.3.2), selecting the test case file/class and the selecting 'run' (ctrl+shift+f10), or using the run menu from the menu bar. The application and/or the unit tests run on a real device (HTC Nexus 9 Adroid 5.1.1 API 22) connected via USB. I can't use the emulator, since it does not provide bluetooth.

Aucun commentaire:

Enregistrer un commentaire