Testuite: Document environment setting directives
authorTamar Christina <tamar.christina@arm.com>
Fri, 17 Jul 2020 12:12:46 +0000 (13:12 +0100)
committerTamar Christina <tamar.christina@arm.com>
Fri, 17 Jul 2020 12:12:46 +0000 (13:12 +0100)
This document some of the existing DejaGnu directives to modify
environment variables before test or compiler invocations.

gcc/ChangeLog:

* doc/sourcebuild.texi (dg-set-compiler-env-var,
dg-set-target-env-var): Document.

gcc/doc/sourcebuild.texi

index 9f37ac2624137021670414002c0e287e08e32f90..a7a922d84a206284b0bc5687b1b8ca1b31ec8725 100644 (file)
@@ -1244,6 +1244,18 @@ This DejaGnu directive compares @var{regexp} to the combined output
 that the test executable writes to @file{stdout} and @file{stderr}.
 @end table
 
+@subsubsection Specify environment variables for a test
+
+@table @code
+@item @{ dg-set-compiler-env-var @var{var_name} "@var{var_value}" @}
+Specify that the environment variable @var{var_name} needs to be set
+to @var{var_value} before invoking the compiler on the test file.
+
+@item @{ dg-set-target-env-var @var{var_name} "@var{var_value}" @}
+Specify that the environment variable @var{var_name} needs to be set
+to @var{var_value} before execution of the program created by the test.
+@end table
+
 @subsubsection Specify additional files for a test
 
 @table @code