[compiler-rt] r260473 - [asan] Dump adb output on failure.

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 16:16:29 PST 2016


Author: eugenis
Date: Wed Feb 10 18:16:28 2016
New Revision: 260473

URL: http://llvm.org/viewvc/llvm-project?rev=260473&view=rev
Log:
[asan] Dump adb output on failure.

This is an asan/android test harness change aiming to catch
"adb pull" failures on the buildbot.

Modified:
    compiler-rt/trunk/test/asan/android_commands/android_common.py

Modified: compiler-rt/trunk/test/asan/android_commands/android_common.py
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/android_commands/android_common.py?rev=260473&r1=260472&r2=260473&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/android_commands/android_common.py (original)
+++ compiler-rt/trunk/test/asan/android_commands/android_common.py Wed Feb 10 18:16:28 2016
@@ -11,8 +11,18 @@ if os.environ.get('ANDROID_RUN_VERBOSE')
 def adb(args):
     if verbose:
         print args
-    devnull = open(os.devnull, 'w')
-    return subprocess.call([ADB] + args, stdout=devnull, stderr=subprocess.STDOUT)
+    tmpname = tempfile.mktemp()
+    out = open(tmpname, 'w')
+    ret = subprocess.call([ADB] + args, stdout=out, stderr=subprocess.STDOUT)
+    if ret != 0:
+        print "adb command failed", args
+        print tmpname
+        out.close()
+        out = open(tmpname, 'r')
+        print out.read()
+    out.close()
+    os.unlink(tmpname)
+    return ret
 
 def pull_from_device(path):
     tmp = tempfile.mktemp()




More information about the llvm-commits mailing list