Roll clang + fix run_android_test
Clang:
-the sub-revision was mismatching chromium's (1 vs 8)
tools/run_android_test:
- adb push was unnecessarily noisy, spamming logs.
- the TEST_RET_CODE boilerplate was unnecessary,
adb shell propagates the exit code properly.
It check_output() was causing the output to be
retained until the end with no reason.
Change-Id: I39cba05fb5aa2db5cf4afd2c52ee5daade6dce13
Test: ci.perfetto.dev is happy
diff --git a/tools/run_android_test b/tools/run_android_test
index f22138d..7772ddb 100755
--- a/tools/run_android_test
+++ b/tools/run_android_test
@@ -87,6 +87,13 @@
return subprocess.check_call(cmd)
+def AdbPush(host, device):
+ cmd = [ADB_PATH, 'push', host, device]
+ print '> adb push ' + ' '.join(cmd[2:])
+ with open(os.devnull) as devnull:
+ return subprocess.check_call(cmd, stdout=devnull)
+
+
def GetProp(prop):
cmd = [ADB_PATH, 'shell', 'getprop', prop]
print '> adb ' + ' '.join(cmd)
@@ -143,17 +150,17 @@
# This gets linked into our tests via libundwindstack.so.
#
# See https://android.googlesource.com/platform/system/core/+/master/rootdir/etc/ld.config.txt.
- AdbCall('push', test_bin, "/data/nativetest")
+ AdbPush(test_bin, "/data/nativetest")
if not args.no_data_deps:
for dep in EnumerateDataDeps():
- AdbCall('push', os.path.join(ROOT_DIR, dep), target_dir + '/' + dep)
+ AdbPush(os.path.join(ROOT_DIR, dep), target_dir + '/' + dep)
# LLVM sanitizers require to sideload a libclangrtXX.so on the device.
sanitizer_libs = os.path.join(args.out_dir, 'sanitizer_libs')
env = ' '.join(args.env if args.env is not None else []) + ' '
if os.path.exists(sanitizer_libs):
- AdbCall('push', sanitizer_libs, target_dir)
+ AdbPush(sanitizer_libs, target_dir)
env += 'LD_LIBRARY_PATH="%s/sanitizer_libs" ' % (target_dir)
cmd = 'cd %s;' % target_dir;
binary = env + '/data/nativetest/%s' % args.test_name
@@ -161,15 +168,18 @@
if args.cmd_args:
actual_args = [arg.replace(args.test_name, binary) for arg in args.cmd_args]
cmd += ' ' + ' '.join(actual_args)
- cmd += ';echo -e "\\nTEST_RET_CODE=$?"'
print cmd
- test_output = subprocess.check_output([ADB_PATH, 'shell', cmd])
- print test_output
- retcode = re.search(r'^TEST_RET_CODE=(\d)', test_output, re.MULTILINE)
- assert retcode, 'Could not find TEST_RET_CODE=N marker'
- retcode = int(retcode.group(1))
+ retcode = subprocess.call([ADB_PATH, 'shell', cmd])
if not args.no_cleanup:
AdbCall('shell', 'rm -rf "%s"' % target_dir)
+
+ # Smoke test that adb shell is actually propagating retcode. adb has a history
+ # of breaking this.
+ test_code = subprocess.call([ADB_PATH, 'shell', 'echo Done; exit 42'])
+ if test_code != 42:
+ logging.fatal('adb is incorrectly propagating the exit code')
+ return 1
+
return retcode