From 293cb38a377d8825cec5bf0199a980428b745b48 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Fri, 10 Mar 2017 13:57:57 -0800 Subject: [PATCH] Fix tests: export_include_dirs. Test: tests/test.py passes. Change-Id: Id5dd4bf0939b7d51bcb63fa38a1237d62ae919ab --- vndk/tools/header-checker/tests/utils.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vndk/tools/header-checker/tests/utils.py b/vndk/tools/header-checker/tests/utils.py index 81e5c7df5..dc5e91497 100644 --- a/vndk/tools/header-checker/tests/utils.py +++ b/vndk/tools/header-checker/tests/utils.py @@ -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, '.')