[exim-cvs] Testsuite: env var for command

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Exim Git Commits Mailing List
Date:  
À: exim-cvs
Sujet: [exim-cvs] Testsuite: env var for command
Gitweb: https://git.exim.org/exim.git/commitdiff/03755744c9c07af50c92f44d287f1c4ea0db71be
Commit:     03755744c9c07af50c92f44d287f1c4ea0db71be
Parent:     a7079166663db0d37e659f36e75589738873c18d
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Feb 26 13:12:50 2023 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Feb 26 13:12:50 2023 +0000


    Testsuite: env var for command
---
 test/README  | 11 +++++++++++
 test/runtest |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)


diff --git a/test/README b/test/README
index f934c0d2d..6c9a2d8da 100644
--- a/test/README
+++ b/test/README
@@ -696,6 +696,17 @@ be replaced by the local host's name. Long commands can be continued over
several lines by using \ as a continuation character. This does *not* apply to
data lines.

+A line with a leading number followed by a space and then an uppercase
+word, equals character, value sets an expected return code as above
+plus an environment variable. Example:
+
+ 255 TZ=GB
+ exim_msgdate -l -u -z -localhost_number=20 000000 1PANS3 ZZZZZZ
+ ****
+
+
+
+
Here follows a list of supported commands. They can be divided into two groups:


diff --git a/test/runtest b/test/runtest
index 3931b06d4..137f8dac6 100755
--- a/test/runtest
+++ b/test/runtest
@@ -2304,10 +2304,11 @@ my($yield) = 1;

our %ENV = map { $_ => $ENV{$_} } grep { /^(?:USER|SHELL|PATH|TERM|EXIM_TEST_.*)$/ } keys %ENV;

-if (/^(\d+)\s*$/)                # Handle unusual return code
+if (/^(\d+)\s*(?:([A-Z]+)=(\S+))?$/)                # Handle unusual return code
   {
   my($r) = $_[2];
   $$r = $1 << 8;
+  $ENV{$2} = $3 if (defined $2);
   $_ = <SCRIPT>;
   return 4 if !defined $_;       # Missing command
   $lineno++;