[Note from the future, 2021, added at the bottom - they shortened the answer]
Below i have a project with the above structure.
I can happily run uni tests fine inside the app module but unit tests found on the lib module doesn't get run unless i manually right click DummyDataTest.java inside the lib module and click run unit test inside Android studio.
Is there a way to automatically run unit tests located in my lib module through command line?
The existing command line ./gradlew testDebug only runs the unit tests located inside the app module.
Thanks in advance
JUnitTestProject
app [module]
src
main
java
de.ivu.junittest.app
DummyModel.java
...
...
test
java
de.ivu.junittest.app
DummyModelTest.java
...
lib [module]
src
main
java
de.ivu.junittest
DummyData.java
...
...
test
java
de.ivu.junittest.app
DummyDataTest.java
...
Yes, use ./gradlew lib:testDebugUnitTest
to run tests from lib module.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With