scripts: twister: Fix duplicate scans
If the src_dir_path is a child of testsuite_path, some c files might be scanned twice. To prevent that, we check for parentage. Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
This commit is contained in:
parent
3ba4c98a1d
commit
ef792d1b9a
1 changed files with 6 additions and 0 deletions
|
@ -310,7 +310,13 @@ def scan_testsuite_path(testsuite_path):
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
logger.error("%s: error parsing source file: %s" % (filename, e))
|
logger.error("%s: error parsing source file: %s" % (filename, e))
|
||||||
|
|
||||||
|
src_dir_pathlib_path = Path(src_dir_path)
|
||||||
for filename in find_c_files_in(testsuite_path):
|
for filename in find_c_files_in(testsuite_path):
|
||||||
|
# If we have already scanned those files in the src_dir step, skip them.
|
||||||
|
filename_path = Path(filename)
|
||||||
|
if src_dir_pathlib_path in filename_path.parents:
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result: ScanPathResult = scan_file(filename)
|
result: ScanPathResult = scan_file(filename)
|
||||||
if result.warnings:
|
if result.warnings:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue