aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-12-04 13:49:02 -0800
committerDan Albert <danalbert@google.com>2015-12-04 13:49:02 -0800
commitbf435cdbfc0124d810a6779f84e29d2412643ad1 (patch)
treef06e97d8afab4124817333f0a411c787707a32ab /tests
parentc926563c56f135a2cb84389b3e223934c31897c2 (diff)
downloadndk-bf435cdbfc0124d810a6779f84e29d2412643ad1.tar.gz
Further improve ASAN compatibility check.
Change-Id: Ic90944c8cb0dbb7ca534ee098e8048c0eaba6a50
Diffstat (limited to 'tests')
-rw-r--r--tests/run-all.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/run-all.py b/tests/run-all.py
index 4bdac4810..0201523f7 100644
--- a/tests/run-all.py
+++ b/tests/run-all.py
@@ -149,6 +149,26 @@ def check_adb_works_or_die(abi):
sys.exit(msg)
+def can_use_asan(abi, api, toolchain):
+ # ASAN is currently only supported for 32-bit ARM...
+ if not abi.startswith('armeabi'):
+ return False
+
+ # On KitKat and newer...
+ if api < 19:
+ return False
+
+ # When using clang...
+ if toolchain != 'clang':
+ return False
+
+ # On rooted devices.
+ if int(adb.get_prop('ro.debuggable')) == 0:
+ return False
+
+ return True
+
+
def asan_device_setup():
path = os.path.join(
os.environ['NDK'], 'toolchains', 'llvm', 'bin', 'asan_device_setup')
@@ -291,8 +311,7 @@ def main():
os.environ['ANDROID_SERIAL'] = get_test_device()
- # ASAN is currently only supported for 32-bit ARM with clang.
- if args.abi.startswith('armeabi') and args.toolchain == 'clang':
+ if can_use_asan(args.abi, api_level, args.toolchain):
asan_device_setup()
# Do this as part of initialization rather than with a `mkdir -p` later