Skip to content

Commit fb63d5e

Browse files
committed
Add an 'include_file' configuration attribute to the GNATcheck testing driver
1 parent 57ea3b1 commit fb63d5e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

testsuite/drivers/gnatcheck_driver.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class GnatcheckDriver(BaseDriver):
7272
option.
7373
- ``input_sources`` (list[str]): Ada files to analyze (if explicit,
7474
optional if `project` is passed).
75+
- ``include_file`` (str): If passed, include all sources listed in the
76+
provided file.
7577
- ``ignore_file`` (str): If passed, ignore all sources listed in the
7678
provided file.
7779
- ``output_file`` (str): The file to pass to GNATcheck with the `-o` or
@@ -470,6 +472,15 @@ def run_one_test(test_data: dict[str, any]) -> None:
470472
elif output_format == "xml":
471473
args.append(f"-ox={output_file_name}")
472474

475+
# Add the include file if any
476+
include_file = test_data.get("include_file", None)
477+
if include_file:
478+
abs_include_file = self.working_dir(include_file)
479+
include_file = (
480+
abs_include_file if P.isfile(abs_include_file) else include_file
481+
)
482+
args += [f"-files={include_file}"]
483+
473484
# Add the ignore file if any
474485
ignore_file = test_data.get("ignore_file", None)
475486
if ignore_file:

0 commit comments

Comments
 (0)