[PATCH] D38526: [asan] Use full binary path in the Android test runner.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 5 13:02:15 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL315011: [asan] Use full binary path in the Android test runner. (authored by eugenis).

Changed prior to commit:
  https://reviews.llvm.org/D38526?vs=117615&id=117872#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D38526

Files:
  compiler-rt/trunk/test/sanitizer_common/android_commands/android_common.py
  compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py


Index: compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py
===================================================================
--- compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py
+++ compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py
@@ -5,8 +5,7 @@
 
 ANDROID_TMPDIR = '/data/local/tmp/Output'
 
-here = os.path.abspath(os.path.dirname(sys.argv[0]))
-device_binary = os.path.join(ANDROID_TMPDIR, os.path.basename(sys.argv[0]))
+device_binary = host_to_device_path(sys.argv[0])
 
 def build_env():
     args = []
Index: compiler-rt/trunk/test/sanitizer_common/android_commands/android_common.py
===================================================================
--- compiler-rt/trunk/test/sanitizer_common/android_commands/android_common.py
+++ compiler-rt/trunk/test/sanitizer_common/android_commands/android_common.py
@@ -1,4 +1,4 @@
-import os, subprocess, tempfile
+import os, sys, subprocess, tempfile
 import time
 
 ANDROID_TMPDIR = '/data/local/tmp/Output'
@@ -8,6 +8,11 @@
 if os.environ.get('ANDROID_RUN_VERBOSE') == '1':
     verbose = True
 
+def host_to_device_path(path):
+    rel = os.path.relpath(path, "/")
+    dev = os.path.join(ANDROID_TMPDIR, rel)
+    return dev
+
 def adb(args, attempts = 1):
     if verbose:
         print args
@@ -37,5 +42,5 @@
     return text
 
 def push_to_device(path):
-    dst_path = os.path.join(ANDROID_TMPDIR, os.path.basename(path))
+    dst_path = host_to_device_path(path)
     adb(['push', path, dst_path], 5)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38526.117872.patch
Type: text/x-patch
Size: 1533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171005/be651059/attachment.bin>


More information about the llvm-commits mailing list