Show the cause of failure in gradle stdout

Allows you to see the cause of a test failure without
having to wait for all tests to finish (you can't ctrl+c).

Even with  testLogging.exceptionFormat = 'full' (and I
validated that testLogging.showCauses is true) we often
get a shortened stacktrace.

This will print the full stacktrace to stdout

Also, this should help in getting more info from windows bots

Change-Id: Icb77c4690e04fe419f2d36ff93a0deef168ffbd5
diff --git a/build.gradle b/build.gradle
index 33605a1..037233f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1353,11 +1353,20 @@
             println "Start executing test ${desc.name} [${desc.className}]"
         }
         afterTest { desc, result ->
+            if (result.resultType == TestResult.ResultType.FAILURE) {
+                 result.exception.printStackTrace()
+            }
             if (project.hasProperty('update_test_timestamp')) {
                 file(project.getProperty('update_test_timestamp')).text = new Date().getTime()
             }
             println "Done executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
         }
+    } else {
+        afterTest { desc, result ->
+            if (result.resultType == TestResult.ResultType.FAILURE) {
+                 result.exception.printStackTrace()
+            }
+        }
     }
     if (project.hasProperty('no_internal')) {
         exclude "com/android/tools/r8/internal/**"