Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the output from an android instrumented test?

I managed to get gradle cC to work. My test just prints out and logs one line of text.

grep -r text * fails.

where is the system.out and logging output?

thanks

edit: i found the output for the unit tests (it's in .../app/build/test-results/). but still no luck with the other.

is there a way to save the output from the instrumented tests somehow?

like image 456
Ray Tayek Avatar asked Dec 13 '15 02:12

Ray Tayek


1 Answers

Running gradlew connectedCheck will generate test results in the build directory, see

\build\reports\androidTests\connected\
  and
\build\outputs\androidTest-results\connected\

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﹕ Test output

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.

like image 77
David Medenjak Avatar answered Oct 15 '22 00:10

David Medenjak