Merge "Fix tests: export_include_dirs." am: 94af0f2003

am: df1eaafa4d

Change-Id: I09d5e12b262e55b739e3eb0fcddac178d48a151b
This commit is contained in:
Jayant Chowdhary
2017-03-13 22:48:11 +00:00
committed by android-build-merger

View File

@@ -13,13 +13,21 @@ BUILTIN_HEADERS_DIR = (
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=[]):
with tempfile.TemporaryDirectory() as tmp:
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:
cmd += ['-isystem', d]
cmd += cflags
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, '.')