mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ci: Fix false positive err-logs on static-assert check
This commit is contained in:
parent
25a56d13d7
commit
cbff23cfdb
@ -176,7 +176,7 @@ class PublicHeaderChecker:
|
|||||||
temp_header = None
|
temp_header = None
|
||||||
try:
|
try:
|
||||||
_, _, _, temp_header, _ = exec_cmd_to_temp_file(['sed', '/#include/d; /#error/d', header], suffix='.h')
|
_, _, _, temp_header, _ = exec_cmd_to_temp_file(['sed', '/#include/d; /#error/d', header], suffix='.h')
|
||||||
res = self.preprocess_one_header(temp_header, num, ignore_sdkconfig_issue=True)
|
res = self.preprocess_one_header(temp_header, num, ignore_common_issues=True)
|
||||||
if res == self.PREPROC_OUT_SAME_HRD_FAILED:
|
if res == self.PREPROC_OUT_SAME_HRD_FAILED:
|
||||||
raise HeaderFailedCppGuardMissing()
|
raise HeaderFailedCppGuardMissing()
|
||||||
elif res == self.PREPROC_OUT_DIFFERENT_NO_EXT_C_HDR_FAILED:
|
elif res == self.PREPROC_OUT_DIFFERENT_NO_EXT_C_HDR_FAILED:
|
||||||
@ -196,11 +196,11 @@ class PublicHeaderChecker:
|
|||||||
self.log('\nCompilation command failed:\n{}\n'.format(cmd), True)
|
self.log('\nCompilation command failed:\n{}\n'.format(cmd), True)
|
||||||
raise HeaderFailedBuildError()
|
raise HeaderFailedBuildError()
|
||||||
|
|
||||||
def preprocess_one_header(self, header: str, num: int, ignore_sdkconfig_issue: bool=False) -> int:
|
def preprocess_one_header(self, header: str, num: int, ignore_common_issues: bool=False) -> int:
|
||||||
all_compilation_flags = ['-w', '-P', '-E', '-DESP_PLATFORM', '-include', header, self.main_c] + self.include_dir_flags
|
all_compilation_flags = ['-w', '-P', '-E', '-DESP_PLATFORM', '-include', header, self.main_c] + self.include_dir_flags
|
||||||
# just strip comments to check for CONFIG_... macros or static asserts
|
# just strip comments to check for CONFIG_... macros or static asserts
|
||||||
rc, out, err, _ = exec_cmd([self.gcc, '-fpreprocessed', '-dD', '-P', '-E', header] + self.include_dir_flags)
|
rc, out, err, _ = exec_cmd([self.gcc, '-fpreprocessed', '-dD', '-P', '-E', header] + self.include_dir_flags)
|
||||||
if not ignore_sdkconfig_issue:
|
if not ignore_common_issues: # We ignore issues on sdkconfig and static asserts, as we're looking at "preprocessed output"
|
||||||
if re.search(self.kconfig_macro, out):
|
if re.search(self.kconfig_macro, out):
|
||||||
# enable defined #error if sdkconfig.h not included
|
# enable defined #error if sdkconfig.h not included
|
||||||
all_compilation_flags.append('-DIDF_CHECK_SDKCONFIG_INCLUDED')
|
all_compilation_flags.append('-DIDF_CHECK_SDKCONFIG_INCLUDED')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user