Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run all unit & instrumentation in all modules Gradle android

Tags:

android

gradle

I have a project and have many modules inside it, and each module has unit tests and instrumentation tests. Every time I run a test I have to set the the target module in the configuration. Which is tiring to do.

Is there any gradle command to run all modules tests in one run?

btw, I can run in terminal this command. But can execute it one by one.

./gradlew module-a:connectedAndroidTest
./gradlew module-b:connectedAndroidTest
./gradlew module-c:connectedAndroidTest

Thanks

like image 427
Samoka Avatar asked Sep 16 '16 04:09

Samoka


People also ask

How do I run all unit tests in Visual Studio?

To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).

How do I run all Python unit tests in a directory?

Run all Python tests in a directoryFrom the context menu, select the corresponding run command. If the directory contains tests that belong to the different testing frameworks, select the configuration to be used. For example, select Run 'All tests in: <directory name>' Run pytest in <directory name>'.

How run all test cases in Android?

Run all tests in a single classRight click on a test class name in the editor (or a filename in the project explorer) to run all tests in a single class. The default keyboard shortcut for this is Ctrl+Shift+F10 on Linux. I suggest you map it to something easier to remember like Ctrl+Alt+R.


1 Answers

The following command:

gradlew test connectedAndroidTest

Should run all you unit and instrummented tests.

like image 167
Androiderson Avatar answered Oct 11 '22 20:10

Androiderson