I\'m using Robolectric to test Android. I\'m running my tests via maven, e.g.
mvn -Dtest=LogTest test
If I have code that writes to the logs,
By default, logging output when using the RobolectricTestRunner disappears. You can configure where it goes by looking at the setupLogging() method of that class.
To summarize, you need to set the robolectric.logging
system property to either stdout
, stderr
, or a file path where the log should be written. I do this in the constructor of a subclass of RobolectricTestRunner
that I use for all tests so that logs always get written to stdout.