Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run unit test on a android module?

I have a android project that has multiple library modules and I am trying to test a specific package that contains all modules.

I tried this command:

./gradlew -Dtest.single=com.moduleone* testProductionDebug

And it does not work: it doesn't execute the tests inside this module, but instead executes all the unit tests in the main project package class.

How do I test just the one module?

like image 281
Jonathan Avatar asked Oct 20 '16 14:10

Jonathan


1 Answers

You can use test suits: https://developer.android.com/reference/junit/framework/TestSuite.html . Definition of a suit contains classes of tests you need

like image 80
Alex Shutov Avatar answered Oct 26 '22 01:10

Alex Shutov