Where is log output written to when using Robolectric + Roboguice?

后端 未结 6 1702
被撕碎了的回忆
被撕碎了的回忆 2021-02-01 13:10

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,

6条回答
  •  别跟我提以往
    2021-02-01 13:48

    When running tests with maven all you need is something like this :

                     
                        org.apache.maven.plugins
                        maven-surefire-plugin
                        2.17
                        
                            
                              stdout
                            
                        
                     
    

    When running the tests locally, e.g. in intellij, then all you need is an environmental variable: Just go (for intellij) to Run/Debug Configurations --> Defaults -->Junit --> VM options and add

    -Drobolectric.logging=stdout
    

提交回复
热议问题