Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing Robolectric 2.4和android.util.Log_Unit Testing_Debugging_Logging_Robolectric_Gradlew - Fatal编程技术网

Unit testing Robolectric 2.4和android.util.Log

Unit testing Robolectric 2.4和android.util.Log,unit-testing,debugging,logging,robolectric,gradlew,Unit Testing,Debugging,Logging,Robolectric,Gradlew,在使用Robolectric进行测试时,如何显示应用程序代码中的Log.d()输出?目前我使用的是2.4版 我最近经常在测试代码中做下一步(因为缺少与Android Studio的集成): System.out.println("TEST"); 并使用以下工具运行gradle: gradle testDebug -i 我最近经常在测试代码中做下一步(因为缺少与Android Studio的集成): System.out.println("TEST"); 并使用以下工具运行gradle: g

在使用Robolectric进行测试时,如何显示应用程序代码中的Log.d()输出?目前我使用的是2.4版

我最近经常在测试代码中做下一步(因为缺少与Android Studio的集成):

System.out.println("TEST");
并使用以下工具运行
gradle

gradle testDebug -i
我最近经常在测试代码中做下一步(因为缺少与Android Studio的集成):

System.out.println("TEST");
并使用以下工具运行
gradle

gradle testDebug -i
我最近经常在测试代码中做下一步(因为缺少与Android Studio的集成):

System.out.println("TEST");
并使用以下工具运行
gradle

gradle testDebug -i
我最近经常在测试代码中做下一步(因为缺少与Android Studio的集成):

System.out.println("TEST");
并使用以下工具运行
gradle

gradle testDebug -i

将此作为VM参数添加到您的运行配置中(在Android Studio中):


将此作为VM参数添加到您的运行配置中(在Android Studio中):


将此作为VM参数添加到您的运行配置中(在Android Studio中):


将此作为VM参数添加到您的运行配置中(在Android Studio中):


可能重复可能重复,但答案对我没有帮助。可能重复可能重复,但答案对我没有帮助。可能重复可能重复,但答案对我没有帮助。可能重复可能重复,但答案对我没有帮助。我使用“gradlew测试”运行我的测试。我应该怎么做才能看到任何调试输出。。。System.out或Log.d()?首先搜索“Robolectric+Log”线索tohttp://stackoverflow.com/questions/10219915/where-is-log-output-written-to-when-using-robolectric-roboguice. 你查过了吗?是的,但是答案对我没有帮助。也许我做错了什么。我看到你的评论了。因此,使用该解决方案,只需使用
-i
flag运行gradle。在这里,我使用“gradlew test”来运行我的测试。我应该怎么做才能看到任何调试输出。。。System.out或Log.d()?首先搜索“Robolectric+Log”线索tohttp://stackoverflow.com/questions/10219915/where-is-log-output-written-to-when-using-robolectric-roboguice. 你查过了吗?是的,但是答案对我没有帮助。也许我做错了什么。我看到你的评论了。因此,使用该解决方案,只需使用
-i
flag运行gradle。在这里,我使用“gradlew test”来运行我的测试。我应该怎么做才能看到任何调试输出。。。System.out或Log.d()?首先搜索“Robolectric+Log”线索tohttp://stackoverflow.com/questions/10219915/where-is-log-output-written-to-when-using-robolectric-roboguice. 你查过了吗?是的,但是答案对我没有帮助。也许我做错了什么。我看到你的评论了。因此,使用该解决方案,只需使用
-i
flag运行gradle。在这里,我使用“gradlew test”来运行我的测试。我应该怎么做才能看到任何调试输出。。。System.out或Log.d()?首先搜索“Robolectric+Log”线索tohttp://stackoverflow.com/questions/10219915/where-is-log-output-written-to-when-using-robolectric-roboguice. 你查过了吗?是的,但是答案对我没有帮助。也许我做错了什么。我看到你的评论了。因此,使用该解决方案,只需使用
-i
flag运行gradle,这里有更多详细信息