我需要一个非常简单的方法来启用 Robolectric 3.0 的日志记录。我想看到来自Robolectric的输出,而不仅仅是我的测试输出。我尝试过网上的所有方法都不起作用。
我应该把它放在哪里?
robolectric.logging.enabled = true
我尝试了以下方法:
在 test/java/res 目录下的 robolectric.properties 文件中
在 test/java/resources 目录下的 robolectric.properties 文件中
在 test/res 目录下的 robolectric.properties 文件中
在 test/resources 目录下的 robolectric.properties 文件中
在 gradle 中:
afterEvaluate {
project.tasks.withType(Test) {
systemProperties.put('robolectric.logging.enable', 'true')
}
}
在Gradle中:
tasks.withType(Test) {
testLogging.exceptionFormat = 'full'
systemProperties.put('robolectric.logging.enable', 'true')
}