From 6b5253a766d4057904e422b132c0ed796787aa48 Mon Sep 17 00:00:00 2001 From: Oksana Salyk Date: Fri, 12 Apr 2024 14:06:48 +0200 Subject: [PATCH] doc: add a new path to find macros --- utils/check_docs/docs_tests.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/utils/check_docs/docs_tests.py b/utils/check_docs/docs_tests.py index f09b9f9b22d..172452af35e 100644 --- a/utils/check_docs/docs_tests.py +++ b/utils/check_docs/docs_tests.py @@ -61,22 +61,24 @@ def get_macros(pmdk_path): macros = [] exceptions = get_exceptions(pmdk_path) is_macro_in_next_line = False - includes_path = path.join(pmdk_path, 'src', 'include', 'libpmemobj') + includes_path = [path.join(pmdk_path, 'src', 'include', 'libpmemobj'), + path.join(pmdk_path, 'src', 'include')] # Definition of macro occurs after the phrases: 'static inline' or '#define' - for header_file in listdir(includes_path): - with open(path.join(includes_path, header_file), 'r') as f: - file_lines = f.readlines() - for line in file_lines: - if line.startswith('static inline'): - is_macro_in_next_line = True - elif is_macro_in_next_line: - parse_macro_name(exceptions, line, - EXPRESSION_AT_THE_LINE_START, macros) - is_macro_in_next_line = False - elif '#define' in line: - parse_macro_name(exceptions, line, - EXPRESSION_AFTER_DEFINE_PHRASE, macros) - return macros + for include_path in includes_path: + for header_file in listdir(include_path): + with open(path.join(include_path, header_file), 'r') as f: + file_lines = f.readlines() + for line in file_lines: + if line.startswith('static inline'): + is_macro_in_next_line = True + elif is_macro_in_next_line: + parse_macro_name(exceptions, line, + EXPRESSION_AT_THE_LINE_START, macros) + is_macro_in_next_line = False + elif '#define' in line: + parse_macro_name(exceptions, line, + EXPRESSION_AFTER_DEFINE_PHRASE, macros) + return macros def get_functions_from_so_files(lib_path):