configure Robolectric to write logs (tests output) into external file

大兔子大兔子 提交于 2019-12-13 03:44:29

问题


I'm adding the following code to build.gradle :

android{
    testOptions {
        unitTests.all {
            systemProperty 'robolectric.logging', '/path/to/file/robolectric.log'
            systemProperty 'robolectric.logging.enabled', 'true'
        }
    }
}

The file /path/to/file/robolectric.log has 777 permissions.

The robolectric.logging.enabled=true is working because I started to see the output when I had configured with robolectric.logging=stdout (like here)

Questions:

1) How to configure Robolectric to write the output into a file ?
2) How to configure Robolectric to write the output into something like build/output/robolectric.log? The test cases are executed by Jenkins and I would like to have the option to have the robotic logging for each execution.

来源:https://stackoverflow.com/questions/35726314/configure-robolectric-to-write-logs-tests-output-into-external-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!