Fix the asan test setup for the old layout.

Change-Id: Iad9352405062b27b052db086149dc3a9a96054f3
diff --git a/tests/ndk.py b/tests/ndk.py
index 73960af..5e392db 100644
--- a/tests/ndk.py
+++ b/tests/ndk.py
@@ -26,21 +26,25 @@
 NDK_ROOT = os.path.realpath(os.path.join(THIS_DIR, '..'))
 
 
-def get_tool(tool):
-    ext = ''
-    if sys.platform == 'win32':
-        ext = '.exe'
-
+def get_host_tag():
     if sys.platform.startswith('linux'):
-        host_tag = 'linux-x86_64'
+        return 'linux-x86_64'
     elif sys.platform == 'darwin':
-        host_tag = 'darwin-x86_64'
+        return 'darwin-x86_64'
     elif sys.platform == 'win32':
         host_tag = 'windows-x86_64'
         test_path = os.path.join(os.environ['NDK'], 'prebuilt', host_tag)
         if not os.path.exists(test_path):
             host_tag = 'windows'
+        return host_tag
 
+
+def get_tool(tool):
+    ext = ''
+    if sys.platform == 'win32':
+        ext = '.exe'
+
+    host_tag = get_host_tag()
     prebuilt_path = os.path.join(os.environ['NDK'], 'prebuilt', host_tag)
     return os.path.join(prebuilt_path, 'bin', tool) + ext
 
diff --git a/tests/run-all.py b/tests/run-all.py
index fd32388..d694d00 100644
--- a/tests/run-all.py
+++ b/tests/run-all.py
@@ -43,6 +43,7 @@
 
 import adb
 import filters
+import ndk
 import printers
 import tests
 
@@ -171,7 +172,8 @@
 
 def asan_device_setup():
     path = os.path.join(
-        os.environ['NDK'], 'toolchains', 'llvm', 'bin', 'asan_device_setup')
+        os.environ['NDK'], 'toolchains', 'llvm', 'prebuilt',
+        ndk.get_host_tag(), 'bin', 'asan_device_setup')
     subprocess.check_call([path])