Skip to content

Commit 8817303

Browse files
committed
Add a 'gnatcheck_env' configuration attribute to the GNATcheck testing driver
1 parent c37da4c commit 8817303

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

testsuite/drivers/gnatcheck_driver.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class GnatcheckDriver(BaseDriver):
6262
- ``gnatcheck_working_dir`` (str): Path to set as working directory
6363
when spawning GNATcheck. This path should be relative to the test
6464
working directory.
65+
- ``gnatcheck_env`` (dict[str, str]): Additional environment variable
66+
to set when running GNATcheck.
6567
- ``in_tty`` (bool): Whether to run GNATcheck in a pseudo TTY using the
6668
``pty`` Python module.
6769
- ``lkql_path`` (list[str]): A list of directories forwarded to the
@@ -415,7 +417,10 @@ def run_one_test(test_data: dict[str, any]) -> None:
415417
output_file_name = self.working_dir(f"{exe}.{'xml' if output_format == 'xml' else 'out'}")
416418
elif output_file_name:
417419
output_file_name = self.working_dir(output_file_name)
418-
test_env = dict(gnatcheck_env)
420+
421+
# The test environment is the common GNATcheck env merged with the
422+
# test defined one.
423+
test_env = dict(gnatcheck_env) | test_data.get("gnatcheck_env", {})
419424

420425
pre_python = test_data.get("pre_python", None)
421426
post_python = test_data.get("post_python", None)

0 commit comments

Comments
 (0)