Move ASan lit-tests under test/asan
[blocksruntime.git] / test / asan / android_commands / android_compile.py
blob4b880886b0c1ef04c96754580399c7795fbbeaca
1 #!/usr/bin/python
3 import os, sys, subprocess
4 from android_common import *
7 here = os.path.abspath(os.path.dirname(sys.argv[0]))
8 android_run = os.path.join(here, 'android_run.py')
10 output = None
11 output_type = 'executable'
13 args = sys.argv[1:]
14 while args:
15 arg = args.pop(0)
16 if arg == '-shared':
17 output_type = 'shared'
18 elif arg == '-c':
19 output_type = 'object'
20 elif arg == '-o':
21 output = args.pop(0)
23 if output == None:
24 print "No output file name!"
25 sys.exit(1)
27 ret = subprocess.call(sys.argv[1:])
28 if ret != 0:
29 sys.exit(ret)
31 if output_type in ['executable', 'shared']:
32 push_to_device(output)
34 if output_type == 'executable':
35 os.rename(output, output + '.real')
36 os.symlink(android_run, output)