Merge "Fix tests: export_include_dirs." am: 94af0f2003
am: df1eaafa4d
Change-Id: I09d5e12b262e55b739e3eb0fcddac178d48a151b
This commit is contained in:
@@ -13,13 +13,21 @@ BUILTIN_HEADERS_DIR = (
|
|||||||
os.path.join(AOSP_DIR, 'prebuilts', 'sdk', 'renderscript', 'clang-include'),
|
os.path.join(AOSP_DIR, 'prebuilts', 'sdk', 'renderscript', 'clang-include'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
EXPORTED_HEADERS_DIR = (
|
||||||
|
os.path.join(AOSP_DIR, 'development', 'vndk', 'tools', 'header-checker',
|
||||||
|
'tests'),
|
||||||
|
)
|
||||||
|
|
||||||
def run_header_checker(input_path, cflags=[]):
|
def run_header_checker(input_path, cflags=[]):
|
||||||
with tempfile.TemporaryDirectory() as tmp:
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
output_name = os.path.join(tmp, os.path.basename(input_path)) + '.dump'
|
output_name = os.path.join(tmp, os.path.basename(input_path)) + '.dump'
|
||||||
cmd = ['header-abi-dumper', '-o', output_name, input_path, '--']
|
cmd = ['header-abi-dumper', '-o', output_name, input_path,]
|
||||||
|
for d in EXPORTED_HEADERS_DIR:
|
||||||
|
cmd += ['-I', d]
|
||||||
|
cmd+= ['--']
|
||||||
for d in BUILTIN_HEADERS_DIR:
|
for d in BUILTIN_HEADERS_DIR:
|
||||||
cmd += ['-isystem', d]
|
cmd += ['-isystem', d]
|
||||||
cmd += cflags
|
cmd += cflags
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
with open(output_name + '.txt', 'r') as f:
|
with open(output_name, 'r') as f:
|
||||||
return f.read().replace(SCRIPT_DIR, '.')
|
return f.read().replace(SCRIPT_DIR, '.')
|
||||||
|
|||||||
Reference in New Issue
Block a user