问题
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