問(wèn)題描述
我設(shè)法讓 gradle cC 工作.我的測(cè)試只是打印出來(lái)并記錄一行文本.
I managed to get gradle cC to work. My test just prints out and logs one line of text.
system.out
和 logging
輸出在哪里?
謝謝
edit:我找到了 unit 測(cè)試的輸出(它在 .../app/build/test-results/中).但仍然沒有運(yùn)氣.
edit: i found the output for the unit tests (it's in .../app/build/test-results/). but still no luck with the other.
有沒有辦法以某種方式保存檢測(cè)測(cè)試的輸出?
is there a way to save the output from the instrumented tests somehow?
推薦答案
運(yùn)行gradlew connectedCheck
會(huì)在build目錄生成測(cè)試結(jié)果,見
Running gradlew connectedCheck
will generate test results in the build directory, see
這些儀器測(cè)試還將其輸出以及任何 Log.d
語(yǔ)句記錄在 LogCat 中.在您的測(cè)試用例中使用 System.out.print
將產(chǎn)生如下輸出:
These instrumentation tests will also log their output in LogCat, along with any Log.d
statements. Using System.out.print
in your test cases will result in an output like this:
01-27 18:05:30.445 32664-32677/your.packagename I/System.out:測(cè)試輸出
01-27 18:05:30.445 32664-32677/your.packagename I/System.out﹕ Test output
如果您還需要持久化輸出,您可以編寫一個(gè)運(yùn)行 adb logcat
并從設(shè)備中提取日志的 gradle 任務(wù).
If you need to also persist the output you could probably write a gradle task running adb logcat
and pulling the logs from the device.
這篇關(guān)于android 儀器測(cè)試的輸出在哪里?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!